pub enum Validation {
IsPossible,
IsPossibleLocalOnly,
InvalidCountryCode,
TooShort,
InvalidLength,
TooLong,
}Expand description
Possible outcomes when testing if a PhoneNumber is possible.
Variants§
IsPossible
The number length matches that of valid numbers for this region.
IsPossibleLocalOnly
The number length matches that of local numbers for this region only (i.e. numbers that may be able to be dialled within an area, but do not have all the information to be dialled from anywhere inside or outside the country).
InvalidCountryCode
The number has an invalid country calling code.
TooShort
The number is shorter than all valid numbers for this region.
InvalidLength
The number is longer than the shortest valid numbers for this region, shorter than the longest valid numbers for this region, and does not itself have a number length that matches valid numbers for this region.
TooLong
The number is longer than all valid numbers for this region.
Implementations§
Source§impl Validation
impl Validation
Sourcepub fn is_possible(&self) -> bool
pub fn is_possible(&self) -> bool
Whether it’s a possible number.
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Whether it’s an invalid number.
Sourcepub fn is_invalid_length(&self) -> bool
pub fn is_invalid_length(&self) -> bool
Whether the length is invalid.
Trait Implementations§
Source§impl Clone for Validation
impl Clone for Validation
Source§fn clone(&self) -> Validation
fn clone(&self) -> Validation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Validation
impl Debug for Validation
Source§impl PartialEq for Validation
impl PartialEq for Validation
impl Copy for Validation
impl Eq for Validation
impl StructuralPartialEq for Validation
Auto Trait Implementations§
impl Freeze for Validation
impl RefUnwindSafe for Validation
impl Send for Validation
impl Sync for Validation
impl Unpin for Validation
impl UnwindSafe for Validation
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