Skip to main content

Medium

Trait Medium 

Source
pub trait Medium: Sync {
    // Required methods
    fn size(&self) -> u64;
    fn read_at(&self, off: u64, buf: &mut [u8]) -> bool;
    fn write_at(&self, off: u64, bytes: &[u8]) -> bool;
    fn truncate(&self, len: u64) -> bool;
    fn flush(&self) -> bool;
}
Expand description

Bytes at offsets, as one file offers them. A medium that fails answers false, and the pack reads that as a miss or a write that did not happen.

Required Methods§

Source

fn size(&self) -> u64

Source

fn read_at(&self, off: u64, buf: &mut [u8]) -> bool

Source

fn write_at(&self, off: u64, bytes: &[u8]) -> bool

Source

fn truncate(&self, len: u64) -> bool

Source

fn flush(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§