FetchCurrent

Trait FetchCurrent 

Source
pub trait FetchCurrent: Sized {
    // Required methods
    fn fetch_current<'life0, 'async_trait>(
        sdk: &'life0 Sdk,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_current_with_metadata<'life0, 'async_trait>(
        sdk: &'life0 Sdk,
    ) -> Pin<Box<dyn Future<Output = Result<(Self, ResponseMetadata), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_current_with_metadata_and_proof<'life0, 'async_trait>(
        sdk: &'life0 Sdk,
    ) -> Pin<Box<dyn Future<Output = Result<(Self, ResponseMetadata, Proof), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Helper trait for fetching current state from Platform without query parameters.

Implemented for types that have a single “current” value on Platform, such as the current epoch (ExtendedEpochInfo) or total credits in platform.

Required Methods§

Source

fn fetch_current<'life0, 'async_trait>( sdk: &'life0 Sdk, ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the current value from Platform.

Source

fn fetch_current_with_metadata<'life0, 'async_trait>( sdk: &'life0 Sdk, ) -> Pin<Box<dyn Future<Output = Result<(Self, ResponseMetadata), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the current value from Platform with metadata.

Source

fn fetch_current_with_metadata_and_proof<'life0, 'async_trait>( sdk: &'life0 Sdk, ) -> Pin<Box<dyn Future<Output = Result<(Self, ResponseMetadata, Proof), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the current value from Platform with metadata and proof.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FetchCurrent for ExtendedEpochInfo

Source§

fn fetch_current<'life0, 'async_trait>( sdk: &'life0 Sdk, ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_current_with_metadata<'life0, 'async_trait>( sdk: &'life0 Sdk, ) -> Pin<Box<dyn Future<Output = Result<(Self, ResponseMetadata), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_current_with_metadata_and_proof<'life0, 'async_trait>( sdk: &'life0 Sdk, ) -> Pin<Box<dyn Future<Output = Result<(Self, ResponseMetadata, Proof), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§