pub trait Transport: Reconnectable + Debug + Send + Sync {
    // Required methods
    fn try_read(&self, buf: &mut [u8]) -> Result<usize>;
    fn try_write(&self, buf: &[u8]) -> Result<usize>;
    fn ready<'life0, 'async_trait>(
        &'life0 self,
        interest: Interest
    ) -> Pin<Box<dyn Future<Output = Result<Ready>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Interface representing a transport of raw bytes into and out of the system.

Required Methods§

source

fn try_read(&self, buf: &mut [u8]) -> Result<usize>

Tries to read data from the transport into the provided buffer, returning how many bytes were read.

This call may return an error with ErrorKind::WouldBlock in the case that the transport is not ready to read data.

source

fn try_write(&self, buf: &[u8]) -> Result<usize>

Try to write a buffer to the transport, returning how many bytes were written.

This call may return an error with ErrorKind::WouldBlock in the case that the transport is not ready to write data.

source

fn ready<'life0, 'async_trait>( &'life0 self, interest: Interest ) -> Pin<Box<dyn Future<Output = Result<Ready>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Waits for the transport to be ready based on the given interest, returning the ready status.

Trait Implementations§

source§

impl Reconnectable for Box<dyn Transport>

source§

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

Attempts to reconnect an already-established connection.
source§

impl Transport for Box<dyn Transport>

source§

fn try_read(&self, buf: &mut [u8]) -> Result<usize>

Tries to read data from the transport into the provided buffer, returning how many bytes were read. Read more
source§

fn try_write(&self, buf: &[u8]) -> Result<usize>

Try to write a buffer to the transport, returning how many bytes were written. Read more
source§

fn ready<'life0, 'async_trait>( &'life0 self, interest: Interest ) -> Pin<Box<dyn Future<Output = Result<Ready>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Waits for the transport to be ready based on the given interest, returning the ready status.

Implementations on Foreign Types§

source§

impl Transport for Box<dyn Transport>

source§

fn try_read(&self, buf: &mut [u8]) -> Result<usize>

source§

fn try_write(&self, buf: &[u8]) -> Result<usize>

source§

fn ready<'life0, 'async_trait>( &'life0 self, interest: Interest ) -> Pin<Box<dyn Future<Output = Result<Ready>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Implementors§