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§
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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".