Skip to main content

InputType

Struct InputType 

Source
pub struct InputType(/* private fields */);
Expand description

Flags specifying the content type of text being input.

Corresponds to the Android SDK InputType API

Implementations§

Source§

impl InputType

Source

pub const TYPE_MASK_CLASS: Self

Mask of bits that determine the overall class of text being given. Currently supported classes are: TYPE_CLASS_TEXT, TYPE_CLASS_NUMBER, TYPE_CLASS_PHONE, TYPE_CLASS_DATETIME. IME authors: If the class is not one you understand, assume TYPE_CLASS_TEXT with NO variation or flags.

Source

pub const TYPE_MASK_VARIATION: Self

Mask of bits that determine the variation of the base content class.

Source

pub const TYPE_MASK_FLAGS: Self

Mask of bits that provide addition bit flags of options.

Source

pub const TYPE_NULL: Self

Special content type for when no explicit type has been specified. This should be interpreted to mean that the target input connection is not rich, it can not process and show things like candidate text nor retrieve the current text, so the input method will need to run in a limited “generate key events” mode, if it supports it. Note that some input methods may not support it, for example a voice-based input method will likely not be able to generate key events even if this flag is set.

Source

pub const TYPE_CLASS_TEXT: Self

Class for normal text. This class supports the following flags (only one of which should be set): TYPE_TEXT_FLAG_CAP_CHARACTERS, TYPE_TEXT_FLAG_CAP_WORDS, and. TYPE_TEXT_FLAG_CAP_SENTENCES. It also supports the following variations: TYPE_TEXT_VARIATION_NORMAL, and TYPE_TEXT_VARIATION_URI. If you do not recognize the variation, normal should be assumed.

Source

pub const TYPE_TEXT_FLAG_CAP_CHARACTERS: Self

Flag for TYPE_CLASS_TEXT: capitalize all characters. Overrides #TYPE_TEXT_FLAG_CAP_WORDS} and #TYPE_TEXT_FLAG_CAP_SENTENCES}. This value is explicitly defined to be the same as TextUtils#CAP_MODE_CHARACTERS}. Of course, this only affects languages where there are upper-case and lower-case letters.

Source

pub const TYPE_TEXT_FLAG_CAP_WORDS: Self

Flag for TYPE_CLASS_TEXT: capitalize the first character of every word. Overrides TYPE_TEXT_FLAG_CAP_SENTENCES. This value is explicitly defined to be the same as TextUtils#CAP_MODE_WORDS. Of course, this only affects languages where there are upper-case and lower-case letters.

Source

pub const TYPE_TEXT_FLAG_CAP_SENTENCES: Self

Flag for TYPE_CLASS_TEXT: capitalize the first character of each sentence. This value is explicitly defined to be the same as TextUtils#CAP_MODE_SENTENCES. For example in English it means to capitalize after a period and a space (note that other languages may have different characters for period, or not use spaces, or use different grammatical rules). Of course, this only affects languages where there are upper-case and lower-case letters.

Source

pub const TYPE_TEXT_FLAG_AUTO_CORRECT: Self

Flag for TYPE_CLASS_TEXT: the user is entering free-form text that should have auto-correction applied to it. Without this flag, the IME will not try to correct typos. You should always set this flag unless you really expect users to type non-words in this field, for example to choose a name for a character in a game. Contrast this with TYPE_TEXT_FLAG_AUTO_COMPLETE and TYPE_TEXT_FLAG_NO_SUGGESTIONS: TYPE_TEXT_FLAG_AUTO_CORRECT means that the IME will try to auto-correct typos as the user is typing, but does not define whether the IME offers an interface to show suggestions.

Source

pub const TYPE_TEXT_FLAG_AUTO_COMPLETE: Self

Flag for TYPE_CLASS_TEXT: the text editor (which means the application) is performing auto-completion of the text being entered based on its own semantics, which it will present to the user as they type. This generally means that the input method should not be showing candidates itself, but can expect the editor to supply its own completions/candidates from android.view.inputmethod.InputMethodSession#displayCompletions InputMethodSession.displayCompletions()} as a result of the editor calling android.view.inputmethod.InputMethodManager#displayCompletions InputMethodManager.displayCompletions()}. Note the contrast with TYPE_TEXT_FLAG_AUTO_CORRECT and TYPE_TEXT_FLAG_NO_SUGGESTIONS: TYPE_TEXT_FLAG_AUTO_COMPLETE means the editor should show an interface for displaying suggestions, but instead of supplying its own it will rely on the Editor to pass completions/corrections.

Source

pub const TYPE_TEXT_FLAG_MULTI_LINE: Self

Flag for TYPE_CLASS_TEXT: multiple lines of text can be entered into the field. If this flag is not set, the text field will be constrained to a single line. The IME may also choose not to display an enter key when this flag is not set, as there should be no need to create new lines.

Source

pub const TYPE_TEXT_FLAG_IME_MULTI_LINE: Self

Flag for TYPE_CLASS_TEXT: the regular text view associated with this should not be multi-line, but when a fullscreen input method is providing text it should use multiple lines if it can.

Source

pub const TYPE_TEXT_FLAG_NO_SUGGESTIONS: Self

Flag for TYPE_CLASS_TEXT: the input method does not need to display any dictionary-based candidates. This is useful for text views that do not contain words from the language and do not benefit from any dictionary-based completions or corrections. It overrides the TYPE_TEXT_FLAG_AUTO_CORRECT value when set. Please avoid using this unless you are certain this is what you want. Many input methods need suggestions to work well, for example the ones based on gesture typing. Consider clearing TYPE_TEXT_FLAG_AUTO_CORRECT instead if you just do not want the IME to correct typos. Note the contrast with TYPE_TEXT_FLAG_AUTO_CORRECT and TYPE_TEXT_FLAG_AUTO_COMPLETE: TYPE_TEXT_FLAG_NO_SUGGESTIONS means the IME does not need to show an interface to display suggestions. Most IMEs will also take this to mean they do not need to try to auto-correct what the user is typing.

Source

pub const TYPE_TEXT_FLAG_ENABLE_TEXT_CONVERSION_SUGGESTIONS: Self

Flag for TYPE_CLASS_TEXT: Let the IME know the text conversion suggestions are required by the application. Text conversion suggestion is for the transliteration languages which has pronunciation characters and target characters. When the user is typing the pronunciation charactes, the IME could provide the possible target characters to the user. When this flag is set, the IME should insert the text conversion suggestions through Builder#setTextConversionSuggestions(List)} and the TextAttribute} with initialized with the text conversion suggestions is provided by the IME to the application. To receive the additional information, the application needs to implement InputConnection#setComposingText(CharSequence, int, TextAttribute)}, InputConnection#setComposingRegion(int, int, TextAttribute)}, and InputConnection#commitText(CharSequence, int, TextAttribute)}.

Source

pub const TYPE_TEXT_FLAG_ENABLE_TEXT_SUGGESTION_SELECTED: Self

Flag for TYPE_CLASS_TEXT: Let the IME know that conversion candidate selection information is requested by the application. Text conversion suggestion is for the transliteration languages, which have the notions of pronunciation and target characters. When the user actively selects a candidate from the conversion suggestions, notifying when candidate selection is occurring helps assistive technologies generate more effective feedback. When this flag is set, and there is an active selected suggestion, the IME should set that a conversion suggestion is selected when initializing the TextAttribute. To receive this information, the application should implement InputConnection.setComposingText(CharSequence, int, TextAttribute), InputConnection.setComposingRegion(int, int, TextAttribute), and InputConnection.commitText(CharSequence, int, TextAttribute)

Source

pub const TYPE_TEXT_VARIATION_NORMAL: Self

Default variation of TYPE_CLASS_TEXT: plain old normal text.

Source

pub const TYPE_TEXT_VARIATION_URI: Self

Variation of TYPE_CLASS_TEXT: entering a URI.

Source

pub const TYPE_TEXT_VARIATION_EMAIL_ADDRESS: Self

Variation of TYPE_CLASS_TEXT: entering an e-mail address.

Source

pub const TYPE_TEXT_VARIATION_EMAIL_SUBJECT: Self

Variation of TYPE_CLASS_TEXT: entering the subject line of an e-mail.

Source

pub const TYPE_TEXT_VARIATION_SHORT_MESSAGE: Self

Variation of TYPE_CLASS_TEXT: entering a short, possibly informal message such as an instant message or a text message.

Source

pub const TYPE_TEXT_VARIATION_LONG_MESSAGE: Self

Variation of TYPE_CLASS_TEXT: entering the content of a long, possibly formal message such as the body of an e-mail.

Source

pub const TYPE_TEXT_VARIATION_PERSON_NAME: Self

Variation of TYPE_CLASS_TEXT: entering the name of a person.

Source

pub const TYPE_TEXT_VARIATION_POSTAL_ADDRESS: Self

Variation of TYPE_CLASS_TEXT: entering a postal mailing address.

Source

pub const TYPE_TEXT_VARIATION_PASSWORD: Self

Variation of TYPE_CLASS_TEXT: entering a password.

Source

pub const TYPE_TEXT_VARIATION_VISIBLE_PASSWORD: Self

Variation of TYPE_CLASS_TEXT: entering a password, which should be visible to the user.

Source

pub const TYPE_TEXT_VARIATION_WEB_EDIT_TEXT: Self

Variation of TYPE_CLASS_TEXT: entering text inside of a web form.

Source

pub const TYPE_TEXT_VARIATION_FILTER: Self

Variation of TYPE_CLASS_TEXT: entering text to filter contents of a list etc.

Source

pub const TYPE_TEXT_VARIATION_PHONETIC: Self

Variation of TYPE_CLASS_TEXT: entering text for phonetic pronunciation, such as a phonetic name field in contacts. This is mostly useful for languages where one spelling may have several phonetic readings, like Japanese.

Source

pub const TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS: Self

Variation of TYPE_CLASS_TEXT: entering e-mail address inside of a web form. This was added in android.os.Build.VERSION_CODES#HONEYCOMB}. An IME must target this API version or later to see this input type; if it doesn’t, a request for this type will be seen as #TYPE_TEXT_VARIATION_EMAIL_ADDRESS} when passed through android.view.inputmethod.EditorInfo#makeCompatible(int) EditorInfo.makeCompatible(int)}.

Source

pub const TYPE_TEXT_VARIATION_WEB_PASSWORD: Self

Variation of TYPE_CLASS_TEXT: entering password inside of a web form. This was added in android.os.Build.VERSION_CODES#HONEYCOMB}. An IME must target this API version or later to see this input type; if it doesn’t, a request for this type will be seen as #TYPE_TEXT_VARIATION_PASSWORD} when passed through android.view.inputmethod.EditorInfo#makeCompatible(int) EditorInfo.makeCompatible(int)}.

Source

pub const TYPE_CLASS_NUMBER: Self

Class for numeric text. This class supports the following flags: #TYPE_NUMBER_FLAG_SIGNED} and #TYPE_NUMBER_FLAG_DECIMAL}. It also supports the following variations: #TYPE_NUMBER_VARIATION_NORMAL} and #TYPE_NUMBER_VARIATION_PASSWORD}.

IME authors: If you do not recognize the variation, normal should be assumed.

Source

pub const TYPE_NUMBER_FLAG_SIGNED: Self

Flag of TYPE_CLASS_NUMBER: the number is signed, allowing a positive or negative sign at the start.

Source

pub const TYPE_NUMBER_FLAG_DECIMAL: Self

Flag of TYPE_CLASS_NUMBER: the number is decimal, allowing a decimal point to provide fractional values.

Source

pub const TYPE_NUMBER_VARIATION_NORMAL: Self

Default variation of TYPE_CLASS_NUMBER: plain normal numeric text. This was added in android.os.Build.VERSION_CODES#HONEYCOMB}. An IME must target this API version or later to see this input type; if it doesn’t, a request for this type will be dropped when passed through android.view.inputmethod.EditorInfo#makeCompatible(int) EditorInfo.makeCompatible(int)}.

Source

pub const TYPE_NUMBER_VARIATION_PASSWORD: Self

Variation of TYPE_CLASS_NUMBER: entering a numeric password. This was added in android.os.Build.VERSION_CODES#HONEYCOMB}. An IME must target this API version or later to see this input type; if it doesn’t, a request for this type will be dropped when passed through android.view.inputmethod.EditorInfo#makeCompatible(int) EditorInfo.makeCompatible(int)}.

Source

pub const TYPE_CLASS_PHONE: Self

Class for a phone number. This class currently supports no variations or flags.

Source

pub const TYPE_CLASS_DATETIME: Self

Class for dates and times. It supports the following variations: #TYPE_DATETIME_VARIATION_NORMAL} #TYPE_DATETIME_VARIATION_DATE}, and #TYPE_DATETIME_VARIATION_TIME}.

Source

pub const TYPE_DATETIME_VARIATION_NORMAL: Self

Default variation of #TYPE_CLASS_DATETIME}: allows entering both a date and time.

Source

pub const TYPE_DATETIME_VARIATION_DATE: Self

Default variation of #TYPE_CLASS_DATETIME}: allows entering only a date.

Source

pub const TYPE_DATETIME_VARIATION_TIME: Self

Default variation of #TYPE_CLASS_DATETIME}: allows entering only a time.

Source§

impl InputType

Source

pub const fn empty() -> Self

Get a flags value with all bits unset.

Source

pub const fn all() -> Self

Get a flags value with all known bits set.

Source

pub const fn bits(&self) -> u32

Get the underlying bits value.

The returned value is exactly the bits set in this flags value.

Source

pub const fn from_bits(bits: u32) -> Option<Self>

Convert from a bits value.

This method will return None if any unknown bits are set.

Source

pub const fn from_bits_truncate(bits: u32) -> Self

Convert from a bits value, unsetting any unknown bits.

Source

pub const fn from_bits_retain(bits: u32) -> Self

Convert from a bits value exactly.

Source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

This method will return None if name is empty or doesn’t correspond to any named flag.

Source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

Source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

Source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

Source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

Source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

Source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. remove won’t truncate other, but the ! operator will.

Source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

Source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

Source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

Source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

Source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. difference won’t truncate other, but the ! operator will.

Source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

Source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

Source§

impl InputType

Source

pub const fn iter(&self) -> Iter<InputType>

Yield a set of contained flags values.

Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.

Source

pub const fn iter_names(&self) -> IterNames<InputType>

Yield a set of contained named flags values.

This method is like iter, except only yields bits in contained named flags. Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

Source§

impl InputType

Source

pub fn class(&self) -> InputTypeClass

Extract just the class of the input type.

Trait Implementations§

Source§

impl Binary for InputType

Source§

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

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

impl BitAnd for InputType

Source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

Source§

type Output = InputType

The resulting type after applying the & operator.
Source§

impl BitAndAssign for InputType

Source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

Source§

impl BitOr for InputType

Source§

fn bitor(self, other: InputType) -> Self

The bitwise or (|) of the bits in two flags values.

Source§

type Output = InputType

The resulting type after applying the | operator.
Source§

impl BitOrAssign for InputType

Source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

Source§

impl BitXor for InputType

Source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

Source§

type Output = InputType

The resulting type after applying the ^ operator.
Source§

impl BitXorAssign for InputType

Source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

Source§

impl Clone for InputType

Source§

fn clone(&self) -> InputType

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for InputType

Source§

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

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

impl Extend<InputType> for InputType

Source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Flags for InputType

Source§

const FLAGS: &'static [Flag<InputType>]

The set of defined flags.
Source§

type Bits = u32

The underlying bits type.
Source§

fn bits(&self) -> u32

Get the underlying bits value. Read more
Source§

fn from_bits_retain(bits: u32) -> InputType

Convert from a bits value exactly.
Source§

fn empty() -> Self

Get a flags value with all bits unset.
Source§

fn all() -> Self

Get a flags value with all known bits set.
Source§

fn known_bits(&self) -> Self::Bits

Get the known bits from a flags value.
Source§

fn unknown_bits(&self) -> Self::Bits

Get the unknown bits from a flags value.
Source§

fn contains_unknown_bits(&self) -> bool

This method will return true if any unknown bits are set.
Source§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
Source§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
Source§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
Source§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
Source§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
Source§

fn iter_defined_names() -> IterDefinedNames<Self>

Yield a set of all named flags defined by Self::FLAGS.
Source§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
Source§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
Source§

fn intersects(&self, other: Self) -> bool
where Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
Source§

fn contains(&self, other: Self) -> bool
where Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
Source§

fn truncate(&mut self)
where Self: Sized,

Remove any unknown bits from the flags.
Source§

fn insert(&mut self, other: Self)
where Self: Sized,

The bitwise or (|) of the bits in two flags values.
Source§

fn remove(&mut self, other: Self)
where Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
Source§

fn toggle(&mut self, other: Self)
where Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
Source§

fn set(&mut self, other: Self, value: bool)
where Self: Sized,

Call Flags::insert when value is true or Flags::remove when value is false.
Source§

fn clear(&mut self)
where Self: Sized,

Unsets all bits in the flags.
Source§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
Source§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
Source§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
Source§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
Source§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§

impl FromIterator<InputType> for InputType

Source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

Source§

impl Hash for InputType

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 IntoIterator for InputType

Source§

type Item = InputType

The type of the elements being iterated over.
Source§

type IntoIter = Iter<InputType>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl LowerHex for InputType

Source§

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

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

impl Not for InputType

Source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

Source§

type Output = InputType

The resulting type after applying the ! operator.
Source§

impl Octal for InputType

Source§

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

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

impl PartialEq for InputType

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PublicFlags for InputType

Source§

type Primitive = u32

The type of the underlying storage.
Source§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
Source§

impl Sub for InputType

Source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. difference won’t truncate other, but the ! operator will.

Source§

type Output = InputType

The resulting type after applying the - operator.
Source§

impl SubAssign for InputType

Source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. difference won’t truncate other, but the ! operator will.

Source§

impl UpperHex for InputType

Source§

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

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

impl Copy for InputType

Source§

impl Eq for InputType

Source§

impl StructuralPartialEq for InputType

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<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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.