pub struct SymbolLogManager { /* private fields */ }Expand description
Symbol log writer/rotator that enforces append-only active-segment policy.
Implementations§
Source§impl SymbolLogManager
impl SymbolLogManager
Sourcepub fn new(
symbols_dir: &Path,
active_segment_id: u64,
epoch_id: u64,
created_at: u64,
) -> Result<Self>
pub fn new( symbols_dir: &Path, active_segment_id: u64, epoch_id: u64, created_at: u64, ) -> Result<Self>
Open or create the active segment.
Sourcepub const fn active_segment_id(&self) -> u64
pub const fn active_segment_id(&self) -> u64
Current active segment identifier.
Sourcepub fn active_segment_path(&self) -> PathBuf
pub fn active_segment_path(&self) -> PathBuf
Filesystem path for the current active segment.
Sourcepub fn append(&self, record: &SymbolRecord) -> Result<SymbolLogOffset>
pub fn append(&self, record: &SymbolRecord) -> Result<SymbolLogOffset>
Append to the active segment.
Sourcepub fn append_to_segment(
&self,
segment_id: u64,
record: &SymbolRecord,
) -> Result<SymbolLogOffset>
pub fn append_to_segment( &self, segment_id: u64, record: &SymbolRecord, ) -> Result<SymbolLogOffset>
Append to a specific segment ID.
Rotated segments are immutable; only the active segment accepts writes.
Trait Implementations§
Source§impl Clone for SymbolLogManager
impl Clone for SymbolLogManager
Source§fn clone(&self) -> SymbolLogManager
fn clone(&self) -> SymbolLogManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SymbolLogManager
impl RefUnwindSafe for SymbolLogManager
impl Send for SymbolLogManager
impl Sync for SymbolLogManager
impl Unpin for SymbolLogManager
impl UnsafeUnpin for SymbolLogManager
impl UnwindSafe for SymbolLogManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).