#[non_exhaustive]pub enum ValidatorKind {
Show 15 variants
EmailRfc,
E164Phone,
E164PhoneNational(Region),
Luhn,
IbanMod97,
Ipv4Parse,
Ipv6Parse,
EthEip55,
AadhaarVerhoeff,
FrNirMod97,
DeSteuerIdMod1110,
BsnMod11,
CpfMod11,
CnpjMod11,
UkNhsMod11,
}Expand description
Closed set of validator implementations used by validator-backed recognizers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmailRfc
Basic email shape validator.
E164Phone
phone-parser only.Parser-backed E.164 phone validator.
E164PhoneNational(Region)
phone-parser only.Parser-backed national phone validator for a fixed region.
Luhn
Luhn checksum validator.
IbanMod97
IBAN MOD-97 validator.
Ipv4Parse
Strict decimal dotted-quad IPv4 parser.
Ipv6Parse
RFC 4291 / RFC 5952 IPv6 textual parser.
EthEip55
EIP-55 Ethereum address checksum validator.
AadhaarVerhoeff
Indian Aadhaar Verhoeff checksum validator.
FrNirMod97
French NIR MOD-97 key validator.
DeSteuerIdMod1110
German Steuer-ID MOD 11,10 checksum validator.
BsnMod11
Dutch BSN MOD-11 checksum validator.
CpfMod11
Brazilian CPF MOD-11 checksum validator.
CnpjMod11
Brazilian CNPJ MOD-11 checksum validator.
UkNhsMod11
UK NHS number MOD-11 checksum validator.
Implementations§
Source§impl ValidatorKind
impl ValidatorKind
Sourcepub fn parse(s: &str) -> Result<Self, ValidatorKindParseError>
pub fn parse(s: &str) -> Result<Self, ValidatorKindParseError>
Parses a policy validator kind.
Sourcepub fn validate(self, input: &str) -> ValidatorOutcome
pub fn validate(self, input: &str) -> ValidatorOutcome
Applies validation and returns a typed outcome for audit.
Sourcepub fn canonical_form(self, input: &str) -> Option<String>
pub fn canonical_form(self, input: &str) -> Option<String>
Returns the canonical form for accepted input.
Sourcepub fn fail_reason(self) -> ValidatorFailReason
pub fn fail_reason(self) -> ValidatorFailReason
Returns the audit reason emitted when validation fails.
Trait Implementations§
Source§impl Clone for ValidatorKind
impl Clone for ValidatorKind
Source§fn clone(&self) -> ValidatorKind
fn clone(&self) -> ValidatorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidatorKind
impl Debug for ValidatorKind
Source§impl PartialEq for ValidatorKind
impl PartialEq for ValidatorKind
Source§fn eq(&self, other: &ValidatorKind) -> bool
fn eq(&self, other: &ValidatorKind) -> bool
self and other values to be equal, and is used by ==.impl Copy for ValidatorKind
impl Eq for ValidatorKind
impl StructuralPartialEq for ValidatorKind
Auto Trait Implementations§
impl Freeze for ValidatorKind
impl RefUnwindSafe for ValidatorKind
impl Send for ValidatorKind
impl Sync for ValidatorKind
impl Unpin for ValidatorKind
impl UnsafeUnpin for ValidatorKind
impl UnwindSafe for ValidatorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more