[][src]Trait io::PosRead

pub trait PosRead<T: Copy>: Read<T> {
    fn pread(&mut self, buf: &mut [T], pos: usize) -> Result<usize, Self::Err> { ... }
fn preadv(
        &mut self,
        bufs: &mut [&mut [T]],
        pos: usize
    ) -> Result<usize, Self::Err> { ... }
fn pread_full<E: From<Self::Err> + From<EndOfFile>>(
        &mut self,
        buf: &mut [T],
        pos: usize
    ) -> Result<(), (E, usize)> { ... } }

Provided methods

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

r.pread(buf, pos) = r.preadv(&mut [buf], pos)

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

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

If this returns 0 data read, the possibilities are these:

  • bufs.all(|buf| buf.len() == 0)
  • The reader reached some end, and can unlikely produce further bytes, at least temporarily.

fn pread_full<E: From<Self::Err> + From<EndOfFile>>(
    &mut self,
    buf: &mut [T],
    pos: usize
) -> Result<(), (E, usize)>

Pull buf.len() data from this source at given position into given buffer; return () if so many data were actually read, or a failure and how many data were read before the failure.

Loading content...

Implementors

Loading content...