Trait Log

Source
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§

Source

fn reserve(&self, _: Vec<u8>) -> Reservation<'_>

Create a log offset reservation for a particular write, which may later be filled or canceled.

Source

fn write(&self, _: Vec<u8>) -> u64

Write a buffer to underlying storage.

Source

fn read(&self, id: u64) -> Result<LogRead>

Read a buffer from underlying storage.

Source

fn stable_offset(&self) -> u64

Return the current stable offset.

Source

fn make_stable(&self, id: u64)

Try to flush all pending writes up until the specified log offset.

Source

fn punch_hole(&self, id: u64)

Mark the provided message as deletable by the underlying storage.

Source

fn config(&self) -> &Config

Return the configuration in use by the system.

Provided Methods§

Source

fn iter_from(&self, id: u64) -> LogIter<'_, Self>

Return an iterator over the log, starting with a specified offset.

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.

Implementors§