Struct phonenumber::NationalNumber
source · pub struct NationalNumber { /* private fields */ }
Expand description
The national number part of a phone number.
Implementations§
source§impl NationalNumber
impl NationalNumber
pub fn new(value: u64, zeros: u8) -> Self
sourcepub fn zeros(&self) -> u8
pub fn zeros(&self) -> u8
The number of leading zeroes.
In some countries, the national (significant) number starts with one or more “0“s without this being a national prefix or trunk code of some kind. For example, the leading zero in the national (significant) number of an Italian phone number indicates the number is a fixed-line number. There have been plans to migrate fixed-line numbers to start with the digit two since December 2000, but it has not happened yet. See http://en.wikipedia.org/wiki/%2B39 for more details.
These fields can be safely ignored (there is no need to set them) for most countries. Some limited number of countries behave like Italy - for these cases, if the leading zero(s) of a number would be retained even when dialling internationally, set this flag to true, and also set the number of leading zeros.
Clients who use the parsing or conversion functionality of the i18n phone number libraries will have these fields set if necessary automatically.
Trait Implementations§
source§impl Clone for NationalNumber
impl Clone for NationalNumber
source§fn clone(&self) -> NationalNumber
fn clone(&self) -> NationalNumber
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NationalNumber
impl Debug for NationalNumber
source§impl<'de> Deserialize<'de> for NationalNumber
impl<'de> Deserialize<'de> for NationalNumber
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for NationalNumber
impl Display for NationalNumber
source§impl From<NationalNumber> for u64
impl From<NationalNumber> for u64
source§fn from(n: NationalNumber) -> u64
fn from(n: NationalNumber) -> u64
source§impl Hash for NationalNumber
impl Hash for NationalNumber
source§impl PartialEq for NationalNumber
impl PartialEq for NationalNumber
source§fn eq(&self, other: &NationalNumber) -> bool
fn eq(&self, other: &NationalNumber) -> bool
self
and other
values to be equal, and is used
by ==
.