pub struct RpcNodeClient { /* private fields */ }Expand description
Node client implementation that connects to node via RPC (WebSockets).
This implementation is supposed to be used on local network and not via public Internet due to sensitive contents.
Implementations§
Source§impl RpcNodeClient
impl RpcNodeClient
Sourcepub async fn new(url: &str) -> Result<Self, JsonError>
pub async fn new(url: &str) -> Result<Self, JsonError>
Create a new instance of NodeClient.
Trait Implementations§
Source§impl Clone for RpcNodeClient
impl Clone for RpcNodeClient
Source§fn clone(&self) -> RpcNodeClient
fn clone(&self) -> RpcNodeClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RpcNodeClient
impl Debug for RpcNodeClient
Source§impl NodeClient for RpcNodeClient
impl NodeClient for RpcNodeClient
Source§fn submit_block_seal<'life0, 'async_trait>(
&'life0 self,
block_seal: BlockSealResponse,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_block_seal<'life0, 'async_trait>(
&'life0 self,
block_seal: BlockSealResponse,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a block seal
Source§fn farmer_app_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<FarmerAppInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn farmer_app_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<FarmerAppInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get farmer app info
Source§fn subscribe_slot_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SlotInfo> + Send + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_slot_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SlotInfo> + Send + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to slot
Source§fn submit_solution_response<'life0, 'async_trait>(
&'life0 self,
solution_response: SolutionResponse,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_solution_response<'life0, 'async_trait>(
&'life0 self,
solution_response: SolutionResponse,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a slot solution
Source§fn subscribe_block_sealing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = BlockSealInfo> + Send + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_block_sealing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = BlockSealInfo> + Send + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to block sealing requests
Source§fn subscribe_archived_segment_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SegmentHeader> + Send + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_archived_segment_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SegmentHeader> + Send + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to archived segment headers
Source§fn segment_headers<'life0, 'async_trait>(
&'life0 self,
segment_indices: Vec<SegmentIndex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn segment_headers<'life0, 'async_trait>(
&'life0 self,
segment_indices: Vec<SegmentIndex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get segment headers for the segments
Source§fn piece<'life0, 'async_trait>(
&'life0 self,
piece_index: PieceIndex,
) -> Pin<Box<dyn Future<Output = Result<Option<Piece>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn piece<'life0, 'async_trait>(
&'life0 self,
piece_index: PieceIndex,
) -> Pin<Box<dyn Future<Output = Result<Option<Piece>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get piece by index.
Source§fn acknowledge_archived_segment_header<'life0, 'async_trait>(
&'life0 self,
segment_index: SegmentIndex,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn acknowledge_archived_segment_header<'life0, 'async_trait>(
&'life0 self,
segment_index: SegmentIndex,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acknowledge segment header.
Source§impl NodeClientExt for RpcNodeClient
impl NodeClientExt for RpcNodeClient
Source§fn cached_segment_headers<'life0, 'async_trait>(
&'life0 self,
segment_indices: Vec<SegmentIndex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cached_segment_headers<'life0, 'async_trait>(
&'life0 self,
segment_indices: Vec<SegmentIndex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the cached segment headers for the given segment indices.
If there is a cache, it is not updated, to avoid remote denial of service. Read more
Source§fn last_segment_headers<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn last_segment_headers<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get up to
limit most recent segment headers.
If there is a cache, it is not updated, to avoid remote denial of service. Read moreAuto Trait Implementations§
impl Freeze for RpcNodeClient
impl !RefUnwindSafe for RpcNodeClient
impl Send for RpcNodeClient
impl Sync for RpcNodeClient
impl Unpin for RpcNodeClient
impl !UnwindSafe for RpcNodeClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more