#[non_exhaustive]pub enum ImeContentType {
Normal,
Password,
NoSuggestions,
Terminal,
}Expand description
The event-pass/IME-surface EditingState — see this module’s own docs
for the split against text::EditingState,
frust_text::editor’s distinct, byte-indexed type. ImeContentType is
the input-purpose hint an editable widget publishes on its ImeState so
a shell can lock a secret field’s keyboard down.
What a focused editable holds — the hint a shell maps onto its platform IME. Masking alone
does not stop a soft keyboard showing or learning the text; only this hint does. Shells branch
security on is_secret, never on a _ => arm (the enum is non-exhaustive).
§Platform mapping
| Variant | Android (InputType / EditorInfo.imeOptions) | iOS (UITextInputTraits) | Desktop (winit) |
|---|---|---|---|
Normal | TYPE_CLASS_TEXT | platform defaults | ImePurpose::Normal |
Password | TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD, plus TYPE_TEXT_FLAG_NO_SUGGESTIONS and IME_FLAG_NO_PERSONALIZED_LEARNING | isSecureTextEntry = true, textContentType = .password, autocorrectionType = .no, spellCheckingType = .no, plus smart-punctuation suppression (see Terminal) | ImePurpose::Password |
NoSuggestions | TYPE_CLASS_TEXT | TYPE_TEXT_FLAG_NO_SUGGESTIONS, plus IME_FLAG_NO_PERSONALIZED_LEARNING | autocorrectionType = .no, spellCheckingType = .no, plus smart-punctuation suppression | no equivalent — ImePurpose::Normal |
Terminal | TYPE_CLASS_TEXT | TYPE_TEXT_FLAG_NO_SUGGESTIONS, plus IME_FLAG_NO_PERSONALIZED_LEARNING (same as NoSuggestions) | isSecureTextEntry = false, autocorrectionType = .no, spellCheckingType = .no, smartQuotesType = .no, smartDashesType = .no, smartInsertDeleteType = .no, autocapitalizationType = .none, textContentType = nil | ImePurpose::Terminal |
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal
No hint: platform defaults. What every field publishes unless it opts in.
Password
Secret text: secure entry, with suggestions and personalized learning suppressed.
NoSuggestions
Non-secret text never suggested, autocorrected or learned; no secure entry.
Terminal
Byte-exact entry: NoSuggestions plus no smart punctuation or autocapitalization; unmasked.
Implementations§
Source§impl ImeContentType
impl ImeContentType
Sourcepub fn is_secret(self) -> bool
pub fn is_secret(self) -> bool
Whether the platform must treat the field as secret (secure entry). Both predicates match exhaustively, so a new variant fails to compile until it is classified.
Sourcepub fn suppresses_suggestions(self) -> bool
pub fn suppresses_suggestions(self) -> bool
Whether the platform must suppress suggestions, autocorrect and word learning.
Trait Implementations§
Source§impl Clone for ImeContentType
impl Clone for ImeContentType
Source§fn clone(&self) -> ImeContentType
fn clone(&self) -> ImeContentType
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 ImeContentType
Source§impl Debug for ImeContentType
impl Debug for ImeContentType
Source§impl Default for ImeContentType
impl Default for ImeContentType
Source§fn default() -> ImeContentType
fn default() -> ImeContentType
impl Eq for ImeContentType
Source§impl Hash for ImeContentType
impl Hash for ImeContentType
Source§impl PartialEq for ImeContentType
impl PartialEq for ImeContentType
impl StructuralPartialEq for ImeContentType
Auto Trait Implementations§
impl Freeze for ImeContentType
impl RefUnwindSafe for ImeContentType
impl Send for ImeContentType
impl Sync for ImeContentType
impl Unpin for ImeContentType
impl UnsafeUnpin for ImeContentType
impl UnwindSafe for ImeContentType
Blanket Implementations§
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.