Skip to main content

OutputLedger

Struct OutputLedger 

Source
pub struct OutputLedger<O> { /* private fields */ }
Expand description

Fake output consumer ledger for materialized output frames.

Implementations§

Source§

impl<O: Clone + PartialEq> OutputLedger<O>

Source

pub fn new() -> Self

Creates an empty output ledger.

Source

pub fn close_scope(&mut self, scope: ScopeId)

Marks a scope closed for later frame validation.

Source

pub fn apply_result<C>(&mut self, result: &TransactionResult<C, O>)

Applies all output frames from a transaction result.

Source

pub fn apply_frame(&mut self, frame: &OutputFrame<O>)

Applies a single output frame.

Source

pub fn snapshot(&self, key: OutputKey) -> Option<&OutputSnapshot<O>>

Returns current output state.

Source

pub fn errors(&self) -> &[OutputLedgerError]

Returns structural ledger errors observed while applying frames.

Source

pub fn frame_trace(&self) -> &[OutputFrameTrace]

Returns frame traces in applied delivery order.

Source

pub fn frame_records(&self) -> &[OutputFrame<O>]

Returns applied output frames including typed payloads in delivery order.

Source

pub fn assert_revision_monotonic(&self) -> Result<(), OutputLedgerError>

Asserts no revision regressions or closed-scope frame errors occurred.

Source

pub fn assert_no_frame_for_closed_scope_except_terminal( &self, ) -> Result<(), OutputLedgerError>

Asserts closed scopes emitted no non-terminal output frames.

Source

pub fn assert_closed_scope_cleared( &self, scope: ScopeId, ) -> Result<(), OutputLedgerError>

Asserts every output owned by a closed scope has been cleared.

Source

pub fn assert_cleared(&self, key: OutputKey) -> Result<(), OutputLedgerError>

Asserts an output key is currently cleared.

Source

pub fn assert_current_equals( &self, key: OutputKey, expected: &O, ) -> Result<(), OutputLedgerError>

Asserts the current consumer state equals an expected baseline.

Source

pub fn assert_delta_sequence_matches_rebaseline( &self, key: OutputKey, rebaseline: &O, ) -> Result<(), OutputLedgerError>

Asserts the current delta-applied state matches a rebaseline value.

Source

pub fn assert_consumer_needs_no_hidden_graph_state( &self, ) -> Result<(), OutputLedgerError>

Asserts the ledger observed no structural frame errors.

Source§

impl<O> OutputLedger<O>

Source

pub fn to_debug_string(&self) -> String
where O: Debug,

Returns deterministic debug output for output ledger snapshots.

Source

pub fn to_redacted_debug_string(&self, redact: impl Fn(&O) -> String) -> String

Returns deterministic redacted debug output for output ledger snapshots.

Trait Implementations§

Source§

impl<O: Clone> Clone for OutputLedger<O>

Source§

fn clone(&self) -> OutputLedger<O>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<O: Debug> Debug for OutputLedger<O>

Source§

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

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

impl<O: Default> Default for OutputLedger<O>

Source§

fn default() -> OutputLedger<O>

Returns the “default value” for a type. Read more
Source§

impl<O: Eq> Eq for OutputLedger<O>

Source§

impl<O: PartialEq> PartialEq for OutputLedger<O>

Source§

fn eq(&self, other: &OutputLedger<O>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<O: PartialEq> StructuralPartialEq for OutputLedger<O>

Auto Trait Implementations§

§

impl<O> Freeze for OutputLedger<O>

§

impl<O> RefUnwindSafe for OutputLedger<O>
where O: RefUnwindSafe,

§

impl<O> Send for OutputLedger<O>
where O: Send,

§

impl<O> Sync for OutputLedger<O>
where O: Sync,

§

impl<O> Unpin for OutputLedger<O>
where O: Unpin,

§

impl<O> UnsafeUnpin for OutputLedger<O>

§

impl<O> UnwindSafe for OutputLedger<O>

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, 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> 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.