pub trait AccountingStorage: Default {
const ENABLED: bool;
// Required methods
fn new(locks_held: u32, finalized: bool) -> Self;
fn locks_held(&self) -> u32;
fn finalized(&self) -> bool;
fn on_acquire(&self);
fn on_release(&self);
fn set_finalized(&self, finalized: bool);
}Expand description
Storage trait for debug lock accounting in ChainLockTransaction.
Required Associated Constants§
Required Methods§
Sourcefn new(locks_held: u32, finalized: bool) -> Self
fn new(locks_held: u32, finalized: bool) -> Self
Creates a new accounting storage instance with the given initial locks_held and
finalized state.
Sourcefn locks_held(&self) -> u32
fn locks_held(&self) -> u32
Returns the number of locks currently held by the transaction.
Sourcefn on_acquire(&self)
fn on_acquire(&self)
Increments the count of locks held by the transaction.
Sourcefn on_release(&self)
fn on_release(&self)
Decrements the count of locks held by the transaction.
Sourcefn set_finalized(&self, finalized: bool)
fn set_finalized(&self, finalized: bool)
Updates whether the transaction is finalized.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".