pub struct Wal { /* private fields */ }Expand description
The main entry point for the IronWal library. Thread-safe and cloneable (internally strictly synchronized).
Implementations§
Source§impl Wal
impl Wal
pub fn new(options: WalOptions) -> Result<Self>
Sourcepub fn current_segment_start_id(&self, stream: &str) -> Option<u64>
pub fn current_segment_start_id(&self, stream: &str) -> Option<u64>
Returns the Start ID of the currently active segment. Useful for monitoring rotation and testing.
Sourcepub fn iter(&self, stream: &str, start_id: u64) -> Result<WalIterator>
pub fn iter(&self, stream: &str, start_id: u64) -> Result<WalIterator>
Creates an iterator to read entries sequentially starting from start_id.
Sourcepub fn append(&self, stream: &str, entry: &[u8]) -> Result<u64>
pub fn append(&self, stream: &str, entry: &[u8]) -> Result<u64>
Appends a single entry to the stream.
Sourcepub fn append_batch(
&self,
stream: &str,
entries: &[&[u8]],
) -> Result<Range<u64>>
pub fn append_batch( &self, stream: &str, entries: &[&[u8]], ) -> Result<Range<u64>>
Appends a batch of entries atomically to the WAL.
Sourcepub fn writer(&self, stream: &str) -> TxnWriter
pub fn writer(&self, stream: &str) -> TxnWriter
Returns a TxnWriter handle for accumulating a batch of writes in memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Wal
impl !RefUnwindSafe for Wal
impl Send for Wal
impl Sync for Wal
impl Unpin for Wal
impl !UnwindSafe for Wal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more