pub struct AppendOnlyLog { /* private fields */ }Expand description
A lock-free append-only log for high-throughput message storage
Design goals:
- Lock-free appends from multiple producers
- Sequential reads optimized for batching
- Memory-efficient with segment rotation
Implementations§
Source§impl AppendOnlyLog
impl AppendOnlyLog
Sourcepub fn new(config: AppendLogConfig) -> Self
pub fn new(config: AppendLogConfig) -> Self
Create a new append-only log
Sourcepub fn append_batch(&self, entries: &[&[u8]]) -> Vec<u64>
pub fn append_batch(&self, entries: &[&[u8]]) -> Vec<u64>
Append a batch of entries, returns vec of offsets
Sourcepub fn read(&self, start_offset: u64, max_entries: usize) -> Vec<Bytes>
pub fn read(&self, start_offset: u64, max_entries: usize) -> Vec<Bytes>
Read entries starting from an offset
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Get total bytes written
Sourcepub fn total_entries(&self) -> u64
pub fn total_entries(&self) -> u64
Get total entries written
Sourcepub fn end_offset(&self) -> u64
pub fn end_offset(&self) -> u64
Get current end offset
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Get number of segments
Auto Trait Implementations§
impl !Freeze for AppendOnlyLog
impl !RefUnwindSafe for AppendOnlyLog
impl Send for AppendOnlyLog
impl Sync for AppendOnlyLog
impl Unpin for AppendOnlyLog
impl UnwindSafe for AppendOnlyLog
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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