pub struct CachingProxyNodeClient<NC> { /* private fields */ }Expand description
Node client wrapper around another node client that caches some data for better performance and proxies other requests through.
NOTE: Archived segment acknowledgement is ignored in this client, all subscriptions are acknowledged implicitly and immediately. NOTE: Subscription messages that are not processed in time will be skipped for performance reasons!
Implementations§
Source§impl<NC> CachingProxyNodeClient<NC>where
NC: NodeClient + Clone,
impl<NC> CachingProxyNodeClient<NC>where
NC: NodeClient + Clone,
Trait Implementations§
Source§impl<NC: Clone> Clone for CachingProxyNodeClient<NC>
impl<NC: Clone> Clone for CachingProxyNodeClient<NC>
Source§fn clone(&self) -> CachingProxyNodeClient<NC>
fn clone(&self) -> CachingProxyNodeClient<NC>
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<NC: Debug> Debug for CachingProxyNodeClient<NC>
impl<NC: Debug> Debug for CachingProxyNodeClient<NC>
Source§impl<NC> NodeClient for CachingProxyNodeClient<NC>where
NC: NodeClient,
impl<NC> NodeClient for CachingProxyNodeClient<NC>where
NC: NodeClient,
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 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,
Gets segment headers for the given segment indices, updating the cache from the node if needed.
Returns None for segment indices that are not in the cache.
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 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<NC> NodeClientExt for CachingProxyNodeClient<NC>where
NC: NodeClientExt,
impl<NC> NodeClientExt for CachingProxyNodeClient<NC>where
NC: NodeClientExt,
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<NC> Freeze for CachingProxyNodeClient<NC>where
NC: Freeze,
impl<NC> !RefUnwindSafe for CachingProxyNodeClient<NC>
impl<NC> Send for CachingProxyNodeClient<NC>where
NC: Send,
impl<NC> Sync for CachingProxyNodeClient<NC>where
NC: Sync,
impl<NC> Unpin for CachingProxyNodeClient<NC>where
NC: Unpin,
impl<NC> !UnwindSafe for CachingProxyNodeClient<NC>
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