pub trait TransportExt {
    fn readable<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn writeable<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn readable_or_writeable<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn read_exact<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 mut [u8]
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn read_to_end<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 mut Vec<u8>
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn read_to_string<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 mut String
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn write_all<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Required Methods

Waits for the transport to be readable to follow up with try_read.

Waits for the transport to be writeable to follow up with try_write.

Waits for the transport to be either readable or writeable.

Reads exactly n bytes where n is the length of buf by continuing to call try_read until completed. Calls to readable are made to ensure the transport is ready. Returns the total bytes read.

Reads all bytes until EOF in this source, placing them into buf.

All bytes read from this source will be appended to the specified buffer buf. This function will continuously call try_read to append more data to buf until try_read returns either Ok(0) or an error that is neither [Interrupted] or [WouldBlock].

If successful, this function will return the total number of bytes read.

Errors

If this function encounters an error of the kind [Interrupted] or [WouldBlock], then the error is ignored and the operation will continue.

If any other read error is encountered then this function immediately returns. Any bytes which have already been read will be appended to buf.

Reads all bytes until EOF in this source, placing them into buf.

If successful, this function will return the total number of bytes read.

Errors

If the data in this stream is not valid UTF-8 then an error is returned and buf is unchanged.

See read_to_end for other error semantics.

Writes all of buf by continuing to call try_write until completed. Calls to [writeable] are made to ensure the transport is ready.

Implementors