Skip to main content

SessionAdapter

Struct SessionAdapter 

Source
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

Source§

fn clone(&self) -> SessionAdapter

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionAdapter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SessionSource for SessionAdapter

Source§

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>

Newest-first list of up to limit sessions. Read more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more