pub trait AsyncBufReadExt: AsyncBufRead {
// Provided methods
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self> ⓘ
where Self: Unpin { ... }
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self> ⓘ
where Self: Unpin { ... }
fn lines(self) -> Lines<Self>
where Self: Sized { ... }
fn split(self, byte: u8) -> Split<Self>
where Self: Sized { ... }
fn fill_buf(&mut self) -> FillBuf<'_, Self> ⓘ
where Self: Unpin { ... }
fn consume(&mut self, amount: usize)
where Self: Unpin { ... }
}Expand description
Reads on any AsyncBufRead: up to a delimiter, a line, the lines or
the segments one by one.
Provided Methods§
Sourcefn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self> ⓘwhere
Self: Unpin,
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self> ⓘwhere
Self: Unpin,
Reads up to and including byte (or to the end), appending to buf;
answers how many bytes it appended (0 at the end).
Sourcefn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self> ⓘwhere
Self: Unpin,
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self> ⓘwhere
Self: Unpin,
Reads up to and including a newline (or to the end), 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 (0 at the end).
Sourcefn lines(self) -> Lines<Self>where
Self: Sized,
fn lines(self) -> Lines<Self>where
Self: Sized,
The lines, without their \n or \r\n, one by one through
Lines::next_line.
Sourcefn split(self, byte: u8) -> Split<Self>where
Self: Sized,
fn split(self, byte: u8) -> Split<Self>where
Self: Sized,
The segments between bytes, without it, one by one through
Split::next_segment.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".