//! Error classification — the contract between a caller's error type and the
//! resilience primitives.
use Duration;
/// How the resilience layer should treat the result of a single attempt.
///
/// Callers implement the mapping from their own error type to this enum and
/// pass it as a `Fn(&E) -> Outcome` closure. [`Outcome::Transient`] failures
/// are retried and count toward the circuit breaker; [`Outcome::Permanent`]
/// failures fail fast but still count toward the breaker (a
/// steadily-misconfigured dependency is unhealthy regardless of whether
/// retrying would help).