#[non_exhaustive]pub enum IdParseError {
Zero,
InvalidNumber(ParseIntError),
}Expand description
Error type for numeric ID parsing failures
This error is returned when a string cannot be parsed as a valid Id<D>.
§Examples
use domain_key::IdParseError;
let result = "not_a_number".parse::<u64>();
assert!(result.is_err());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.
Zero
The value is zero, which is not a valid identifier
InvalidNumber(ParseIntError)
The string could not be parsed as a valid non-zero u64 number
Implementations§
Source§impl IdParseError
impl IdParseError
Sourcepub fn user_message(&self) -> &'static str
pub fn user_message(&self) -> &'static str
Returns a user-friendly error message suitable for display.
Trait Implementations§
Source§impl Clone for IdParseError
impl Clone for IdParseError
Source§fn clone(&self) -> IdParseError
fn clone(&self) -> IdParseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdParseError
impl Debug for IdParseError
Source§impl Display for IdParseError
impl Display for IdParseError
Source§impl Error for IdParseError
impl Error for IdParseError
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 From<ParseIntError> for IdParseError
impl From<ParseIntError> for IdParseError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for IdParseError
impl PartialEq for IdParseError
impl Eq for IdParseError
impl StructuralPartialEq for IdParseError
Auto Trait Implementations§
impl Freeze for IdParseError
impl RefUnwindSafe for IdParseError
impl Send for IdParseError
impl Sync for IdParseError
impl Unpin for IdParseError
impl UnsafeUnpin for IdParseError
impl UnwindSafe for IdParseError
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