Trait rsdb::Log
[−]
[src]
pub trait Log: Send + Sync { fn reserve(&self, _: Vec<u8>) -> Reservation; fn write(&self, _: Vec<u8>) -> u64; fn read(&self, id: u64) -> Result<Option<Vec<u8>>>; fn stable_offset(&self) -> u64; fn make_stable(&self, id: u64); fn punch_hole(&self, id: u64); fn config(&self) -> Config; fn iter_from(&self, id: u64) -> LogIter<Self>
where
Self: Sized, { ... } }
A trait for objects which facilitate log-structured storage.
Required Methods
fn reserve(&self, _: Vec<u8>) -> Reservation
Create a log offset reservation for a particular write, which may later be filled or canceled.
fn write(&self, _: Vec<u8>) -> u64
Write a buffer to underlying storage.
fn read(&self, id: u64) -> Result<Option<Vec<u8>>>
Read a buffer from underlying storage.
fn stable_offset(&self) -> u64
Return the current stable offset.
fn make_stable(&self, id: u64)
Try to flush all pending writes up until the specified log offset.
fn punch_hole(&self, id: u64)
Mark the provided message as deletable by the underlying storage.
fn config(&self) -> Config
Return the configuration in use by the system.
Provided Methods
fn iter_from(&self, id: u64) -> LogIter<Self> where
Self: Sized,
Self: Sized,
Return an iterator over the log, starting with a specified offset.
Implementors
impl Log for LockFreeLog