Struct phonenumber::PhoneNumber [] [src]

pub struct PhoneNumber { /* fields omitted */ }

A phone number.

Methods

impl PhoneNumber
[src]

[src]

Get information about the country for the phone number.

[src]

Get the country code.

[src]

Get the national number.

[src]

Get the extension.

[src]

Get the carrier.

[src]

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);

[src]

Prepare a formatter for this PhoneNumber with the given Database.

[src]

Get the metadata that applies to this phone number from the given database.

[src]

Check if the phone number is valid.

[src]

Check if the phone number is valid with the given Database.

Trait Implementations

impl Clone for PhoneNumber
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for PhoneNumber
[src]

impl PartialEq for PhoneNumber
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Debug for PhoneNumber
[src]

[src]

Formats the value using the given formatter. Read more

impl FromStr for PhoneNumber
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Display for PhoneNumber
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for PhoneNumber

impl Sync for PhoneNumber