pub trait ModifiersExt {
// Required methods
fn ctrl_or_meta() -> Modifiers;
fn ctrl_or_alt() -> Modifiers;
}Expand description
Extension trait for Modifiers adding OS-aware helpers.
Required Methods§
Sourcefn ctrl_or_meta() -> Modifiers
fn ctrl_or_meta() -> Modifiers
Returns the platform’s command modifier.
Maps to Modifiers::META (Command) on macOS and to Modifiers::CONTROL
on every other platform. Useful to express shortcuts like copy, paste or
select-all once and have them work natively on every OS.
Sourcefn ctrl_or_alt() -> Modifiers
fn ctrl_or_alt() -> Modifiers
Returns the platform’s word navigation modifier.
Maps to Modifiers::ALT (Option) on macOS and to Modifiers::CONTROL
on every other platform. Used for word-wise cursor movement and deletion.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".