pub struct FileSessionStoreWal { /* private fields */ }Expand description
Durable append-only JSONL WAL under a FileSessionStore root.
Implementations§
Source§impl FileSessionStoreWal
impl FileSessionStoreWal
pub fn new(store_root: impl AsRef<Path>) -> Self
pub fn path(&self) -> &Path
Sourcepub async fn load_entries(&self) -> Result<(Vec<SessionStoreWalEntryV1>, u64)>
pub async fn load_entries(&self) -> Result<(Vec<SessionStoreWalEntryV1>, u64)>
Load every validated entry and return the next one-based sequence.
Sourcepub fn is_sequence_conflict(error: &Error) -> bool
pub fn is_sequence_conflict(error: &Error) -> bool
Whether an open/load error is the fail-closed duplicate-sequence case.
Sourcepub async fn quarantine_corrupt(&self) -> Result<PathBuf>
pub async fn quarantine_corrupt(&self) -> Result<PathBuf>
Rename a corrupt WAL aside so a fresh log can be opened. Session
snapshots under v1/sessions/ are left untouched.
Sourcepub async fn append(&self, entry: &SessionStoreWalEntryV1) -> Result<()>
pub async fn append(&self, entry: &SessionStoreWalEntryV1) -> Result<()>
Append one validated entry with a data sync so reopen can observe it.
Sourcepub async fn recover<F, Fut>(&self, snapshot_digest_for: F) -> Result<u64>
pub async fn recover<F, Fut>(&self, snapshot_digest_for: F) -> Result<u64>
Seal open intents whose durable snapshot already matches.
snapshot_digest_for returns the digest of the currently durable
snapshot for a session, if any. Matching intents are acknowledged with
a Committed record so crash recovery does not leave a generation
half-published.
Auto Trait Implementations§
impl Freeze for FileSessionStoreWal
impl RefUnwindSafe for FileSessionStoreWal
impl Send for FileSessionStoreWal
impl Sync for FileSessionStoreWal
impl Unpin for FileSessionStoreWal
impl UnsafeUnpin for FileSessionStoreWal
impl UnwindSafe for FileSessionStoreWal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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