pub trait XpLockListener{
// Provided methods
fn lock_updated(
_key: &Key<Self::Via>,
_reason: &LockReason<Self::Via>,
_total_points: Points<Self::Via>,
) { ... }
fn lock_burned(_key: &Key<Self::Via>, _reason: &LockReason<Self::Via>) { ... }
fn lock_slashed(
_key: &Key<Self::Via>,
_reason: &LockReason<Self::Via>,
_slashed_points: Points<Self::Via>,
) { ... }
}Expand description
Listener trait for XP locking events.
This listener is invoked on xp locking (e.g., updates, slashes, burns),
if the XpLock implementor chooses to call it.
It allows implementors to hook into locking events for triggering external logic.
§Note
Listener hooks are best-effort and should be fail-safe. Implementations may choose to invoke them selectively or not at all, so triggered logic must not rely on guaranteed execution.
Provided Methods§
Sourcefn lock_updated(
_key: &Key<Self::Via>,
_reason: &LockReason<Self::Via>,
_total_points: Points<Self::Via>,
)
fn lock_updated( _key: &Key<Self::Via>, _reason: &LockReason<Self::Via>, _total_points: Points<Self::Via>, )
Called when an XP lock update event occurs.
Points reflect total locked points for the runtime lock reason.
Sourcefn lock_burned(_key: &Key<Self::Via>, _reason: &LockReason<Self::Via>)
fn lock_burned(_key: &Key<Self::Via>, _reason: &LockReason<Self::Via>)
Called when an XP lock burn event occurs for the runtime lock reason.
Sourcefn lock_slashed(
_key: &Key<Self::Via>,
_reason: &LockReason<Self::Via>,
_slashed_points: Points<Self::Via>,
)
fn lock_slashed( _key: &Key<Self::Via>, _reason: &LockReason<Self::Via>, _slashed_points: Points<Self::Via>, )
Called when an XP lock burn event occurs.
Points reflect total slashed points for the runtime lock reason.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.