Enum idcard_cn::InvalidId[][src]

pub enum InvalidId {
    LengthNotMatch(usize),
    DivisionNotFound(String),
    InvalidBirthday(String),
    InvalidSeq(String),
    InvalidCheckCode(char),
    WrongCheckCode(char),
}

通常违反身份号码校验规则的错误

Variants

LengthNotMatch(usize)

第二代身份号码长度为18位,其他位数的字符串均不可能为身份号码

DivisionNotFound(String)

行政地区代码没有在历史的 GB/T 2260 地区编码中找到

InvalidBirthday(String)

正常人类寿命一般不超过 120年,因此不会还有 1900 年之前出生的老者 另外也不可能超过验证时出生。

InvalidSeq(String)

序列号格式不正确

InvalidCheckCode(char)

校验码为非法字符

WrongCheckCode(char)

字符串格式正确,但是校验码与输入不匹配

Trait Implementations

impl Debug for InvalidId[src]

impl PartialEq<InvalidId> for InvalidId[src]

impl StructuralPartialEq for InvalidId[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.