pub struct Pno(/* private fields */);Expand description
A validated Swedish personal identity number (personnummer).
Accepts 10-digit (YYMMDDXXXX), 10-digit with separator (YYMMDD-XXXX,
YYMMDD+XXXX), 12-digit (YYYYMMDDXXXX), or 12-digit with separator
(YYYYMMDD-XXXX). Strips separators and validates the Luhn check digit.
Stored without separators; serializes/deserializes as a plain JSON string.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pno
impl<'de> Deserialize<'de> for Pno
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Pno
impl StructuralPartialEq for Pno
Auto Trait Implementations§
impl Freeze for Pno
impl RefUnwindSafe for Pno
impl Send for Pno
impl Sync for Pno
impl Unpin for Pno
impl UnsafeUnpin for Pno
impl UnwindSafe for Pno
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.