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 more