pub struct PhoneInputNumber {
pub country: PhoneInputCountry,
pub e164: Option<String>,
pub is_valid: bool,
pub national_number: String,
}Expand description
A parsed phone value.
Fields§
§country: PhoneInputCountryThe country the number belongs to. International input switches it to the country the calling code and number identify; national input keeps the selected country.
e164: Option<String>The E.164 value, such as +12015550123, present only when the number is valid.
is_valid: boolWhether the number is a complete, valid number for its country.
national_number: StringThe text the phone field shows: the as-you-type formatted input, or the national format of a valid international number.
Implementations§
Source§impl PhoneInputNumber
impl PhoneInputNumber
Sourcepub fn empty(country: PhoneInputCountry) -> Self
pub fn empty(country: PhoneInputCountry) -> Self
An empty value for country.
Sourcepub fn resolve(country: PhoneInputCountry, input: &str) -> Self
pub fn resolve(country: PhoneInputCountry, input: &str) -> Self
Formats and validates input for country, like resolveLumenPhoneNumber in
@santi020k/lumen-core.
National input is formatted as the user types it. Input that starts with + is read as an
international number: the calling code picks the country, and a valid number is shown in
that country’s national format.
Trait Implementations§
Source§impl Clone for PhoneInputNumber
impl Clone for PhoneInputNumber
Source§impl Debug for PhoneInputNumber
impl Debug for PhoneInputNumber
impl Eq for PhoneInputNumber
Source§impl PartialEq for PhoneInputNumber
impl PartialEq for PhoneInputNumber
impl StructuralPartialEq for PhoneInputNumber
Auto Trait Implementations§
impl Forget for PhoneInputNumber
impl Freeze for PhoneInputNumber
impl Move for PhoneInputNumber
impl RefUnwindSafe for PhoneInputNumber
impl Send for PhoneInputNumber
impl Sync for PhoneInputNumberwhere
RawVecInner: Sync,
impl Unpin for PhoneInputNumber
impl UnsafeUnpin for PhoneInputNumber
impl UnwindSafe for PhoneInputNumber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more