Trait NodeClientExt

Source
pub trait NodeClientExt: NodeClient {
    // Required methods
    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 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;
}
Expand description

Node Client extension methods that are not necessary for farmer as a library, but might be useful for an app

Required Methods§

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,

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.

Returns None for segment indices that are not in the cache.

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,

Get up to limit most recent segment headers. If there is a cache, it is not updated, to avoid remote denial of service.

If the node or cache has less than limit segment headers, the returned vector will be shorter. Each returned segment header is wrapped in Some.

Implementors§