pub struct Kennitala { /* private fields */ }
Expand description
Struct that represents the kennitala of an Icelandic citizen or resident.
Implementations§
Source§impl Kennitala
impl Kennitala
Sourcepub fn new(kennitala: &str) -> Result<Self, KennitalaError>
pub fn new(kennitala: &str) -> Result<Self, KennitalaError>
Create new kennitala object from the given string. Validation is done beforehand.
Sourcepub fn from_u32(kennitala_u32: u32) -> Result<Self, KennitalaError>
pub fn from_u32(kennitala_u32: u32) -> Result<Self, KennitalaError>
beforehand.
Sourcepub fn get_short_year(&self) -> u32
pub fn get_short_year(&self) -> u32
Get year in the range [0, 99]
Sourcepub fn get_short_century(&self) -> u32
pub fn get_short_century(&self) -> u32
Get century digit in the set {0, 9}
Sourcepub fn get_randoms(&self) -> u32
pub fn get_randoms(&self) -> u32
Get the two random digits plus the checksum digit, these are in the range [20, 999]
Sourcepub fn get_birthday(&self) -> NaiveDate
pub fn get_birthday(&self) -> NaiveDate
Get the birthday of this kennitala’s holder.
Trait Implementations§
impl Copy for Kennitala
impl Eq for Kennitala
impl StructuralPartialEq for Kennitala
Auto Trait Implementations§
impl Freeze for Kennitala
impl RefUnwindSafe for Kennitala
impl Send for Kennitala
impl Sync for Kennitala
impl Unpin for Kennitala
impl UnwindSafe for Kennitala
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
)