pub trait Network<D: Data>: Send + Sync {
    // Required methods
    fn send(&self, data: D, recipient: Recipient) -> Result<(), SendError>;
    fn next<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Option<D>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A generic interface for sending and receiving data.

Required Methods§

source

fn send(&self, data: D, recipient: Recipient) -> Result<(), SendError>

source

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

Implementors§

source§

impl<D: Data, N: NetworkExt<D>> Network<D> for N