#[non_exhaustive]pub enum Error<E> {
DecodeOverflow {
id: E,
},
Base32Error(Error<E>),
}Available on crate feature
serde only.Expand description
Errors that can occur while decoding IDs.
This error type is generic over the decoded ID type E, which allows
including the decoded ID in case of overflow. This can help callers inspect
or log invalid IDs during error handling.
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.
DecodeOverflow
The decoded value exceeds the valid range for the target ID type.
This occurs when the input string sets reserved or unused high bits.
Fields
§
id: EThe decoded ID value, which failed validation.
Base32Error(Error<E>)
Available on crate feature
base32 only.An error occurred during Crockford Base32 decoding.
This wraps the crate::base32::Error type and is only available when
the base32 feature is enabled.
Trait Implementations§
impl<E: Eq> Eq for Error<E>
Source§impl<E: Debug> Error for Error<E>
impl<E: Debug> Error for Error<E>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl<E: Ord> Ord for Error<E>
impl<E: Ord> Ord for Error<E>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<E: PartialOrd> PartialOrd for Error<E>
impl<E: PartialOrd> PartialOrd for Error<E>
impl<E: PartialEq> StructuralPartialEq for Error<E>
Auto Trait Implementations§
impl<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>where
E: Send,
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnsafeUnpin for Error<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Error<E>where
E: UnwindSafe,
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