pub trait AsyncReadExt: AsyncRead {
Show 29 methods
// Provided methods
fn by_ref(&mut self) -> &mut Self
where Self: Sized { ... }
async fn read_exact<T: IoBufMut>(&mut self, buf: T) -> BufResult<(), T> { ... }
async fn read_to_end(&mut self, buf: Vec<u8>) -> BufResult<usize, Vec<u8>> { ... }
async fn read_vectored_exact<T: IoVectoredBufMut>(
&mut self,
buf: T,
) -> BufResult<(), T> { ... }
fn take(self, limit: u64) -> Take<Self>
where Self: Sized { ... }
async fn read_u8(&mut self) -> Result<u8> { ... }
async fn read_u8_le(&mut self) -> Result<u8> { ... }
async fn read_u16(&mut self) -> Result<u16> { ... }
async fn read_u16_le(&mut self) -> Result<u16> { ... }
async fn read_u32(&mut self) -> Result<u32> { ... }
async fn read_u32_le(&mut self) -> Result<u32> { ... }
async fn read_u64(&mut self) -> Result<u64> { ... }
async fn read_u64_le(&mut self) -> Result<u64> { ... }
async fn read_u128(&mut self) -> Result<u128> { ... }
async fn read_u128_le(&mut self) -> Result<u128> { ... }
async fn read_i8(&mut self) -> Result<i8> { ... }
async fn read_i8_le(&mut self) -> Result<i8> { ... }
async fn read_i16(&mut self) -> Result<i16> { ... }
async fn read_i16_le(&mut self) -> Result<i16> { ... }
async fn read_i32(&mut self) -> Result<i32> { ... }
async fn read_i32_le(&mut self) -> Result<i32> { ... }
async fn read_i64(&mut self) -> Result<i64> { ... }
async fn read_i64_le(&mut self) -> Result<i64> { ... }
async fn read_i128(&mut self) -> Result<i128> { ... }
async fn read_i128_le(&mut self) -> Result<i128> { ... }
async fn read_f32(&mut self) -> Result<f32> { ... }
async fn read_f32_le(&mut self) -> Result<f32> { ... }
async fn read_f64(&mut self) -> Result<f64> { ... }
async fn read_f64_le(&mut self) -> Result<f64> { ... }
}
Expand description
Provided Methods§
Sourceasync fn read_exact<T: IoBufMut>(&mut self, buf: T) -> BufResult<(), T>
async fn read_exact<T: IoBufMut>(&mut self, buf: T) -> BufResult<(), T>
Read the exact number of bytes required to fill the buf.
Sourceasync fn read_to_end(&mut self, buf: Vec<u8>) -> BufResult<usize, Vec<u8>>
async fn read_to_end(&mut self, buf: Vec<u8>) -> BufResult<usize, Vec<u8>>
Read all bytes until underlying reader reaches EOF
.
Sourceasync fn read_vectored_exact<T: IoVectoredBufMut>(
&mut self,
buf: T,
) -> BufResult<(), T>
async fn read_vectored_exact<T: IoVectoredBufMut>( &mut self, buf: T, ) -> BufResult<(), T>
Read the exact number of bytes required to fill the vectored buf.
Sourcefn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
Creates an adaptor which reads at most limit
bytes from it.
This function returns a new instance of AsyncRead
which will read
at most limit
bytes, after which it will always return EOF
(Ok(0)
). Any read errors will not count towards the number of
bytes read and future calls to read()
may succeed.
Sourceasync fn read_u8_le(&mut self) -> Result<u8>
async fn read_u8_le(&mut self) -> Result<u8>
Read a little endian u8
from the underlying reader.
Sourceasync fn read_u16_le(&mut self) -> Result<u16>
async fn read_u16_le(&mut self) -> Result<u16>
Read a little endian u16
from the underlying reader.
Sourceasync fn read_u32_le(&mut self) -> Result<u32>
async fn read_u32_le(&mut self) -> Result<u32>
Read a little endian u32
from the underlying reader.
Sourceasync fn read_u64_le(&mut self) -> Result<u64>
async fn read_u64_le(&mut self) -> Result<u64>
Read a little endian u64
from the underlying reader.
Sourceasync fn read_u128(&mut self) -> Result<u128>
async fn read_u128(&mut self) -> Result<u128>
Read a big endian u128
from the underlying reader.
Sourceasync fn read_u128_le(&mut self) -> Result<u128>
async fn read_u128_le(&mut self) -> Result<u128>
Read a little endian u128
from the underlying reader.
Sourceasync fn read_i8_le(&mut self) -> Result<i8>
async fn read_i8_le(&mut self) -> Result<i8>
Read a little endian i8
from the underlying reader.
Sourceasync fn read_i16_le(&mut self) -> Result<i16>
async fn read_i16_le(&mut self) -> Result<i16>
Read a little endian i16
from the underlying reader.
Sourceasync fn read_i32_le(&mut self) -> Result<i32>
async fn read_i32_le(&mut self) -> Result<i32>
Read a little endian i32
from the underlying reader.
Sourceasync fn read_i64_le(&mut self) -> Result<i64>
async fn read_i64_le(&mut self) -> Result<i64>
Read a little endian i64
from the underlying reader.
Sourceasync fn read_i128(&mut self) -> Result<i128>
async fn read_i128(&mut self) -> Result<i128>
Read a big endian i128
from the underlying reader.
Sourceasync fn read_i128_le(&mut self) -> Result<i128>
async fn read_i128_le(&mut self) -> Result<i128>
Read a little endian i128
from the underlying reader.
Sourceasync fn read_f32_le(&mut self) -> Result<f32>
async fn read_f32_le(&mut self) -> Result<f32>
Read a little endian f32
from the underlying reader.
Sourceasync fn read_f64_le(&mut self) -> Result<f64>
async fn read_f64_le(&mut self) -> Result<f64>
Read a little endian f64
from the underlying reader.
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.