referrerpolicy=no-referrer-when-downgrade

Trait relay_substrate_client::guard::Environment

source ·
pub trait Environment<C>: Send + Sync + 'static {
    type Error: Display + Send + Sync + 'static;

    // Required method
    fn runtime_version<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeVersion, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn now(&self) -> Instant { ... }
    fn sleep<'life0, 'async_trait>(
        &'life0 mut self,
        duration: Duration,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn abort<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Guards environment.

Required Associated Types§

source

type Error: Display + Send + Sync + 'static

Error type.

Required Methods§

source

fn runtime_version<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<RuntimeVersion, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return current runtime version.

Provided Methods§

source

fn now(&self) -> Instant

Return current time.

source

fn sleep<'life0, 'async_trait>( &'life0 mut self, duration: Duration, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sleep given amount of time.

source

fn abort<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Abort current process. Called when guard condition check fails.

Implementors§

source§

impl<C: Chain, Clnt: Client<C>> Environment<C> for Clnt

§

type Error = Error