[][src]Trait io::TryRead

pub trait TryRead<T: Copy> {
    type Err;
    fn try_read(
        &mut self,
        buf: &mut [T]
    ) -> Result<Result<usize, EndOfFile>, Self::Err> { ... }
fn try_readv(
        &mut self,
        bufs: &mut [&mut [T]]
    ) -> Result<Result<usize, EndOfFile>, Self::Err> { ... } }

Associated Types

type Err

Loading content...

Provided methods

fn try_read(
    &mut self,
    buf: &mut [T]
) -> Result<Result<usize, EndOfFile>, Self::Err>

r.try_read(buf) = r.try_readv(&mut [buf])

fn try_readv(
    &mut self,
    bufs: &mut [&mut [T]]
) -> Result<Result<usize, EndOfFile>, Self::Err>

Pull some data, at most bufs.fold(0, |n, buf| n+buf.len()), from this source into given buffers; return how many data were actually read, or a failure. If no data can be read when called, return 0 rather than wait.

Loading content...

Implementors

Loading content...