pub struct StateStore {
pub sessions: HashMap<SessionId, SessionState>,
/* private fields */
}Expand description
All currently observed session projections.
Fields§
§sessions: HashMap<SessionId, SessionState>Implementations§
Source§impl StateStore
impl StateStore
Sourcepub fn apply_delivery(&mut self, delivery: ClientDelivery) -> DeliveryOutcome
pub fn apply_delivery(&mut self, delivery: ClientDelivery) -> DeliveryOutcome
Reduce every delivery variant from the single client stream. Replay
events reduce into a per-session scratch projection. The visible
projection changes only through a validated ReplayEnd swap or live
events after that replay’s final sequence. Once a replay for a session
is abandoned, that session’s visible projection is immutable until a
validated replacement replay ends; all of its output is quarantined.
Sourcepub fn abandon_timed_out_replays(&mut self) -> Vec<SessionId>
pub fn abandon_timed_out_replays(&mut self) -> Vec<SessionId>
Discard incomplete scratch replays. Their currently visible session projections remain intact for a full recovery attempt.
Sourcepub fn abandon_replays(&mut self) -> Vec<SessionId>
pub fn abandon_replays(&mut self) -> Vec<SessionId>
Discard all incomplete scratch replays after a connection closes.
Sourcepub fn take_voided_inputs(&mut self, session_id: SessionId) -> Vec<String>
pub fn take_voided_inputs(&mut self, session_id: SessionId) -> Vec<String>
Drain a session’s voided inputs for restoration into the composer. Returns them in admission (FIFO) order; empty when nothing is owed.
Sourcepub fn park_voided_input(&mut self, session_id: SessionId, text: String)
pub fn park_voided_input(&mut self, session_id: SessionId, text: String)
Park text as voided for a session (e.g. a recall resolved while a different session was being viewed); the UI restores it on sight.
Sourcepub fn apply_event(&mut self, event: StoredEvent) -> bool
pub fn apply_event(&mut self, event: StoredEvent) -> bool
Apply a persisted event. Replayed duplicates are ignored by sequence.
pub fn apply_event_for_generation( &mut self, event: StoredEvent, generation: u64, ) -> bool
Sourcepub fn apply_subscription(
&mut self,
message: EventSubscriptionMessage,
) -> Option<u64>
pub fn apply_subscription( &mut self, message: EventSubscriptionMessage, ) -> Option<u64>
Apply a message from the event subscription stream. A gap is returned to allow callers to surface it; the client independently re-subscribes.
pub fn apply_subscription_for_generation( &mut self, message: EventSubscriptionMessage, generation: u64, ) -> Option<u64>
Sourcepub fn reset_session(&mut self, session_id: SessionId, generation: u64) -> bool
pub fn reset_session(&mut self, session_id: SessionId, generation: u64) -> bool
Drop a session projection before a full cursor-zero rebuild.
A visible projection is never reset while its replay scratch is active
or its session is quarantined; callers receive false and must recover
through the staged replay path instead.
Sourcepub fn rebuild_session(
&mut self,
session_id: SessionId,
generation: u64,
events: Vec<StoredEvent>,
) -> bool
pub fn rebuild_session( &mut self, session_id: SessionId, generation: u64, events: Vec<StoredEvent>, ) -> bool
Replace a session projection only after a complete contiguous replay is available. A failed/incomplete fetch leaves the existing projection intact.
Trait Implementations§
Source§impl Clone for StateStore
impl Clone for StateStore
Source§fn clone(&self) -> StateStore
fn clone(&self) -> StateStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StateStore
impl Debug for StateStore
Source§impl Default for StateStore
impl Default for StateStore
Source§fn default() -> StateStore
fn default() -> StateStore
Auto Trait Implementations§
impl Freeze for StateStore
impl RefUnwindSafe for StateStore
impl Send for StateStore
impl Sync for StateStore
impl Unpin for StateStore
impl UnsafeUnpin for StateStore
impl UnwindSafe for StateStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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