Trait CircuitBreakerRule

Source
pub trait CircuitBreakerRule {
    // Required method
    fn should_trip(&self, history: &RingBuffer<Observation>) -> bool;

    // Provided method
    fn is_valid_for(
        &self,
        _sample_interval_ns: Nanoseconds,
        _history_len: u32,
    ) -> bool { ... }
}
Expand description

Runtime rule interface used by CircuitBreakerSet.

The kernel set is generic over this trait for off-chain/library consumers. The NEAR contract intentionally stores and governs only the closed CircuitBreaker enum so on-chain rule schemas remain explicit and auditable.

Required Methods§

Source

fn should_trip(&self, history: &RingBuffer<Observation>) -> bool

Provided Methods§

Source

fn is_valid_for( &self, _sample_interval_ns: Nanoseconds, _history_len: u32, ) -> bool

Implementors§