pub struct SessionStoreV2 { /* private fields */ }Implementations§
Source§impl SessionStoreV2
impl SessionStoreV2
pub fn create(root: impl AsRef<Path>, max_segment_bytes: u64) -> Result<Self>
pub fn segment_file_path(&self, segment_seq: u64) -> PathBuf
pub fn index_file_path(&self) -> PathBuf
pub fn append_entry( &mut self, entry_id: impl Into<String>, parent_entry_id: Option<String>, entry_type: impl Into<String>, payload: Value, ) -> Result<OffsetIndexEntry>
pub fn read_segment(&self, segment_seq: u64) -> Result<Vec<SegmentFrame>>
pub fn read_index(&self) -> Result<Vec<OffsetIndexEntry>>
Sourcepub fn lookup_entry(
&self,
target_entry_seq: u64,
) -> Result<Option<SegmentFrame>>
pub fn lookup_entry( &self, target_entry_seq: u64, ) -> Result<Option<SegmentFrame>>
Seek to a specific entry by entry_seq using the offset index.
Returns None if the entry is not found.
Sourcepub fn read_entries_from(
&self,
from_entry_seq: u64,
) -> Result<Vec<SegmentFrame>>
pub fn read_entries_from( &self, from_entry_seq: u64, ) -> Result<Vec<SegmentFrame>>
Read all entries with entry_seq >= from_entry_seq (tail reading).
Sourcepub fn read_all_entries(&self) -> Result<Vec<SegmentFrame>>
pub fn read_all_entries(&self) -> Result<Vec<SegmentFrame>>
Read all entries across all segments in entry_seq order.
Sourcepub fn read_tail_entries(&self, count: u64) -> Result<Vec<SegmentFrame>>
pub fn read_tail_entries(&self, count: u64) -> Result<Vec<SegmentFrame>>
Read the last count entries by entry_seq using the offset index.
Sourcepub fn read_active_path(&self, leaf_entry_id: &str) -> Result<Vec<SegmentFrame>>
pub fn read_active_path(&self, leaf_entry_id: &str) -> Result<Vec<SegmentFrame>>
Read entries on the active branch from leaf_entry_id back to root.
Returns frames in root→leaf order.
Sourcepub const fn entry_count(&self) -> u64
pub const fn entry_count(&self) -> u64
Total number of entries appended so far.
Sourcepub fn create_checkpoint(
&self,
checkpoint_seq: u64,
reason: &str,
) -> Result<Checkpoint>
pub fn create_checkpoint( &self, checkpoint_seq: u64, reason: &str, ) -> Result<Checkpoint>
Create a checkpoint snapshot at the current head.
Sourcepub fn read_checkpoint(&self, checkpoint_seq: u64) -> Result<Option<Checkpoint>>
pub fn read_checkpoint(&self, checkpoint_seq: u64) -> Result<Option<Checkpoint>>
Read a checkpoint by sequence number.
pub fn append_migration_event(&self, event: MigrationEvent) -> Result<()>
pub fn read_migration_events(&self) -> Result<Vec<MigrationEvent>>
pub fn rollback_to_checkpoint( &mut self, checkpoint_seq: u64, migration_id: impl Into<String>, correlation_id: impl Into<String>, ) -> Result<MigrationEvent>
pub fn write_manifest( &self, session_id: impl Into<String>, source_format: impl Into<String>, ) -> Result<Manifest>
pub fn read_manifest(&self) -> Result<Option<Manifest>>
pub fn chain_hash(&self) -> &str
pub const fn total_bytes(&self) -> u64
pub fn index_summary(&self) -> Result<Option<IndexSummary>>
Sourcepub fn rebuild_index(&mut self) -> Result<u64>
pub fn rebuild_index(&mut self) -> Result<u64>
Rebuild the offset index by scanning all segment files. This is the recovery path when the index is missing or corrupted.
pub fn validate_integrity(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for SessionStoreV2
impl Clone for SessionStoreV2
Source§fn clone(&self) -> SessionStoreV2
fn clone(&self) -> SessionStoreV2
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 SessionStoreV2
impl RefUnwindSafe for SessionStoreV2
impl Send for SessionStoreV2
impl Sync for SessionStoreV2
impl Unpin for SessionStoreV2
impl UnsafeUnpin for SessionStoreV2
impl UnwindSafe for SessionStoreV2
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> 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: 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).
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