Skip to main content

AccountingStorage

Trait AccountingStorage 

Source
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§

Source

const ENABLED: bool

Whether debug lock accounting is enabled.

Required Methods§

Source

fn new(locks_held: u32, finalized: bool) -> Self

Creates a new accounting storage instance with the given initial locks_held and finalized state.

Source

fn locks_held(&self) -> u32

Returns the number of locks currently held by the transaction.

Source

fn finalized(&self) -> bool

Returns whether the transaction is finalized.

Source

fn on_acquire(&self)

Increments the count of locks held by the transaction.

Source

fn on_release(&self)

Decrements the count of locks held by the transaction.

Source

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

Implementors§