atomic-circuit-breaker 11.2.0

Zero-dependency, lock-free atomic sliding-window circuit breaker with CAS probe gating, monotonic clock support, and RAII guards.
Documentation
/// Bit position of the 2-bit state code inside `state_word`.
pub(crate) const STATE_SHIFT: u32 = 62;

/// Encoded state tag for `CircuitState::Closed`.
pub(crate) const STATE_CLOSED: u64 = 0;

/// Encoded state tag for `CircuitState::Open`.
pub(crate) const STATE_OPEN: u64 = 1;

/// Encoded state tag for `CircuitState::HalfOpen`.
pub(crate) const STATE_HALF_OPEN: u64 = 2;

/// Bit position of the 30-bit monotonic generation counter inside `state_word`.
pub(crate) const GEN_SHIFT: u32 = 32;

/// Bitmask extracting the 30-bit generation counter.
pub(crate) const GEN_MASK: u64 = (1u64 << 30) - 1;

/// Bit position of the upper 16-bit auxiliary counter (`consecutive_failures` or `dispatched_probes`).
pub(crate) const HI_AUX_SHIFT: u32 = 16;

/// Bitmask extracting a 16-bit auxiliary counter.
pub(crate) const AUX_MASK: u64 = 0xFFFF;

/// Number of generation-indexed open-timestamp slots preventing cross-cycle timestamp races.
pub(crate) const OPENED_AT_SLOTS: usize = 8;

/// Bitmask indexing into `opened_at_slots`.
pub(crate) const OPENED_AT_SLOT_MASK: usize = OPENED_AT_SLOTS - 1;