Trait io_ranges::ReadAt[][src]

pub trait ReadAt: Range {
    fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>;
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>;
fn read_vectored_at(
        &self,
        bufs: &mut [IoSliceMut<'_>],
        offset: u64
    ) -> Result<usize>;
fn read_exact_vectored_at(
        &self,
        bufs: &mut [IoSliceMut<'_>],
        offset: u64
    ) -> Result<()>;
fn is_read_vectored_at(&self) -> bool; }

A trait for reading from ranges.

This is similar to std::io::Read except all of the reading functions take an offset parameter, specifying a position in the range to read at.

Unlike std::io::Read, ReadAt's functions take a &self rather than a &mut self, since they don't have a current position to mutate.

Required methods

fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>[src]

Reads a number of bytes starting from a given offset.

This is similar to std::os::unix::fs::FileExt::read_at, except it takes self by immutable reference since the entire side effect is I/O, and it's supported on non-Unix platforms including Windows.

fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>[src]

Reads the exact number of byte required to fill buf from the given offset.

This is similar to std::os::unix::fs::FileExt::read_exact_at, except it takes self by immutable reference since the entire side effect is I/O, and it's supported on non-Unix platforms including Windows.

fn read_vectored_at(
    &self,
    bufs: &mut [IoSliceMut<'_>],
    offset: u64
) -> Result<usize>
[src]

Is to read_vectored what read_at is to read.

fn read_exact_vectored_at(
    &self,
    bufs: &mut [IoSliceMut<'_>],
    offset: u64
) -> Result<()>
[src]

Is to read_exact_vectored what read_exact_at is to read_exact.

fn is_read_vectored_at(&self) -> bool[src]

Determines if Self has an efficient read_vectored_at implementation.

Loading content...

Implementations on Foreign Types

impl ReadAt for File[src]

impl ReadAt for [u8][src]

impl ReadAt for Vec<u8>[src]

Loading content...

Implementors

impl ReadAt for RangeEditor[src]

impl ReadAt for RangeReader[src]

Loading content...