pub struct SessionReducer { /* private fields */ }Expand description
Pure deterministic reducer for canonical durable session records.
Implementations§
Source§impl SessionReducer
impl SessionReducer
Sourcepub fn replay(
records: impl IntoIterator<Item = RecordEnvelope>,
) -> Result<MaterializedSessionState, SessionReplayError>
pub fn replay( records: impl IntoIterator<Item = RecordEnvelope>, ) -> Result<MaterializedSessionState, SessionReplayError>
Rebuilds materialized state from canonical record order.
§Errors
Returns a deterministic corruption/reference/transition error when the complete record stream cannot represent one valid session.
Sourcepub fn replay_reducer(
records: impl IntoIterator<Item = RecordEnvelope>,
) -> Result<Self, SessionReplayError>
pub fn replay_reducer( records: impl IntoIterator<Item = RecordEnvelope>, ) -> Result<Self, SessionReplayError>
Rebuilds a reusable reducer from canonical record order.
§Errors
Returns the first deterministic replay failure.
Sourcepub fn apply(
&mut self,
envelope: &RecordEnvelope,
) -> Result<(), SessionReplayError>
pub fn apply( &mut self, envelope: &RecordEnvelope, ) -> Result<(), SessionReplayError>
Applies one next canonical record atomically to this reducer.
§Errors
Returns an error without changing reducer state when sequence, identity, reference, or lifecycle invariants fail.
Sourcepub const fn state(&self) -> Option<&MaterializedSessionState>
pub const fn state(&self) -> Option<&MaterializedSessionState>
Returns current materialized state, or None before creation.
Trait Implementations§
Source§impl Clone for SessionReducer
impl Clone for SessionReducer
Source§fn clone(&self) -> SessionReducer
fn clone(&self) -> SessionReducer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SessionReducer
impl Debug for SessionReducer
Source§impl Default for SessionReducer
impl Default for SessionReducer
Source§fn default() -> SessionReducer
fn default() -> SessionReducer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SessionReducer
impl RefUnwindSafe for SessionReducer
impl Send for SessionReducer
impl Sync for SessionReducer
impl Unpin for SessionReducer
impl UnsafeUnpin for SessionReducer
impl UnwindSafe for SessionReducer
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