#[non_exhaustive]pub struct ProviderHealth {
pub provider: Provider,
pub is_healthy: bool,
pub recent_successes: u32,
pub recent_failures: u32,
pub last_error: Option<String>,
pub requests_remaining_estimate: Option<f64>,
}Expand description
Snapshot of one provider’s recent health and (where derivable) remaining rate-limit budget.
Purely observational — computed from the last WINDOW dispatch
outcomes recorded in-process by [super::ProviderSet]; it is not a
circuit breaker and does not itself change dispatch behavior (routing and
RetryPolicy are unaffected by it).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.provider: ProviderThe provider this snapshot describes.
is_healthy: booltrue when at least half of the recent recorded outcomes succeeded,
or when no calls have been recorded yet (optimistic default).
recent_successes: u32Successes among the last WINDOW recorded outcomes.
recent_failures: u32Failures among the last WINDOW recorded outcomes.
last_error: Option<String>The most recent failure’s message. Cleared by any success, so it is set only when the latest recorded outcome was a failure.
requests_remaining_estimate: Option<f64>Best-effort estimate of remaining rate-limit budget (tokens in the
adapter’s own token bucket), when the provider exposes one via
super::ProviderAdapter::rate_limit_remaining. None for providers
with no local rate limiter to peek (e.g. Yahoo) or that haven’t been
initialized.
Trait Implementations§
Source§impl Clone for ProviderHealth
impl Clone for ProviderHealth
Source§fn clone(&self) -> ProviderHealth
fn clone(&self) -> ProviderHealth
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderHealth
impl Debug for ProviderHealth
Source§impl PartialEq for ProviderHealth
impl PartialEq for ProviderHealth
impl StructuralPartialEq for ProviderHealth
Auto Trait Implementations§
impl Freeze for ProviderHealth
impl RefUnwindSafe for ProviderHealth
impl Send for ProviderHealth
impl Sync for ProviderHealth
impl Unpin for ProviderHealth
impl UnsafeUnpin for ProviderHealth
impl UnwindSafe for ProviderHealth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more