Enum phonenumber::Validation
[−]
[src]
pub enum Validation { IsPossible, IsPossibleLocalOnly, InvalidCountryCode, TooShort, InvalidLength, TooLong, }
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.
Methods
impl Validation
[src]
pub fn is_possible(&self) -> bool
[src]
Whether it's a possible number.
pub fn is_invalid(&self) -> bool
[src]
Whether it's an invalid number.
pub fn is_invalid_length(&self) -> bool
[src]
Whether the length is invalid.
Trait Implementations
impl Copy for Validation
[src]
impl Clone for Validation
[src]
fn clone(&self) -> Validation
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Validation
[src]
impl PartialEq for Validation
[src]
fn eq(&self, __arg_0: &Validation) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.