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
use super::*;

/// Formats `CircuitState` as a lowercase label.
impl fmt::Display for CircuitState {
    /// Writes the circuit state label to the formatter.
    ///
    /// # Arguments
    ///
    /// - `&Self` - The circuit state.
    /// - `&mut fmt::Formatter<'_>` - The target formatter.
    ///
    /// # Returns
    ///
    /// - `fmt::Result` - Result of formatting.
    #[inline(always)]
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::Closed => f.write_str(STATE_STR_CLOSED),
            Self::Open => f.write_str(STATE_STR_OPEN),
            Self::HalfOpen => f.write_str(STATE_STR_HALF_OPEN),
        }
    }
}