pub struct Writer<T> { /* private fields */ }Expand description
Single-writer append handle for an AtomicLog.
The core design assumes exactly one active writer. If a caller wants to share write access across threads, it must add its own external synchronization.
Implementations§
Source§impl<T> Writer<T>
impl<T> Writer<T>
Sourcepub fn retained_capacity(&self) -> usize
pub fn retained_capacity(&self) -> usize
Returns the configured logical retained capacity, in elements.
Sourcepub fn segment_capacity(&self) -> usize
pub fn segment_capacity(&self) -> usize
Returns the fixed segment size, in elements.
Sourcepub fn append_batch(&mut self, values: impl IntoIterator<Item = T>)
pub fn append_batch(&mut self, values: impl IntoIterator<Item = T>)
Appends multiple values to the log.
Values within the same segment are published with a single atomic store rather
than one per element. Segment rolls are performed as needed, the same as
append.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Writer<T>
impl<T> !RefUnwindSafe for Writer<T>
impl<T> Send for Writer<T>
impl<T> Sync for Writer<T>
impl<T> Unpin for Writer<T>
impl<T> UnsafeUnpin for Writer<T>
impl<T> !UnwindSafe for Writer<T>
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