Skip to main content

AutofillHint

Enum AutofillHint 

Source
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.

§

Email

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

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for AutofillHint

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AutofillHint

Source§

impl Debug for AutofillHint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AutofillHint

Source§

impl Hash for AutofillHint

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AutofillHint

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AutofillHint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.