pub trait Transport: Reconnectable + Send + Sync {
    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
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

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

Required Methods

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.

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.

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

Trait Implementations

Attempts to reconnect an already-established connection.
Tries to read data from the transport into the provided buffer, returning how many bytes were read. Read more
Try to write a buffer to the transport, returning how many bytes were written. Read more
Waits for the transport to be ready based on the given interest, returning the ready status. Read more

Implementations on Foreign Types

Implementors