pub struct OutputLedger { /* private fields */ }Expand description
Fake output consumer ledger for materialized output frames.
Implementations§
Source§impl OutputLedger
impl OutputLedger
Sourcepub fn close_scope(&mut self, scope: ScopeId)
pub fn close_scope(&mut self, scope: ScopeId)
Marks a scope closed for later frame validation.
Sourcepub fn apply_result<C>(&mut self, result: &TransactionResult<C>)
pub fn apply_result<C>(&mut self, result: &TransactionResult<C>)
Applies all output frames from a transaction result.
Sourcepub fn apply_frame(&mut self, frame: &OutputFrame)
pub fn apply_frame(&mut self, frame: &OutputFrame)
Applies a single output frame.
Sourcepub fn snapshot(&self, key: OutputKey) -> Option<&OutputSnapshot>
pub fn snapshot(&self, key: OutputKey) -> Option<&OutputSnapshot>
Returns current output state.
Sourcepub fn errors(&self) -> &[OutputLedgerError]
pub fn errors(&self) -> &[OutputLedgerError]
Returns structural ledger errors observed while applying frames.
Sourcepub fn frame_trace(&self) -> &[OutputFrameTrace]
pub fn frame_trace(&self) -> &[OutputFrameTrace]
Returns frame traces in applied delivery order.
Sourcepub fn frame_records(&self) -> &[OutputFrame]
pub fn frame_records(&self) -> &[OutputFrame]
Returns applied output frames including typed payloads in delivery order.
Sourcepub fn assert_revision_monotonic(&self) -> Result<(), OutputLedgerError>
pub fn assert_revision_monotonic(&self) -> Result<(), OutputLedgerError>
Asserts no revision regressions or closed-scope frame errors occurred.
Sourcepub fn assert_no_frame_for_closed_scope_except_terminal(
&self,
) -> Result<(), OutputLedgerError>
pub fn assert_no_frame_for_closed_scope_except_terminal( &self, ) -> Result<(), OutputLedgerError>
Asserts closed scopes emitted no non-terminal output frames.
Sourcepub fn assert_closed_scope_cleared(
&self,
scope: ScopeId,
) -> Result<(), OutputLedgerError>
pub fn assert_closed_scope_cleared( &self, scope: ScopeId, ) -> Result<(), OutputLedgerError>
Asserts every output owned by a closed scope has been cleared.
Sourcepub fn assert_cleared(&self, key: OutputKey) -> Result<(), OutputLedgerError>
pub fn assert_cleared(&self, key: OutputKey) -> Result<(), OutputLedgerError>
Asserts an output key is currently cleared.
Sourcepub fn assert_current_equals(
&self,
key: OutputKey,
expected: &(impl Clone + PartialEq + Send + Sync + 'static),
) -> Result<(), OutputLedgerError>
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.
Asserts the ledger observed no structural frame errors.
Source§impl OutputLedger
impl OutputLedger
Sourcepub fn to_debug_string(&self) -> String
pub fn to_debug_string(&self) -> String
Returns deterministic debug output for output ledger snapshots.
Sourcepub fn to_redacted_debug_string(
&self,
redact: impl Fn(&OutputPayload) -> String,
) -> String
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
impl Clone for OutputLedger
Source§fn clone(&self) -> OutputLedger
fn clone(&self) -> OutputLedger
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 OutputLedger
impl Debug for OutputLedger
Source§impl Default for OutputLedger
impl Default for OutputLedger
Source§fn default() -> OutputLedger
fn default() -> OutputLedger
Source§impl PartialEq for OutputLedger
impl PartialEq for OutputLedger
Source§fn eq(&self, other: &OutputLedger) -> bool
fn eq(&self, other: &OutputLedger) -> bool
self and other values to be equal, and is used by ==.