pub enum Outcome {
Success,
Failure,
RateLimited {
retry_after: Option<Duration>,
},
}Expand description
Classified result of a request, allowing HealthPolicy to distinguish
between different failure modes.
§Examples
use loadwise::health::Outcome;
use std::time::Duration;
let success = Outcome::Success;
let error = Outcome::Failure;
let rate_limited = Outcome::RateLimited { retry_after: Some(Duration::from_secs(30)) };Variants§
Success
Request succeeded.
Failure
Request failed (server error, timeout, etc.).
RateLimited
Request was rejected due to rate limiting. Should NOT count toward consecutive failure thresholds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
impl UnwindSafe for Outcome
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