pub trait ReadAsync<'a, T, FRead, FReadExact>where
    FRead: Future<Output = Result<usize, Error>> + 'a,
{ fn read(&'a mut self, bytes: &'a mut [u8]) -> FRead; fn read_exact(&'a mut self, bytes: &'a mut [u8]) -> FReadExact; }
Expand description

Trait that adds async variants of some std::io::Read functions.

Required Methods§

Async equivalent to std::io::Read::read.

Async equivalent to std::io::Read::read_exact. This MAY read more bytes than the length of the array if needed (namely, when using UdpSockets), but will avoid doing so to the best of its ability.

Implementors§