pub enum StabilityRefusal {
Show 22 variants
CertificateMissing,
BlockGainBoundExceeded,
ContractionMarginInsufficient,
LearningRateOutsideEnvelope,
ModeDwellTimeViolated,
QRangeDestabilizing,
MassClampUnsafe,
PriceGainUnsafe,
StandingProjectionGainUnsafe,
RuntimeEnvelopeViolated,
CertificateDigestMismatch,
ControlModeUncertified,
ControlModeSwitchTooFast,
YieldGainBoundViolated,
RewardBoundViolated,
ResourceResponseBoundViolated,
StandingResetBoundViolated,
LearningFrozen,
NumericRangeExceeded,
UnsupportedDomain,
ContractViolation,
ExploreFloorOutsideEnvelope,
}Expand description
Refusal reasons returned by the allocator when stability invariants are violated.
In compliance with the substrate rules, these are typed error codes rather than text logs to avoid allocation and branching in the hot path.
Variants§
CertificateMissing
BlockGainBoundExceeded
ContractionMarginInsufficient
LearningRateOutsideEnvelope
ModeDwellTimeViolated
QRangeDestabilizing
MassClampUnsafe
PriceGainUnsafe
StandingProjectionGainUnsafe
RuntimeEnvelopeViolated
CertificateDigestMismatch
ControlModeUncertified
ControlModeSwitchTooFast
YieldGainBoundViolated
RewardBoundViolated
ResourceResponseBoundViolated
StandingResetBoundViolated
LearningFrozen
NumericRangeExceeded
UnsupportedDomain
ContractViolation
ExploreFloorOutsideEnvelope
CMCA-122: the explore-floor parameter eta is outside its
envelope. Previously folded into Self::LearningRateOutsideEnvelope
alongside zeta/beta even though eta has nothing to do with the
learning-rate parameters – a caller debugging off the old, shared
reason was routed to the wrong subsystem.
Implementations§
Source§impl StabilityRefusal
impl StabilityRefusal
Sourcepub fn from_u32(val: u32) -> Option<Self>
pub fn from_u32(val: u32) -> Option<Self>
Parses a raw u32 value into a StabilityRefusal branchlessly.
§Complexity
$O(1)$ constant time with no branches.
§Examples
use bcinr_cmca::allocator::StabilityRefusal;
assert_eq!(StabilityRefusal::from_u32(0), Some(StabilityRefusal::CertificateMissing));
assert_eq!(StabilityRefusal::from_u32(99), None);Trait Implementations§
Source§impl Clone for StabilityRefusal
impl Clone for StabilityRefusal
impl Copy for StabilityRefusal
Source§impl Debug for StabilityRefusal
impl Debug for StabilityRefusal
Source§impl Display for StabilityRefusal
impl Display for StabilityRefusal
impl Eq for StabilityRefusal
Source§impl PartialEq for StabilityRefusal
impl PartialEq for StabilityRefusal
impl StructuralPartialEq for StabilityRefusal
Auto Trait Implementations§
impl Freeze for StabilityRefusal
impl RefUnwindSafe for StabilityRefusal
impl Send for StabilityRefusal
impl Sync for StabilityRefusal
impl Unpin for StabilityRefusal
impl UnsafeUnpin for StabilityRefusal
impl UnwindSafe for StabilityRefusal
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