pub trait Log: Sized {
// Required methods
fn reserve(&self, _: Vec<u8>) -> Reservation<'_>;
fn write(&self, _: Vec<u8>) -> u64;
fn read(&self, id: u64) -> Result<LogRead>;
fn stable_offset(&self) -> u64;
fn make_stable(&self, id: u64);
fn punch_hole(&self, id: u64);
fn config(&self) -> &Config;
// Provided method
fn iter_from(&self, id: u64) -> LogIter<'_, Self> { ... }
}
Expand description
lock-free log-structured storage A trait for objects which facilitate log-structured storage.
Required Methods§
Sourcefn reserve(&self, _: Vec<u8>) -> Reservation<'_>
fn reserve(&self, _: Vec<u8>) -> Reservation<'_>
Create a log offset reservation for a particular write, which may later be filled or canceled.
Sourcefn stable_offset(&self) -> u64
fn stable_offset(&self) -> u64
Return the current stable offset.
Sourcefn make_stable(&self, id: u64)
fn make_stable(&self, id: u64)
Try to flush all pending writes up until the specified log offset.
Sourcefn punch_hole(&self, id: u64)
fn punch_hole(&self, id: u64)
Mark the provided message as deletable by the underlying storage.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.