pub struct ProviderHealth {
pub consecutive_failures: u32,
pub degraded_until: Option<DateTime<Utc>>,
pub successes: u64,
pub failures: u64,
}Expand description
A snapshot of one profile’s recent record.
Fields§
§consecutive_failures: u32Failures since the last success.
degraded_until: Option<DateTime<Utc>>When the profile becomes eligible again, when it is degraded.
successes: u64Successful calls recorded.
failures: u64Failed calls recorded.
Implementations§
Source§impl ProviderHealth
impl ProviderHealth
Sourcepub fn is_healthy_at(&self, now: DateTime<Utc>) -> bool
pub fn is_healthy_at(&self, now: DateTime<Utc>) -> bool
Returns true when the profile is not in a cooldown window at now.
Trait Implementations§
Source§impl Clone for ProviderHealth
impl Clone for ProviderHealth
Source§impl Debug for ProviderHealth
impl Debug for ProviderHealth
Source§impl Default for ProviderHealth
impl Default for ProviderHealth
impl Eq 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
Mutably borrows from an owned value. Read more
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.