Trait async_read_util::AsyncReadUtil[][src]

pub trait AsyncReadUtil: AsyncRead + Sized {
    fn observe<F: FnMut(&[u8])>(self, f: F) -> ObservedReader<Self, F>;
fn map_read<F>(self, f: F) -> MappedReader<Self, F>
    where
        F: FnMut(&[u8], &mut [u8]) -> (usize, usize)
;
fn buffered(self) -> BufReader<Self>; }

Convenience trait to apply the utility functions to types implementing [futures::AsyncRead].

Required methods

fn observe<F: FnMut(&[u8])>(self, f: F) -> ObservedReader<Self, F>[src]

Observe the bytes being read from self using the provided closure. Refer to crate::ObservedReader for more info.

fn map_read<F>(self, f: F) -> MappedReader<Self, F> where
    F: FnMut(&[u8], &mut [u8]) -> (usize, usize)
[src]

Map the bytes being read from self into a new buffer using the provided closure. Refer to crate::MappedReader for more info.

fn buffered(self) -> BufReader<Self>[src]

Loading content...

Implementors

impl<R: AsyncRead + Sized> AsyncReadUtil for R[src]

Loading content...