pub enum KennitalaError {
InvalidLength(usize),
InvalidNumber,
InvalidDay,
InvalidMonth,
InvalidRandomDigits,
InvalidChecksum,
InvalidCentury,
}
Expand description
Errors which can come up when validating a given kennitala.
Variants§
InvalidLength(usize)
The kennitala given does not have 10 digits.
InvalidNumber
The string given cannot be coverted into a valid u32
number.
InvalidDay
The 1st and 2nd digits representing the day of birth are invalid for the given month and year.
InvalidMonth
The 3rd and 4th digits representing the month of birth are invalid.
InvalidRandomDigits
The 7th and 8th digits, which can be from 20 up to 99, are not in said range.
InvalidChecksum
The 9th digit – containing the checksum for this kennital –is invalid.
InvalidCentury
The 10th digit – representing the century of birth – is not 9
or
0
. This means that the person was born in the future!
Trait Implementations§
Source§impl Clone for KennitalaError
impl Clone for KennitalaError
Source§fn clone(&self) -> KennitalaError
fn clone(&self) -> KennitalaError
Returns a copy 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 KennitalaError
impl Debug for KennitalaError
Source§impl Display for KennitalaError
impl Display for KennitalaError
Source§impl Error for KennitalaError
impl Error for KennitalaError
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()
impl Copy for KennitalaError
Auto Trait Implementations§
impl Freeze for KennitalaError
impl RefUnwindSafe for KennitalaError
impl Send for KennitalaError
impl Sync for KennitalaError
impl Unpin for KennitalaError
impl UnwindSafe for KennitalaError
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)