pub struct HealthPolicy {
pub check_url: Option<String>,
pub timeout: Duration,
pub concurrency: NonZeroUsize,
pub failure_threshold: NonZeroU32,
pub cooldown: Duration,
pub max_cooldown: Duration,
pub cooldown_jitter: f64,
pub check_on_build: bool,
}Expand description
Passive health feedback is enabled by default. Active probes require an explicit URL, so a reusable library never depends on a particular website.
Fields§
§check_url: Option<String>Optional URL fetched through each proxy; 2xx/3xx passes the probe.
timeout: DurationMaximum duration of an active probe.
concurrency: NonZeroUsizeMaximum simultaneous active probes.
failure_threshold: NonZeroU32Consecutive transport failures that open a node’s circuit.
cooldown: DurationFirst cooldown. Repeated failed recoveries double this delay.
max_cooldown: DurationCap for exponential cooldowns.
cooldown_jitter: f64Random delay variation in [0, 0.5]; zero gives deterministic delays.
check_on_build: boolProbe new nodes before normal use. Failed nodes enter cooldown and
can receive one recovery attempt after it expires.
Requires check_url to be set.
Implementations§
Trait Implementations§
Source§impl Clone for HealthPolicy
impl Clone for HealthPolicy
Source§fn clone(&self) -> HealthPolicy
fn clone(&self) -> HealthPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HealthPolicy
impl Debug for HealthPolicy
Auto Trait Implementations§
impl Freeze for HealthPolicy
impl RefUnwindSafe for HealthPolicy
impl Send for HealthPolicy
impl Sync for HealthPolicy
impl Unpin for HealthPolicy
impl UnsafeUnpin for HealthPolicy
impl UnwindSafe for HealthPolicy
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