Skip to main content

AsyncReadExt

Trait AsyncReadExt 

Source
pub trait AsyncReadExt: AsyncRead {
Show 29 methods // Provided methods fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> ⓘ where Self: Unpin { ... } fn read_buf<'a, 'b>( &'a mut self, buf: &'a mut ReadBuf<'b>, ) -> ReadBufFuture<'a, 'b, Self> ⓘ where Self: Unpin { ... } fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> ⓘ where Self: Unpin { ... } fn read_to_end<'a>( &'a mut self, buf: &'a mut Vec<u8>, ) -> ReadToEnd<'a, Self> ⓘ where Self: Unpin { ... } fn read_to_string<'a>( &'a mut self, buf: &'a mut String, ) -> ReadToString<'a, Self> ⓘ where Self: Unpin { ... } fn take(self, limit: u64) -> Take<Self> where Self: Sized { ... } fn chain<R: AsyncRead>(self, next: R) -> Chain<Self, R> where Self: Sized { ... } fn read_u8(&mut self) -> ReadNumber<'_, Self, u8, 1> ⓘ where Self: Unpin { ... } fn read_i8(&mut self) -> ReadNumber<'_, Self, i8, 1> ⓘ where Self: Unpin { ... } fn read_u16(&mut self) -> ReadNumber<'_, Self, u16, 2> ⓘ where Self: Unpin { ... } fn read_u16_le(&mut self) -> ReadNumber<'_, Self, u16, 2> ⓘ where Self: Unpin { ... } fn read_i16(&mut self) -> ReadNumber<'_, Self, i16, 2> ⓘ where Self: Unpin { ... } fn read_i16_le(&mut self) -> ReadNumber<'_, Self, i16, 2> ⓘ where Self: Unpin { ... } fn read_u32(&mut self) -> ReadNumber<'_, Self, u32, 4> ⓘ where Self: Unpin { ... } fn read_u32_le(&mut self) -> ReadNumber<'_, Self, u32, 4> ⓘ where Self: Unpin { ... } fn read_i32(&mut self) -> ReadNumber<'_, Self, i32, 4> ⓘ where Self: Unpin { ... } fn read_i32_le(&mut self) -> ReadNumber<'_, Self, i32, 4> ⓘ where Self: Unpin { ... } fn read_u64(&mut self) -> ReadNumber<'_, Self, u64, 8> ⓘ where Self: Unpin { ... } fn read_u64_le(&mut self) -> ReadNumber<'_, Self, u64, 8> ⓘ where Self: Unpin { ... } fn read_i64(&mut self) -> ReadNumber<'_, Self, i64, 8> ⓘ where Self: Unpin { ... } fn read_i64_le(&mut self) -> ReadNumber<'_, Self, i64, 8> ⓘ where Self: Unpin { ... } fn read_u128(&mut self) -> ReadNumber<'_, Self, u128, 16> ⓘ where Self: Unpin { ... } fn read_u128_le(&mut self) -> ReadNumber<'_, Self, u128, 16> ⓘ where Self: Unpin { ... } fn read_i128(&mut self) -> ReadNumber<'_, Self, i128, 16> ⓘ where Self: Unpin { ... } fn read_i128_le(&mut self) -> ReadNumber<'_, Self, i128, 16> ⓘ where Self: Unpin { ... } fn read_f32(&mut self) -> ReadNumber<'_, Self, f32, 4> ⓘ where Self: Unpin { ... } fn read_f32_le(&mut self) -> ReadNumber<'_, Self, f32, 4> ⓘ where Self: Unpin { ... } fn read_f64(&mut self) -> ReadNumber<'_, Self, f64, 8> ⓘ where Self: Unpin { ... } fn read_f64_le(&mut self) -> ReadNumber<'_, Self, f64, 8> ⓘ where Self: Unpin { ... }
}
Expand description

Reads on any AsyncRead: into a slice, a ReadBuf, to the end, as typed numbers in big or little endian.

Provided Methods§

Source

fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> ⓘ
where Self: Unpin,

Reads some bytes into buf, answering how many (0 at the end).

Source

fn read_buf<'a, 'b>( &'a mut self, buf: &'a mut ReadBuf<'b>, ) -> ReadBufFuture<'a, 'b, Self> ⓘ
where Self: Unpin,

Reads some bytes into the unfilled part of buf and counts them filled, answering how many (0 at the end, or when buf is full).

Source

fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> ⓘ
where Self: Unpin,

Fills buf exactly, answering its length; an end of the stream first is an UnexpectedEof error.

Source

fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self> ⓘ
where Self: Unpin,

Reads to the end of the stream, appending to buf; answers how many bytes it appended.

Source

fn read_to_string<'a>( &'a mut self, buf: &'a mut String, ) -> ReadToString<'a, Self> ⓘ
where Self: Unpin,

Reads to the end of the stream, appending to buf if what it read is UTF-8 (an InvalidData error and buf as it was otherwise); answers how many bytes it appended.

Source

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

A reader that ends after limit bytes of this one.

Source

fn chain<R: AsyncRead>(self, next: R) -> Chain<Self, R>
where Self: Sized,

A reader that reads this one to its end, then next.

Source

fn read_u8(&mut self) -> ReadNumber<'_, Self, u8, 1> ⓘ
where Self: Unpin,

Reads an unsigned byte (1 bytes, exactly).

Source

fn read_i8(&mut self) -> ReadNumber<'_, Self, i8, 1> ⓘ
where Self: Unpin,

Reads a signed byte (1 bytes, exactly).

Source

fn read_u16(&mut self) -> ReadNumber<'_, Self, u16, 2> ⓘ
where Self: Unpin,

Reads a big-endian u16 (2 bytes, exactly).

Source

fn read_u16_le(&mut self) -> ReadNumber<'_, Self, u16, 2> ⓘ
where Self: Unpin,

Reads a little-endian u16 (2 bytes, exactly).

Source

fn read_i16(&mut self) -> ReadNumber<'_, Self, i16, 2> ⓘ
where Self: Unpin,

Reads a big-endian i16 (2 bytes, exactly).

Source

fn read_i16_le(&mut self) -> ReadNumber<'_, Self, i16, 2> ⓘ
where Self: Unpin,

Reads a little-endian i16 (2 bytes, exactly).

Source

fn read_u32(&mut self) -> ReadNumber<'_, Self, u32, 4> ⓘ
where Self: Unpin,

Reads a big-endian u32 (4 bytes, exactly).

Source

fn read_u32_le(&mut self) -> ReadNumber<'_, Self, u32, 4> ⓘ
where Self: Unpin,

Reads a little-endian u32 (4 bytes, exactly).

Source

fn read_i32(&mut self) -> ReadNumber<'_, Self, i32, 4> ⓘ
where Self: Unpin,

Reads a big-endian i32 (4 bytes, exactly).

Source

fn read_i32_le(&mut self) -> ReadNumber<'_, Self, i32, 4> ⓘ
where Self: Unpin,

Reads a little-endian i32 (4 bytes, exactly).

Source

fn read_u64(&mut self) -> ReadNumber<'_, Self, u64, 8> ⓘ
where Self: Unpin,

Reads a big-endian u64 (8 bytes, exactly).

Source

fn read_u64_le(&mut self) -> ReadNumber<'_, Self, u64, 8> ⓘ
where Self: Unpin,

Reads a little-endian u64 (8 bytes, exactly).

Source

fn read_i64(&mut self) -> ReadNumber<'_, Self, i64, 8> ⓘ
where Self: Unpin,

Reads a big-endian i64 (8 bytes, exactly).

Source

fn read_i64_le(&mut self) -> ReadNumber<'_, Self, i64, 8> ⓘ
where Self: Unpin,

Reads a little-endian i64 (8 bytes, exactly).

Source

fn read_u128(&mut self) -> ReadNumber<'_, Self, u128, 16> ⓘ
where Self: Unpin,

Reads a big-endian u128 (16 bytes, exactly).

Source

fn read_u128_le(&mut self) -> ReadNumber<'_, Self, u128, 16> ⓘ
where Self: Unpin,

Reads a little-endian u128 (16 bytes, exactly).

Source

fn read_i128(&mut self) -> ReadNumber<'_, Self, i128, 16> ⓘ
where Self: Unpin,

Reads a big-endian i128 (16 bytes, exactly).

Source

fn read_i128_le(&mut self) -> ReadNumber<'_, Self, i128, 16> ⓘ
where Self: Unpin,

Reads a little-endian i128 (16 bytes, exactly).

Source

fn read_f32(&mut self) -> ReadNumber<'_, Self, f32, 4> ⓘ
where Self: Unpin,

Reads a big-endian f32 (4 bytes, exactly).

Source

fn read_f32_le(&mut self) -> ReadNumber<'_, Self, f32, 4> ⓘ
where Self: Unpin,

Reads a little-endian f32 (4 bytes, exactly).

Source

fn read_f64(&mut self) -> ReadNumber<'_, Self, f64, 8> ⓘ
where Self: Unpin,

Reads a big-endian f64 (8 bytes, exactly).

Source

fn read_f64_le(&mut self) -> ReadNumber<'_, Self, f64, 8> ⓘ
where Self: Unpin,

Reads a little-endian f64 (8 bytes, exactly).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§