Enum phonenumber::Validation
source · 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
source§fn eq(&self, other: &Validation) -> bool
fn eq(&self, other: &Validation) -> bool
self
and other
values to be equal, and is used
by ==
.