referrerpolicy=no-referrer-when-downgrade

Trait relay_utils::relay_loop::Client

source ·
pub trait Client: 'static + Clone + Send + Sync {
    type Error: 'static + Debug + MaybeConnectionError + Send + Sync;

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

    // Provided method
    fn reconnect_until_success<'life0, 'async_trait>(
        &'life0 mut self,
        delay: Duration,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Basic blockchain client from relay perspective.

Required Associated Types§

source

type Error: 'static + Debug + MaybeConnectionError + Send + Sync

Type of error these clients returns.

Required Methods§

source

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

Try to reconnect to source node.

Provided Methods§

source

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

Try to reconnect to the source node in an infinite loop until it succeeds.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Client for ()

§

type Error = StringifiedMaybeConnectionError

source§

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

Implementors§