pub struct DurableState { /* private fields */ }Expand description
Durable WAL state owned by a live CoreProvider.
The HLC counter is seeded from WalWriter::last_sequence. On a fresh WAL
this is zero and the first commit receives HlcTimestamp::new(1, 0); after
reopening, the next timestamp advances past the recovered WAL sequence.
Implementations§
Source§impl DurableState
impl DurableState
Sourcepub fn with_audit_log(self, audit: AuditLog) -> Self
pub fn with_audit_log(self, audit: AuditLog) -> Self
Attach an audit log so engine-owned events committed through this provider are mirrored to it (Item 7 / D24).
Mirroring is WAL-first, audit-after: the WAL append is the source of truth and gates the commit; the audit write runs only after it succeeds and is best-effort (a failure is logged, never failing the commit). The event also remains in the WAL, so a failed mirror degrades to the pre-Item-7 WAL-only behavior rather than losing the event. Per the donor lesson “audit lag is recoverable, fiction is not,” the audit can only lag the WAL, never lead it.
Sourcepub fn append_audit_event(&self, kind: u16, payload: Vec<u8>) -> bool
pub fn append_audit_event(&self, kind: u16, payload: Vec<u8>) -> bool
Append one engine-owned event to the attached audit log, if any.
The D24 audit log is the durable “events” surface in the
snapshot=state / WAL=changes / audit=events split, with retention
independent of the WAL lineage. Appends are best-effort and audit-after:
the caller stamps the wall clock here, the record is serialized by the
caller into an opaque kind-tagged payload, and an append failure is
logged and skipped rather than propagated, so the audit can only lag a
committed change, never lead it (the donor lesson “audit lag is
recoverable, fiction is not”). Returns false when no audit log is
attached or the append failed.
The pack-lifecycle producer that previously fed this surface was removed in the extension teardown; the framework remains wired (persisted, reattached on recovery) for future user-action audit events (D24).
Auto Trait Implementations§
impl !Freeze for DurableState
impl !RefUnwindSafe for DurableState
impl Send for DurableState
impl Sync for DurableState
impl Unpin for DurableState
impl UnsafeUnpin for DurableState
impl UnwindSafe for DurableState
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.