pub trait TransportExt {
// Required methods
fn readable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn writeable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn readable_or_writeable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_to_end<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_to_string<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut String,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_all<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Methods§
Sourcefn readable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Waits for the transport to be readable to follow up with try_read
.
Sourcefn writeable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn writeable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Waits for the transport to be writeable to follow up with try_write
.
Sourcefn readable_or_writeable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readable_or_writeable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Waits for the transport to be either readable or writeable.
Sourcefn read_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn read_to_end<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_to_end<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads all bytes until EOF in this source, placing them into buf
.
All bytes read from this source will be appended to the specified buffer buf
. This
function will continuously call try_read
to append more data to buf
until
try_read
returns either Ok(0)
or an error that is neither [Interrupted
] or
[WouldBlock
].
If successful, this function will return the total number of bytes read.
§Errors
If this function encounters an error of the kind [Interrupted
] or [WouldBlock
], then
the error is ignored and the operation will continue.
If any other read error is encountered then this function immediately returns. Any bytes
which have already been read will be appended to buf
.
Sourcefn read_to_string<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut String,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_to_string<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut String,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads all bytes until EOF in this source, placing them into buf
.
If successful, this function will return the total number of bytes read.
§Errors
If the data in this stream is not valid UTF-8 then an error is returned and buf
is
unchanged.
See read_to_end
for other error semantics.
Sourcefn write_all<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_all<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Writes all of buf
by continuing to call try_write
until completed. Calls to
[writeable
] are made to ensure the transport is ready.