pub trait BasicStorage: Send {
// Required methods
fn size(&self) -> u64;
fn read(&self, start: u64, data: &mut [u8]);
fn write(&mut self, start: u64, data: &[u8]);
fn commit(&mut self, size: u64);
// Provided methods
fn write_vec(&mut self, start: u64, data: Vec<u8>) { ... }
fn write_data(&mut self, start: u64, data: Data, off: usize, len: usize) { ... }
fn write_u64(&mut self, start: u64, value: u64) { ... }
fn read_u64(&self, start: u64) -> u64 { ... }
fn clone(&self) -> Box<dyn Storage> { ... }
fn wait_complete(&self) { ... }
}Expand description
Storage interface - BasicStorage is some kind of “file” storage.
read and write methods take a start which is a byte offset in the underlying file.
Required Methods§
Provided Methods§
Sourcefn wait_complete(&self)
fn wait_complete(&self)
Wait until current writes are complete.
Implementors§
impl BasicStorage for AnyFileStorage
impl BasicStorage for AtomicFile
impl BasicStorage for BasicAtomicFile
impl BasicStorage for DummyFile
impl BasicStorage for FastFileStorage
impl BasicStorage for MemFile
impl BasicStorage for SimpleFileStorage
impl BasicStorage for UnixFileStorage
Available on
target_family=unix only.