Trait AsyncConnection

Source
pub trait AsyncConnection<Frame: TokioFrame> {
    type Error: Send + Sync;

    // Required methods
    fn connect<'async_trait>(
        addr: impl 'async_trait + ToSocketAddrs,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn read(&mut self) -> Result<Option<Frame>, Self::Error>;
    fn write<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        frame: &'life1 Frame,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn connect<'async_trait>( addr: impl 'async_trait + ToSocketAddrs, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Source

fn read(&mut self) -> Result<Option<Frame>, Self::Error>

Source

fn write<'life0, 'life1, 'async_trait>( &'life0 mut self, frame: &'life1 Frame, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§