Struct phonenumber::PhoneNumber [−][src]
pub struct PhoneNumber { /* fields omitted */ }
A phone number.
Methods
impl PhoneNumber
[src]
impl PhoneNumber
pub fn country(&self) -> Country
[src]
pub fn country(&self) -> Country
Get information about the country for the phone number.
pub fn code(&self) -> &Code
[src]
pub fn code(&self) -> &Code
Get the country code.
pub fn national(&self) -> &NationalNumber
[src]
pub fn national(&self) -> &NationalNumber
Get the national number.
pub fn extension(&self) -> Option<&Extension>
[src]
pub fn extension(&self) -> Option<&Extension>
Get the extension.
pub fn carrier(&self) -> Option<&Carrier>
[src]
pub fn carrier(&self) -> Option<&Carrier>
Get the carrier.
pub fn format<'n>(&'n self) -> Formatter<'n, 'static, 'static>
[src]
pub fn format<'n>(&'n self) -> Formatter<'n, 'static, 'static>
Prepare a formatter for this PhoneNumber
.
Example
use phonenumber::{self, country, Mode}; let number = phonenumber::parse(Some(country::DE), "301/23456").unwrap() .format().mode(Mode::National).to_string(); assert_eq!("030 123456", number);
pub fn format_with<'n, 'd>(
&'n self,
database: &'d Database
) -> Formatter<'n, 'd, 'static>
[src]
pub fn format_with<'n, 'd>(
&'n self,
database: &'d Database
) -> Formatter<'n, 'd, 'static>
Prepare a formatter for this PhoneNumber
with the given Database
.
pub fn metadata<'a>(&self, database: &'a Database) -> Option<&'a Metadata>
[src]
pub fn metadata<'a>(&self, database: &'a Database) -> Option<&'a Metadata>
Get the metadata that applies to this phone number from the given database.
pub fn is_valid(&self) -> bool
[src]
pub fn is_valid(&self) -> bool
Check if the phone number is valid.
pub fn is_valid_with(&self, database: &Database) -> bool
[src]
pub fn is_valid_with(&self, database: &Database) -> bool
Check if the phone number is valid with the given Database
.
Trait Implementations
impl Clone for PhoneNumber
[src]
impl Clone for PhoneNumber
fn clone(&self) -> PhoneNumber
[src]
fn clone(&self) -> PhoneNumber
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for PhoneNumber
[src]
impl Eq for PhoneNumber
impl PartialEq for PhoneNumber
[src]
impl PartialEq for PhoneNumber
fn eq(&self, other: &PhoneNumber) -> bool
[src]
fn eq(&self, other: &PhoneNumber) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &PhoneNumber) -> bool
[src]
fn ne(&self, other: &PhoneNumber) -> bool
This method tests for !=
.
impl Debug for PhoneNumber
[src]
impl Debug for PhoneNumber
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromStr for PhoneNumber
[src]
impl FromStr for PhoneNumber
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Error>
[src]
fn from_str(s: &str) -> Result<Self, Error>
Parses a string s
to return a value of this type. Read more
impl Display for PhoneNumber
[src]
impl Display for PhoneNumber
Auto Trait Implementations
impl Send for PhoneNumber
impl Send for PhoneNumber
impl Sync for PhoneNumber
impl Sync for PhoneNumber