pub enum HaltReason {
FastGuard {
window: Vec<f64>,
threshold: f64,
},
SlowGuard {
mean_ratio: f64,
window_size: usize,
threshold: f64,
},
RevertBurst {
consecutive_reverts: usize,
limit: usize,
},
RevertGasBudgetExceeded {
gas_cost_burned: u128,
budget_limit: u128,
window: usize,
},
VolumeWeightedDrift {
weighted_ratio: f64,
threshold: f64,
window: usize,
},
NetDrawdownExceeded {
net_slippage_loss: i128,
max_drawdown_limit: i128,
window: usize,
},
Custom(String),
}Expand description
Structured reason a HaltDecision::Halt was returned.
Deliberately structured rather than a bare string for the built-in
guards — this is what lets telemetry emit a machine-readable event
that the benchmark harness can aggregate without string parsing.
Variants§
FastGuard
SlowGuard
RevertBurst
Revert burst: k_rev consecutive transactions reverted on-chain.
RevertGasBudgetExceeded
Revert gas burn: cumulative gas cost on reverts in window exceeded budget.
VolumeWeightedDrift
Capital-weighted drift: volume-weighted ratio fell below threshold.
NetDrawdownExceeded
Absolute drawdown: cumulative net slippage (predicted - realized) exceeded cap.
Custom(String)
For non-default HaltPolicy implementations. Implementers of a
reusable custom policy are encouraged to define their own
structured variant instead of relying on this indefinitely.
Trait Implementations§
Source§impl Clone for HaltReason
impl Clone for HaltReason
Source§fn clone(&self) -> HaltReason
fn clone(&self) -> HaltReason
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 HaltReason
impl Debug for HaltReason
Source§impl<'de> Deserialize<'de> for HaltReason
impl<'de> Deserialize<'de> for HaltReason
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HaltReason, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HaltReason, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HaltReason
impl PartialEq for HaltReason
Source§impl Serialize for HaltReason
impl Serialize for HaltReason
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for HaltReason
Auto Trait Implementations§
impl Freeze for HaltReason
impl RefUnwindSafe for HaltReason
impl Send for HaltReason
impl Sync for HaltReason
impl Unpin for HaltReason
impl UnsafeUnpin for HaltReason
impl UnwindSafe for HaltReason
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