pub struct CpfMatcher { /* private fields */ }Expand description
CPF matcher with normalization and validation
Implementations§
Source§impl CpfMatcher
impl CpfMatcher
Sourcepub fn without_validation() -> Self
pub fn without_validation() -> Self
Create a matcher that skips digit validation (for testing)
Sourcepub fn normalize(&self, cpf: &str) -> Option<String>
pub fn normalize(&self, cpf: &str) -> Option<String>
Normalize a CPF string to 11 digits
Handles various input formats:
- “123.456.789-00”
- “12345678900”
- “ 123 456 789 00 “
- “123-456-789-00”
Sourcepub fn format(&self, cpf: &str) -> Option<String>
pub fn format(&self, cpf: &str) -> Option<String>
Format a normalized CPF with standard punctuation
Trait Implementations§
Source§impl Clone for CpfMatcher
impl Clone for CpfMatcher
Source§fn clone(&self) -> CpfMatcher
fn clone(&self) -> CpfMatcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CpfMatcher
impl Debug for CpfMatcher
Source§impl Default for CpfMatcher
impl Default for CpfMatcher
Source§fn default() -> CpfMatcher
fn default() -> CpfMatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CpfMatcher
impl RefUnwindSafe for CpfMatcher
impl Send for CpfMatcher
impl Sync for CpfMatcher
impl Unpin for CpfMatcher
impl UnsafeUnpin for CpfMatcher
impl UnwindSafe for CpfMatcher
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