Struct rifven::Rif [−][src]
Venezuelan RIF identifier
Anatomy
The following chart reviews the anatomy of a RIF identifier.
ⓘ
X - XXXXXXXXX - X ^ ^________ ^ A B C
A: Kind
represents either the citizenship or the
kind of entity behind the RIF identifier
B: The contributor/tax payer identifier. Must be 9 digits long
C: The check number for the RIF identifier
Implementations
impl Rif
[src]
pub fn new(
kind: Kind,
identifier: u32,
checksum_digit: u8
) -> Result<Self, Error>
[src]
kind: Kind,
identifier: u32,
checksum_digit: u8
) -> Result<Self, Error>
Creates a new Rif
instance with the provided kind
, identifier
and the checksum_digit
use rifven::{Kind, Rif}; let rif = Rif::new(Kind::Legal, 07013380, 5).unwrap(); assert_eq!(rif.kind(), Kind::Legal); assert_eq!(rif.identifier(), 7013380); assert_eq!(rif.checksum_digit(), 5);
pub fn kind(&self) -> Kind
[src]
Retrieves the Kind
of the current Rif
use rifven::{Kind, Rif}; let rif = Rif::new(Kind::Legal, 07013380, 5).unwrap(); assert_eq!(rif.kind(), Kind::Legal);
pub fn identifier(&self) -> u32
[src]
Retrieves the identifier of the current Rif
use rifven::{Kind, Rif}; let rif = Rif::new(Kind::Legal, 07013380, 5).unwrap(); assert_eq!(rif.identifier(), 7013380);
pub fn checksum_digit(&self) -> u8
[src]
Retrieves the check number of the current Rif
use rifven::{Kind, Rif}; let rif = Rif::new(Kind::Legal, 07013380, 5).unwrap(); assert_eq!(rif.checksum_digit(), 5);
pub fn calc_checksum_digit(kind: &Kind, identifier: u32) -> u8
[src]
Calculates the checksum_digit for a provided RIF number
Trait Implementations
impl Clone for Rif
[src]
impl Debug for Rif
[src]
impl FromStr for Rif
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<Rif> for Rif
[src]
impl StructuralPartialEq for Rif
[src]
Auto Trait Implementations
impl RefUnwindSafe for Rif
impl Send for Rif
impl Sync for Rif
impl Unpin for Rif
impl UnwindSafe for Rif
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,