Trait gain::stream::buf::Read [−][src]
pub trait Read { fn read<'a>(&'a mut self, dest: &'a mut [u8]) -> Read<'_>ⓘ; fn buf_read<'a, R, T>(
&'a mut self,
min_read: usize,
receptor: R
) -> BufRead<'a, R, T>ⓘ
where
R: FnOnce(&mut Buf) -> T + Unpin,
T: Default; }
Expand description
Buffered data reader.
Required methods
Read some bytes into a slice. Returns a future.
Read buffered data. Returns a future.
The receptor must be prepared to handle as much data as the buffer can hold.
The value returned by the receptor is passed through. If the stream has been closed, the default value is returned.