Skip to main content

OutputLedger

Struct OutputLedger 

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

Fake output consumer ledger for materialized output frames.

Implementations§

Source§

impl OutputLedger

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>)

Applies all output frames from a transaction result.

Source

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

Applies a single output frame.

Source

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

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]

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: &(impl Clone + PartialEq + Send + Sync + 'static), ) -> Result<(), OutputLedgerError>

Asserts the current consumer state equals an expected baseline.

Source

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

Asserts the ledger observed no structural frame errors.

Source§

impl OutputLedger

Source

pub fn to_debug_string(&self) -> String

Returns deterministic debug output for output ledger snapshots.

Source

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

Returns deterministic redacted debug output for output ledger snapshots.

Trait Implementations§

Source§

impl Clone for OutputLedger

Source§

fn clone(&self) -> OutputLedger

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 Debug for OutputLedger

Source§

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

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

impl Default for OutputLedger

Source§

fn default() -> OutputLedger

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

impl PartialEq for OutputLedger

Source§

fn eq(&self, other: &OutputLedger) -> 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 StructuralPartialEq for OutputLedger

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