pub struct MaxErrors(/* private fields */);Expand description
A non-zero maximum errors threshold.
Used to specify the maximum number of errors allowed before taking action.
This type is used in two primary contexts:
- Health check error thresholds: Ensures that health checks require at least one error before marking a service as unhealthy.
- Retry logic: Specifies the maximum number of retry attempts after errors.
By enforcing a non-zero value, this type ensures that both health check and retry thresholds are always meaningful (at least 1 error required).
§Examples
use nntp_proxy::types::MaxErrors;
let max = MaxErrors::new(3).unwrap();
assert_eq!(max.get(), 3);
// Zero errors is invalid
assert!(MaxErrors::new(0).is_none());Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MaxErrors
impl<'de> Deserialize<'de> for MaxErrors
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for MaxErrors
impl Eq for MaxErrors
impl StructuralPartialEq for MaxErrors
Auto Trait Implementations§
impl Freeze for MaxErrors
impl RefUnwindSafe for MaxErrors
impl Send for MaxErrors
impl Sync for MaxErrors
impl Unpin for MaxErrors
impl UnwindSafe for MaxErrors
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
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.