#[non_exhaustive]pub enum ErrorClass {
Transient,
Permanent,
Other(String),
}Expand description
An error class. Decodes open: a value other than classes is kept in
ErrorClass::Other. Non-exhaustive, so a match needs a wildcard arm
and adding a variant later is not a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl ErrorClass
impl ErrorClass
pub fn parse(class: &str) -> Self
pub fn as_str(&self) -> &str
Sourcepub fn effective(&self) -> Self
pub fn effective(&self) -> Self
The class a caller acts on: an unknown class is treated as permanent, so a caller never retries what it cannot classify.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Whether the class, as a caller acts on it, is transient.
Trait Implementations§
Source§impl Clone for ErrorClass
impl Clone for ErrorClass
Source§impl Debug for ErrorClass
impl Debug for ErrorClass
Source§impl<'de> Deserialize<'de> for ErrorClass
impl<'de> Deserialize<'de> for ErrorClass
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ErrorClass
impl Display for ErrorClass
impl Eq for ErrorClass
Source§impl Hash for ErrorClass
impl Hash for ErrorClass
Source§impl PartialEq for ErrorClass
impl PartialEq for ErrorClass
Source§impl Serialize for ErrorClass
impl Serialize for ErrorClass
impl StructuralPartialEq for ErrorClass
Auto Trait Implementations§
impl Freeze for ErrorClass
impl RefUnwindSafe for ErrorClass
impl Send for ErrorClass
impl Sync for ErrorClass
impl Unpin for ErrorClass
impl UnsafeUnpin for ErrorClass
impl UnwindSafe for ErrorClass
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