pub struct InputLedger { /* private fields */ }Expand description
In-memory ledger tracking InputState for all inputs.
Implementations§
Source§impl InputLedger
impl InputLedger
Sourcepub fn accept(&mut self, state: InputState)
pub fn accept(&mut self, state: InputState)
Accept a new InputState into the ledger.
Sourcepub fn recover(&mut self, state: InputState) -> bool
pub fn recover(&mut self, state: InputState) -> bool
Recover an InputState after generated recovery authority retained it.
Recovery retention and idempotency ownership live in the generated
MeerkatMachine recovery/admission path, not in the ledger.
Returns true if the state was inserted.
Sourcepub fn get(&self, input_id: &InputId) -> Option<&InputState>
pub fn get(&self, input_id: &InputId) -> Option<&InputState>
Get the state of a specific input.
Sourcepub fn remove(&mut self, input_id: &InputId) -> Option<InputState>
pub fn remove(&mut self, input_id: &InputId) -> Option<InputState>
Remove an input from the ledger.
Sourcepub fn get_mut(&mut self, input_id: &InputId) -> Option<&mut InputState>
pub fn get_mut(&mut self, input_id: &InputId) -> Option<&mut InputState>
Get mutable reference to the state of a specific input.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&InputId, &InputState)>
pub fn iter(&self) -> impl Iterator<Item = (&InputId, &InputState)>
Iterate over all input states. “Active” (non-terminal) filtering must happen at the driver level, which has DSL access; the ledger by itself carries only shell metadata.
Trait Implementations§
Source§impl Clone for InputLedger
impl Clone for InputLedger
Source§fn clone(&self) -> InputLedger
fn clone(&self) -> InputLedger
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 InputLedger
impl Debug for InputLedger
Source§impl Default for InputLedger
impl Default for InputLedger
Source§fn default() -> InputLedger
fn default() -> InputLedger
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InputLedger
impl RefUnwindSafe for InputLedger
impl Send for InputLedger
impl Sync for InputLedger
impl Unpin for InputLedger
impl UnsafeUnpin for InputLedger
impl UnwindSafe for InputLedger
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