Trait IP2PConnection

Source
pub trait IP2PConnection<M>: Send + 'static {
    // Required methods
    fn send<'life0, 'async_trait>(
        &'life0 mut self,
        message: M,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn receive<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<M>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_dyn(self) -> DynP2PConnection<M>
       where Self: Sized { ... }
}

Required Methods§

Source

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

Source

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

Provided Methods§

Source

fn into_dyn(self) -> DynP2PConnection<M>
where Self: Sized,

Implementations on Foreign Types§

Source§

impl<M> IP2PConnection<M> for Connection
where M: Serialize + DeserializeOwned + Send + 'static,

Source§

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

Source§

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

Source§

impl<M> IP2PConnection<M> for Framed<TlsStream<TcpStream>, LengthDelimitedCodec>
where M: Encodable + Decodable + Serialize + DeserializeOwned + Send + 'static,

Source§

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

Source§

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

Implementors§