pub trait AsyncInlinableRead: AsyncRead + Unpin + Send {
    // Provided methods
    fn read_len_with_width<'life0, 'async_trait, const N: usize>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn read_len_with_data<'life0, 'async_trait, const N: usize>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn read_inlined_bytes<'life0, 'async_trait, const N: usize>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn read_inlined_str<'life0, 'async_trait, const N: usize>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn read_inlinable<'life0, 'async_trait, T>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
       where T: Sized + 'async_trait + AsyncInlinable,
             Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Provided Methods§

source

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

Read N bytes as usize.

Only 1/2/4/8 is valid as N.

source

fn read_len_with_data<'life0, 'async_trait, const N: usize>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Read a bytes len with width N and the next len - N bytes into a Vec

The bytes contains:

+--------------+-----------------+
| len: N bytes | data: len - N bytes |
+--------------+-----------------+
source

fn read_inlined_bytes<'life0, 'async_trait, const N: usize>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Read inlined bytes with specific length width N.

The inlined bytes are constructed as:

+--------------+-----------------+
| len: N bytes | data: len bytes |
+--------------+-----------------+
source

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

Read inlined string with specific length width N.

The inlined string are constructed as:

+--------------+-----------------+
| len: N bytes | data: len bytes |
+--------------+-----------------+
source

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

Read some bytes into inlinable object.

Implementors§

source§

impl<T> AsyncInlinableRead for Twhere T: AsyncRead + Send + Unpin,