pub struct Log { /* private fields */ }
Expand description
A sequential store which allows users to create reservations placed at known log offsets, used for writing persistent data structures that need to know where to find persisted bits in the future.
Implementations
sourceimpl Log
impl Log
sourcepub fn start<R>(config: Config, snapshot: Snapshot<R>) -> Result<Log, ()>
pub fn start<R>(config: Config, snapshot: Snapshot<R>) -> Result<Log, ()>
Start the log, open or create the configured file, and optionally start the periodic buffer flush thread.
sourcepub fn start_raw_log(config: Config) -> Result<Log, ()>
pub fn start_raw_log(config: Config) -> Result<Log, ()>
Starts a log for use without a materializer.
sourcepub fn flush(&self) -> Result<(), ()>
pub fn flush(&self) -> Result<(), ()>
Flushes any pending IO buffers to disk to ensure durability.
sourcepub fn reserve(&self, buf: Vec<u8>) -> Result<Reservation<'_>, ()>
pub fn reserve(&self, buf: Vec<u8>) -> Result<Reservation<'_>, ()>
Reserve space in the log for a pending linearized operation.
sourcepub fn write(&self, buf: Vec<u8>) -> Result<(Lsn, DiskPtr), ()>
pub fn write(&self, buf: Vec<u8>) -> Result<(Lsn, DiskPtr), ()>
Write a buffer into the log. Returns the log sequence number and the file offset of the write.
sourcepub fn iter_from(&self, lsn: Lsn) -> LogIter
pub fn iter_from(&self, lsn: Lsn) -> LogIter
Return an iterator over the log, starting with a specified offset.
sourcepub fn stable_offset(&self) -> Lsn
pub fn stable_offset(&self) -> Lsn
returns the current stable offset written to disk
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more