pub struct PhoneNumberDesc {
pub national_number_pattern: Option<String>,
pub possible_length: Vec<i32>,
pub possible_length_local_only: Vec<i32>,
pub example_number: Option<String>,
}Expand description
If you add, remove, or rename fields, or change their semantics, check if you should change the excludable field sets or the behavior in MetadataFilter.
Fields§
§national_number_pattern: Option<String>This field is shadowed by the wrapper and is intentionally left empty. Access the underlying data via .original.
The national_number_pattern is the pattern that a valid national significant number would match. This specifies information such as its total length and leading digits.
possible_length: Vec<i32>These represent the lengths a phone number from this region can be. They will be sorted from smallest to biggest. Note that these lengths are for the full number, without country calling code or national prefix. For example, for the Swiss number +41789270000, in local format 0789270000, this would be 9. This could be used to highlight tokens in a text that may be a phone number, or to quickly prune numbers that could not possibly be a phone number for this locale.
possible_length_local_only: Vec<i32>These represent the lengths that only local phone numbers (without an area code) from this region can be. They will be sorted from smallest to biggest. For example, since the American number 456-1234 may be locally diallable, although not diallable from outside the area, 7 could be a possible value. This could be used to highlight tokens in a text that may be a phone number. To our knowledge, area codes are usually only relevant for some fixed-line and mobile numbers, so this field should only be set for those types of numbers (and the general description) - however there are exceptions for NANPA countries. This data is used to calculate whether a number could be a possible number for a particular type.
example_number: Option<String>An example national significant number for the specific type. It should not contain any formatting information.
Implementations§
Source§impl PhoneNumberDesc
impl PhoneNumberDesc
Sourcepub fn national_number_pattern(&self) -> &str
pub fn national_number_pattern(&self) -> &str
Returns the value of national_number_pattern, or the default value if national_number_pattern is unset.
Sourcepub fn example_number(&self) -> &str
pub fn example_number(&self) -> &str
Returns the value of example_number, or the default value if example_number is unset.
Trait Implementations§
Source§impl Clone for PhoneNumberDesc
impl Clone for PhoneNumberDesc
Source§fn clone(&self) -> PhoneNumberDesc
fn clone(&self) -> PhoneNumberDesc
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PhoneNumberDesc
impl Debug for PhoneNumberDesc
Source§impl Default for PhoneNumberDesc
impl Default for PhoneNumberDesc
Source§impl Hash for PhoneNumberDesc
impl Hash for PhoneNumberDesc
Source§impl Message for PhoneNumberDesc
impl Message for PhoneNumberDesc
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for PhoneNumberDesc
impl PartialEq for PhoneNumberDesc
Source§fn eq(&self, other: &PhoneNumberDesc) -> bool
fn eq(&self, other: &PhoneNumberDesc) -> bool
self and other values to be equal, and is used by ==.