RelayExt

Trait RelayExt 

Source
pub trait RelayExt: Relay {
    // Required methods
    fn broadcast_with_timeout<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        session_id: &'life1 SessionId,
        round: u32,
        message: &'life2 T,
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where T: 'async_trait + Serialize + Send + Sync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn collect_broadcasts_with_timeout<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        session_id: &'life1 SessionId,
        round: u32,
        count: usize,
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>
       where T: 'async_trait + DeserializeOwned + Send,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Extension trait for relay with timeout support

Required Methods§

Source

fn broadcast_with_timeout<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, session_id: &'life1 SessionId, round: u32, message: &'life2 T, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where T: 'async_trait + Serialize + Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Broadcast with timeout

Source

fn collect_broadcasts_with_timeout<'life0, 'life1, 'async_trait, T>( &'life0 self, session_id: &'life1 SessionId, round: u32, count: usize, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>
where T: 'async_trait + DeserializeOwned + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Collect broadcasts with timeout

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.

Implementors§

Source§

impl<R: Relay + ?Sized> RelayExt for R