pub struct SessionSink { /* private fields */ }Expand description
A write sink for session persistence. None means persistence
is disabled; callers treat it as an append-only log.
Implementations§
Source§impl SessionSink
impl SessionSink
pub fn new(store: Arc<Store>, session_id: i64, ulid: String) -> Self
Sourcepub fn adapter(&self) -> SessionAdapter
pub fn adapter(&self) -> SessionAdapter
Clone the shared handle so a SessionAdapter sees the
same active ulid/row-id whenever /fork swaps it.
Sourcepub fn record(&self, entry: &LogEntry)
pub fn record(&self, entry: &LogEntry)
Record one log entry. Errors are logged but do not propagate — a DB hiccup must not deny the operator a visible render.
Sourcepub fn end(&self)
pub fn end(&self)
Close the originally-opened session row. Called during shutdown. Forks open their own rows but do not close on exit — a child session whose parent is still marked live is the honest representation of a crash-exit.
Sourcepub fn store(&self) -> &Store
pub fn store(&self) -> &Store
The store this sink writes to. Exposed so a post-run
caller (daily-wrap generator, milestone writer) can
reach the same DB handle the sink has been using
without the caller having to carry a separate Arc.
Returned as a shared reference — the caller must not mutate the Arc; the write path remains the sink itself.
Sourcepub fn session_id(&self) -> Option<i64>
pub fn session_id(&self) -> Option<i64>
Snapshot of the originally-opened row’s id. Returns
None if the session was forked away and never forked
back — today end() is still keyed on this same id,
so None is only reachable via a /fork without a
return, which the fork command never performs in M1.
Sourcepub fn ulid(&self) -> Option<String>
pub fn ulid(&self) -> Option<String>
Snapshot of the current active ULID. Same caveat as
Self::session_id.
Trait Implementations§
Source§impl Clone for SessionSink
impl Clone for SessionSink
Source§fn clone(&self) -> SessionSink
fn clone(&self) -> SessionSink
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SessionSink
impl RefUnwindSafe for SessionSink
impl Send for SessionSink
impl Sync for SessionSink
impl Unpin for SessionSink
impl UnsafeUnpin for SessionSink
impl UnwindSafe for SessionSink
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
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> 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 more