Skip to main content

TraceStorage

Trait TraceStorage 

Source
pub trait TraceStorage<C: Copy> {
    const ENABLED: bool;

    // Required methods
    fn new(callsite_info: C) -> Self;
    fn on_contention<E: TransactionHooks<CallsiteInfo = C>>(&self);
    fn on_finalized<E: TransactionHooks<CallsiteInfo = C>>(&self);
    fn set_callsite_info(&self, callsite_info: C);
}
Expand description

Storage trait for contention spin tracing in ChainLockTransaction.

Required Associated Constants§

Source

const ENABLED: bool

Whether contention spin tracing is enabled.

Required Methods§

Source

fn new(callsite_info: C) -> Self

Creates a new trace storage instance with the given callsite_info.

Source

fn on_contention<E: TransactionHooks<CallsiteInfo = C>>(&self)

Records the start of contention if not already recorded.

Source

fn on_finalized<E: TransactionHooks<CallsiteInfo = C>>(&self)

Emits the contention trace event if contention occurred during this transaction.

Source

fn set_callsite_info(&self, callsite_info: C)

Updates the callsite info when restarting a transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C: Copy> TraceStorage<C> for TraceStorageDisabled

Source§

const ENABLED: bool = false

Source§

impl<C: Copy> TraceStorage<C> for TraceStorageEnabled<C>

Source§

const ENABLED: bool = true