Struct card_validate::Validate
source · pub struct Validate {
pub card_type: Type,
}
Expand description
Card validation utility. Used to validate a provided card number (length and Luhn checksum).
Fields§
§card_type: Type
Implementations§
source§impl Validate
impl Validate
pub fn from(card_number: &str) -> Result<Validate, ValidateError>
pub fn evaluate_type(card_number: &str) -> Result<Type, ValidateError>
pub fn is_length_valid(card_number: &str, card_type: &Type) -> bool
pub fn is_luhn_valid(card_number: &str) -> bool
Trait Implementations§
source§impl PartialEq for Validate
impl PartialEq for Validate
impl Copy for Validate
impl StructuralPartialEq for Validate
Auto Trait Implementations§
impl Freeze for Validate
impl RefUnwindSafe for Validate
impl Send for Validate
impl Sync for Validate
impl Unpin for Validate
impl UnwindSafe for Validate
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