referrerpolicy=no-referrer-when-downgrade
relay_utils::relay_loop

Trait 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.

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 Client for ()

Source§

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§

impl<P: SubstrateFinalitySyncPipeline, SourceClnt: Client<P::SourceChain>> Client for SubstrateFinalitySource<P, SourceClnt>

impl<P: SubstrateFinalitySyncPipeline, TargetClnt: Client<P::TargetChain>> Client for SubstrateFinalityTarget<P, TargetClnt>

impl<P: SubstrateMessageLane, SourceClnt: Client<P::SourceChain>, TargetClnt: Client<P::TargetChain>> Client for SubstrateMessagesSource<P, SourceClnt, TargetClnt>

impl<P: SubstrateMessageLane, SourceClnt: Client<P::SourceChain>, TargetClnt: Client<P::TargetChain>> Client for SubstrateMessagesTarget<P, SourceClnt, TargetClnt>

impl<P: SubstrateParachainsPipeline, SourceClnt: Client<P::SourceRelayChain>, TargetClnt: Client<P::TargetChain>> Client for ParachainsTarget<P, SourceClnt, TargetClnt>

impl<P: SubstrateParachainsPipeline, SourceRelayClnt: Client<P::SourceRelayChain>> Client for ParachainsSource<P, SourceRelayClnt>