pub trait NetworkSender: Send + Sync + 'static {
    type SenderError: Error;

    // Required method
    fn send<'a, 'async_trait>(
        &'a self,
        data: impl 'async_trait + Into<Vec<u8>> + Send + Sync + 'static
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::SenderError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
}
Expand description

Abstraction over a sender to the raw network.

Required Associated Types§

Required Methods§

source

fn send<'a, 'async_trait>( &'a self, data: impl 'async_trait + Into<Vec<u8>> + Send + Sync + 'static ) -> Pin<Box<dyn Future<Output = Result<(), Self::SenderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

A method for sending data. Returns Error if not connected to the peer.

Object Safety§

This trait is not object safe.

Implementors§