Trait io_ranges::Range[][src]

pub trait Range {
    fn metadata(&self) -> Result<Metadata>;
fn advise(&self, offset: u64, len: u64, advice: Advice) -> Result<()>; }

A minimal base trait for range I/O. Defines operations common to all kinds of random-access devices that fit the "range" concept, including normal files, block devices, and in-memory buffers.

This is a base trait that ReadAt, WriteAt, and EditAt all share.

Required methods

fn metadata(&self) -> Result<Metadata>[src]

Return the Metadata for the range. This is similar to std::fs::File::metadata, though it returns fewer fields since the underlying device may not be an actual filesystem inode.

fn advise(&self, offset: u64, len: u64, advice: Advice) -> Result<()>[src]

Announce the expected access pattern of the data at the given offset.

This is purely a performance hint and has no semantic effect.

Loading content...

Implementations on Foreign Types

impl Range for File[src]

impl Range for [u8][src]

impl Range for Vec<u8>[src]

Loading content...

Implementors

impl Range for RangeEditor[src]

impl Range for RangeReader[src]

impl Range for RangeWriter[src]

Loading content...