pub trait AsyncInlinableWrite:
AsyncWrite
+ Send
+ Unpin {
// Provided methods
fn write_len_with_width<'life0, 'async_trait, const N: usize>(
&'life0 mut self,
len: usize,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn write_inlined_bytes<'life0, 'life1, 'async_trait, const N: usize>(
&'life0 mut self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn write_inlined_str<'life0, 'life1, 'async_trait, const N: usize>(
&'life0 mut self,
s: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn write_inlinable<'life0, 'life1, 'async_trait, T>(
&'life0 mut self,
value: &'life1 T,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,
T: 'async_trait + AsyncInlinable + Sync,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Provided Methods§
Sourcefn write_len_with_width<'life0, 'async_trait, const N: usize>(
&'life0 mut self,
len: usize,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_len_with_width<'life0, 'async_trait, const N: usize>(
&'life0 mut self,
len: usize,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write usize length as little endian N bytes.
Sourcefn write_inlined_bytes<'life0, 'life1, 'async_trait, const N: usize>(
&'life0 mut self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_inlined_bytes<'life0, 'life1, 'async_trait, const N: usize>(
&'life0 mut self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write inlined bytes to writer with specific length width N.
The inlined bytes are constructed as:
+--------------+-----------------+
| len: N bytes | data: len bytes |
+--------------+-----------------+§Safety
Write inlined bytes may not be safe if the input bytes length overflows to the width.
For example, write 256 bytes with length width 1 is not safe.
Sourcefn write_inlined_str<'life0, 'life1, 'async_trait, const N: usize>(
&'life0 mut self,
s: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_inlined_str<'life0, 'life1, 'async_trait, const N: usize>(
&'life0 mut self,
s: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write inlined string with specific length width N.
Sourcefn write_inlinable<'life0, 'life1, 'async_trait, T>(
&'life0 mut self,
value: &'life1 T,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
T: 'async_trait + AsyncInlinable + Sync,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_inlinable<'life0, 'life1, 'async_trait, T>(
&'life0 mut self,
value: &'life1 T,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
T: 'async_trait + AsyncInlinable + Sync,
'life0: 'async_trait,
'life1: 'async_trait,
Write an inlinable object.
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.