Enum ImePurpose
#[non_exhaustive]pub enum ImePurpose {
Normal,
Password,
Terminal,
Number,
Phone,
Url,
Email,
Pin,
Date,
Time,
DateTime,
}Expand description
Generic IME purposes for use in Window::set_ime_purpose.
The purpose should reflect the kind of data to be entered. The purpose may improve UX by optimizing the IME for the specific use case, for example showing relevant characters and hiding unneeded ones, or changing the icon of the confirmation button, if winit can express the purpose to the platform and the platform reacts accordingly.
§Platform-specific
- iOS / Android / Web / Windows / X11 / macOS / Orbital: Unsupported.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal
No special purpose for the IME (default).
Password
The IME is used for password input. The IME will treat the contents as sensitive.
Terminal
The IME is used to input into a terminal.
For example, that could alter OSK on Wayland to show extra buttons.
Number
Number (including decimal separator and sign)
Phone
Phone number
Url
URL
Email address
Pin
Password composed only of digits (treated as sensitive data)
Date
Date
Time
Time
DateTime
Date and time
Trait Implementations§
§impl Clone for ImePurpose
impl Clone for ImePurpose
§fn clone(&self) -> ImePurpose
fn clone(&self) -> ImePurpose
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ImePurpose
impl Debug for ImePurpose
§impl Default for ImePurpose
impl Default for ImePurpose
§fn default() -> ImePurpose
fn default() -> ImePurpose
§impl<'de> Deserialize<'de> for ImePurpose
impl<'de> Deserialize<'de> for ImePurpose
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImePurpose, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImePurpose, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Hash for ImePurpose
impl Hash for ImePurpose
§impl PartialEq for ImePurpose
impl PartialEq for ImePurpose
§impl Serialize for ImePurpose
impl Serialize for ImePurpose
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ImePurpose
impl Eq for ImePurpose
impl StructuralPartialEq for ImePurpose
Auto Trait Implementations§
impl Freeze for ImePurpose
impl RefUnwindSafe for ImePurpose
impl Send for ImePurpose
impl Sync for ImePurpose
impl Unpin for ImePurpose
impl UnwindSafe for ImePurpose
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
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.