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§
Sourcefn read_inlined<'life0, 'async_trait, R>(
reader: &'life0 mut R,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
fn read_inlined<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
Read inlined bytes into object.
Sourcefn 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,
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§
fn read_optional_inlined<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>>> + Send + 'async_trait>>
Sourcefn 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 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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.