[][src]Struct identitycard::ic::IdentityCard

pub struct IdentityCard {
    pub region: String,
    pub birthday: String,
    pub seq: String,
    pub verify: String,
}

身份证的结构类型

创建一个身份证 struct 分别包含地区,生日,序号,和校验码

Fields

region: Stringbirthday: Stringseq: Stringverify: String

Implementations

impl IdentityCard[src]

pub fn verify_ic(&self) -> bool[src]

验证身份证是否正确

Trait Implementations

impl Debug for IdentityCard[src]

impl Display for IdentityCard[src]

impl FromStr for IdentityCard[src]

type Err = ParseIcError

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

解析身份证字符串 &str

use std::str::FromStr;
let ic = IdentityCard.from_str("440222199602175492").unwrap();

assert_eq!(ic.verify_ic(), true);

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> ToString for T where
    T: Display + ?Sized
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,