pub trait AsyncInlinable {
    // Required methods
    fn read_inlined<'life0, 'async_trait, R>(
        reader: &'life0 mut R
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             R: 'async_trait + AsyncRead + Send + Unpin,
             'life0: 'async_trait;
    fn write_inlined<'life0, 'life1, 'async_trait, W>(
        &'life0 self,
        wtr: &'life1 mut W
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where W: 'async_trait + AsyncWrite + Send + Unpin,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn read_optional_inlined<'life0, 'async_trait, R>(
        reader: &'life0 mut R
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self>>> + Send + 'async_trait>>
       where Self: Sized + Send + 'async_trait,
             R: 'async_trait + AsyncRead + Send + Unpin,
             'life0: 'async_trait { ... }
    fn write_inlined_with<'life0, 'life1, 'async_trait, W>(
        &'life0 self,
        wtr: &'life1 mut W,
        _opts: InlineOpts
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where W: 'async_trait + AsyncWrite + Send + Unpin,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn inlined<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn printable_inlined<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

If one struct could be serialized/flattened to bytes array, we call it inlinable.

Required Methods§

source

fn read_inlined<'life0, 'async_trait, R>( reader: &'life0 mut R ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, R: 'async_trait + AsyncRead + Send + Unpin, 'life0: 'async_trait,

Read inlined bytes into object.

source

fn write_inlined<'life0, 'life1, 'async_trait, W>( &'life0 self, wtr: &'life1 mut W ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Send + Unpin, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Write inlined bytes to a writer.

Provided Methods§

source

fn read_optional_inlined<'life0, 'async_trait, R>( reader: &'life0 mut R ) -> Pin<Box<dyn Future<Output = Result<Option<Self>>> + Send + 'async_trait>>
where Self: Sized + Send + 'async_trait, R: 'async_trait + AsyncRead + Send + Unpin, 'life0: 'async_trait,

source

fn write_inlined_with<'life0, 'life1, 'async_trait, W>( &'life0 self, wtr: &'life1 mut W, _opts: InlineOpts ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Send + Unpin, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Write inlined bytes with specific options

source

fn inlined<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get inlined bytes as vector.

source

fn printable_inlined<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.

Object Safety§

This trait is not object safe.

Implementors§