pub struct UpstreamHealth {
pub consecutive_failures: u32,
pub circuit_open_until: Option<Instant>,
pub last_error: Option<ErrorCode>,
}Fields§
§consecutive_failures: u32§circuit_open_until: Option<Instant>§last_error: Option<ErrorCode>Implementations§
Source§impl UpstreamHealth
impl UpstreamHealth
pub fn is_available(&self, now: Instant) -> bool
pub fn record_success(&mut self)
pub fn record_failure( &mut self, code: ErrorCode, policy: &FailoverPolicy, now: Instant, )
Trait Implementations§
Source§impl Clone for UpstreamHealth
impl Clone for UpstreamHealth
Source§impl Debug for UpstreamHealth
impl Debug for UpstreamHealth
Auto Trait Implementations§
impl Forget for UpstreamHealth
impl Freeze for UpstreamHealth
impl Move for UpstreamHealth
impl RefUnwindSafe for UpstreamHealth
impl Send for UpstreamHealth
impl Sync for UpstreamHealth
impl Unpin for UpstreamHealth
impl UnsafeUnpin for UpstreamHealth
impl UnwindSafe for UpstreamHealth
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