pub struct PhoneNumberValidator;Expand description
International phone number validator.
Implementations§
Source§impl PhoneNumberValidator
impl PhoneNumberValidator
Sourcepub fn validate(value: &str) -> bool
pub fn validate(value: &str) -> bool
Validate an international phone number format.
Accepts formats like:
- +1234567890
- +1-234-567-8900
- 1234567890
The pattern allows +1 to +999 country codes followed by 1-14 additional digits.
Sourcepub const fn error_message() -> &'static str
pub const fn error_message() -> &'static str
Return the standard validation error message for an invalid phone number.
Auto Trait Implementations§
impl Freeze for PhoneNumberValidator
impl RefUnwindSafe for PhoneNumberValidator
impl Send for PhoneNumberValidator
impl Sync for PhoneNumberValidator
impl Unpin for PhoneNumberValidator
impl UnsafeUnpin for PhoneNumberValidator
impl UnwindSafe for PhoneNumberValidator
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