Trait libp2prs_traits::WriteEx [−][src]
Write Trait for async/await
Required methods
#[must_use]fn write2<'life0, 'life1, 'async_trait>(
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Attempt to write bytes from buf
into the object.
On success, returns Ok(num_bytes_written)
.
Otherwise, returns Err(io:Error)
#[must_use]fn flush2<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Attempt to flush the object, ensuring that any buffered data reach their destination.
On success, returns Ok(())
.
Otherwise, returns Err(io:Error)
#[must_use]fn close2<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Attempt to close the object.
On success, returns Ok(())
.
Otherwise, returns Err(io:Error)
Provided methods
#[must_use]fn write_all2<'life0, 'life1, 'async_trait>(
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Attempt to write the entire contents of data into object.
The operation will not complete until all the data has been written.
On success, returns Ok(())
.
Otherwise, returns Err(io:Error)
#[must_use]fn write_varint<'life0, 'async_trait>(
&'life0 mut self,
len: usize
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
len: usize
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Writes a variable-length integer to the underlying IO.
On success, returns Ok(())
.
Otherwise, returns Err(io:Error)
Note: Does NOT flush the IO.
#[must_use]fn write_fixed_u32<'life0, 'async_trait>(
&'life0 mut self,
len: usize
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
len: usize
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Writes a fixed-length integer to the underlying IO.
On success, returns Ok(())
.
Otherwise, returns Err(io:Error)
Note: Does NOT flush the IO.
#[must_use]fn write_one_fixed<'life0, 'life1, 'async_trait>(
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a fixed length message to the underlying IO, then flushes the writing side.
Note: Prepends a fixed-length prefix indicate the length of the message. This is compatible with what
read_one_fixed
expects.
#[must_use]fn write_one<'life0, 'life1, 'async_trait>(
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a variable length message to the underlying IO, then flushes the writing side.
On success, returns Ok(())
.
Otherwise, returns Err(io:Error)
Note: Prepends a variable-length prefix indicate the length of the message. This is compatible with what
read_one
expects.
Implementors
impl<T: AsyncWrite + Unpin + Send> WriteEx for T
[src]
fn write2<'life0, 'life1, 'async_trait>(
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
buf: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn flush2<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn close2<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,