pub enum AutofillHint {
Show 19 variants
Username,
NewUsername,
Password,
NewPassword,
OneTimeCode,
Email,
Name,
GivenName,
FamilyName,
TelephoneNumber,
StreetAddress,
PostalAddress,
PostalCode,
AddressCity,
AddressState,
CountryName,
CreditCardNumber,
CreditCardExpirationDate,
CreditCardSecurityCode,
}Expand description
What a field is for: what an autofill service should put in it, and what it should learn from it when the form is submitted.
The catalogue is the useful part of the platform’s, not all of it: what a sign-in, a sign-up, an address and a card payment need. A hint the list does not carry is a hint to add here, with its platform name and a test.
Variants§
Username
The account’s name — an email address often plays this part as well.
NewUsername
A username being created, so that the service offers to save it rather than to fill it.
Password
An existing password, to be filled.
NewPassword
A password being created: never filled from what is saved, and offered for saving once the form is submitted.
OneTimeCode
A one-time code, usually arriving by SMS. The platform offers it above the keyboard, which is what saves the reader leaving the application to go and read it.
An email address.
Name
A person’s whole name.
GivenName
The given (first) name alone.
FamilyName
The family (last) name alone.
TelephoneNumber
A telephone number.
StreetAddress
The street part of an address — the lines above the town.
PostalAddress
A whole postal address in one field.
PostalCode
The postal code.
AddressCity
The town or city.
AddressState
The state, region or county.
CountryName
The country.
CreditCardNumber
A payment card’s number.
CreditCardExpirationDate
Its expiry date, as one field.
CreditCardSecurityCode
Its security code (CVC).
Implementations§
Source§impl AutofillHint
impl AutofillHint
Sourcepub const fn android(self) -> &'static str
pub const fn android(self) -> &'static str
The string Android’s autofill services expect for this hint.
Several are not what the hint is called: personName, emailAddress,
phoneNumber, addressLocality for a town, addressRegion for a state,
addressCountry for a country, smsOTPCode for a one-time code.
Sourcepub const fn is_secret(self) -> bool
pub const fn is_secret(self) -> bool
Is what this field holds a secret, so that it must never be shown in a screenshot of the structure, nor learned by a keyboard?
The field’s KeyboardType already stops the keyboard
learning it; this is the same question asked of the hint, for the paths that
only ever see one — reporting a value to the autofill service, above all.