pub struct SessionAdapter { /* private fields */ }Expand description
Read + fork/save adaptor over a Store, implementing
SessionSource so the dispatcher can reach the on-disk
history. Carries the same Arc<Mutex<ActiveSession>> as
SessionSink so /fork atomically swaps the write target.
Trait Implementations§
Source§impl Clone for SessionAdapter
impl Clone for SessionAdapter
Source§fn clone(&self) -> SessionAdapter
fn clone(&self) -> SessionAdapter
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 moreSource§impl Debug for SessionAdapter
impl Debug for SessionAdapter
Source§impl SessionSource for SessionAdapter
impl SessionSource for SessionAdapter
Source§fn current_ulid(&self) -> Option<String>
fn current_ulid(&self) -> Option<String>
Ulid of the session currently being recorded into, if any.
None when persistence is disabled (--no-persist) — the
dispatcher surfaces a clear “persistence disabled” line
rather than pretending the save went through.Source§fn list(&self, limit: u32) -> Result<Vec<SessionSummary>, CmdSessionError>
fn list(&self, limit: u32) -> Result<Vec<SessionSummary>, CmdSessionError>
Newest-first list of up to
limit sessions. Read moreSource§fn find(&self, needle: &str) -> Result<SessionSummary, CmdSessionError>
fn find(&self, needle: &str) -> Result<SessionSummary, CmdSessionError>
Look up a single session by ulid or a human-assigned
label (see
Self::save_label). Impls should match ulid
first (exact prefix match on at least 6 chars is fine —
ulids are time-sortable so a prefix rarely collides) and
fall through to label resolution. Read moreSource§fn list_events(
&self,
ulid: &str,
limit: u32,
) -> Result<Vec<ReplayEvent>, CmdSessionError>
fn list_events( &self, ulid: &str, limit: u32, ) -> Result<Vec<ReplayEvent>, CmdSessionError>
All events for a session in seq order (oldest first), up
to
limit. Mirrors zero_session::Store::list_events’s
semantics but returns this crate’s ReplayEvent. Read moreSource§fn save_label(&self, ulid: &str, label: &str) -> Result<(), CmdSessionError>
fn save_label(&self, ulid: &str, label: &str) -> Result<(), CmdSessionError>
Associate a short human label with a session ulid. Labels
are stored as milestones (
session.label.<label> →
<ulid>) so they survive CLI restarts and are queryable
without schema changes. Overwriting a label is fine — the
old one is silently reassigned. Read moreSource§fn fork_from_current(&self) -> Result<Option<String>, CmdSessionError>
fn fork_from_current(&self) -> Result<Option<String>, CmdSessionError>
Start a new session whose
parent_ulid is the current
one. The impl becomes the authority for the new session’s
ulid; returns it so the dispatcher can echo the fork line.
None is returned when persistence is disabled. Read moreAuto Trait Implementations§
impl Freeze for SessionAdapter
impl RefUnwindSafe for SessionAdapter
impl Send for SessionAdapter
impl Sync for SessionAdapter
impl Unpin for SessionAdapter
impl UnsafeUnpin for SessionAdapter
impl UnwindSafe for SessionAdapter
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> 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