Struct sst::log::LogBuilder

source ·
pub struct LogBuilder<W: Write> { /* private fields */ }
Expand description

A LogBuilder is a non-concurrent log writer.

Implementations§

source§

impl LogBuilder<File>

source

pub fn new<P: AsRef<Path>>( options: LogOptions, file_name: P ) -> Result<Self, Error>

Create a new log builder with the provided options at the prescribed path.

source

pub fn fsync(&mut self) -> Result<(), Error>

fsync the log builder.

source§

impl<W: Write> LogBuilder<W>

source

pub fn from_write(options: LogOptions, write: W) -> Result<Self, Error>

Create a new LogBuilder from options and a write.

source

pub fn flush(&mut self) -> Result<(), Error>

Flush the log to the OS. This does not call fsync.

source

pub fn append(&mut self, write_batch: &WriteBatch) -> Result<(), Error>

Append a write batch to the log.

Trait Implementations§

source§

impl<W: Write> Builder for LogBuilder<W>

§

type Sealed = Setsum

The type that gets returned from seal.
source§

fn approximate_size(&self) -> usize

The approximate size of the builder.
source§

fn put(&mut self, key: &[u8], timestamp: u64, value: &[u8]) -> Result<(), Error>

Put a key into the builder.
source§

fn del(&mut self, key: &[u8], timestamp: u64) -> Result<(), Error>

Put a tombstone into the builder.
source§

fn seal(self) -> Result<Self::Sealed, Error>

Seal the builder to stop further writes and return the Sealed type.

Auto Trait Implementations§

§

impl<W> RefUnwindSafe for LogBuilder<W>
where W: RefUnwindSafe,

§

impl<W> Send for LogBuilder<W>
where W: Send,

§

impl<W> Sync for LogBuilder<W>
where W: Sync,

§

impl<W> Unpin for LogBuilder<W>
where W: Unpin,

§

impl<W> UnwindSafe for LogBuilder<W>
where W: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.