pub enum InputPurpose {
Text,
Name,
Email,
Url,
Phone,
Number,
Decimal,
Username,
Password,
NewPassword,
OneTimeCode,
}Expand description
What a text field collects (text_field(..).input_purpose(_), docs/textfield.md).
One word for everything a platform keys off the kind of text: the on-screen keyboard’s layout, capitalization and correction, and the credential or contact the system offers to fill in. A backend applies the parts its toolkit has: a desktop toolkit with no on-screen keyboard still takes the autofill and correction half.
Purpose is independent of InputTraits::secure: a numeric PIN is Number and secure.
Variants§
Text
Free text: the default keyboard, with the platform’s own capitalization and correction.
Name
A person’s name: words capitalized, never corrected.
An email address: the @ keyboard, never capitalized or corrected.
Url
A web address: the URL keyboard, never capitalized or corrected.
Phone
A telephone number: the phone pad.
Number
A whole number: the digit pad.
Decimal
A number with a fractional part: the digit pad with a decimal separator.
Username
An account name: never capitalized or corrected, and offered to the password manager.
Password
An existing password, offered to the password manager for filling.
NewPassword
A password being chosen, so the password manager offers to make and save one.
OneTimeCode
A code sent by message or mail, which the keyboard offers as it arrives. The keyboard stays the text one, since a code can carry letters.
Trait Implementations§
Source§impl Clone for InputPurpose
impl Clone for InputPurpose
Source§fn clone(&self) -> InputPurpose
fn clone(&self) -> InputPurpose
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InputPurpose
Source§impl Debug for InputPurpose
impl Debug for InputPurpose
Source§impl Default for InputPurpose
impl Default for InputPurpose
Source§fn default() -> InputPurpose
fn default() -> InputPurpose
impl Eq for InputPurpose
Source§impl Hash for InputPurpose
impl Hash for InputPurpose
Source§impl PartialEq for InputPurpose
impl PartialEq for InputPurpose
impl StructuralPartialEq for InputPurpose
Auto Trait Implementations§
impl Freeze for InputPurpose
impl RefUnwindSafe for InputPurpose
impl Send for InputPurpose
impl Sync for InputPurpose
impl Unpin for InputPurpose
impl UnsafeUnpin for InputPurpose
impl UnwindSafe for InputPurpose
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> ErasedDestructor for Twhere
T: 'static,
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