Trait gain::stream::buf::Read[][src]

pub trait Read {
    fn read<'a>(&'a mut self, dest: &'a mut [u8]) -> Read<'_>
Notable traits for Read<'a>
impl<'a> Future for Read<'a> type Output = Result<usize>;
;
fn buf_read<'a, R, T>(
        &'a mut self,
        min_read: usize,
        receptor: R
    ) -> BufRead<'a, R, T>
Notable traits for BufRead<'a, R, T>
impl<'a, R, T> Future for BufRead<'a, R, T> where
    R: FnOnce(&mut Buf) -> T + Unpin,
    T: Default
type Output = Result<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.

Implementors