pub struct ShortcutSerialization { /* private fields */ }Expand description
A class used by MenuSerializableShortcut to describe the shortcut for serialization to
send to the platform for rendering a PlatformMenuBar.
Implementations§
Source§impl ShortcutSerialization
impl ShortcutSerialization
Sourcepub fn character(
character: impl Into<String>,
alt: bool,
control: bool,
meta: bool,
) -> ShortcutSerialization
pub fn character( character: impl Into<String>, alt: bool, control: bool, meta: bool, ) -> ShortcutSerialization
Creates a ShortcutSerialization representing a single character.
This is used by a CharacterActivator to serialize itself.
Sourcepub fn modifier(
trigger: LogicalKeyboardKey,
alt: bool,
control: bool,
meta: bool,
shift: bool,
) -> ShortcutSerialization
pub fn modifier( trigger: LogicalKeyboardKey, alt: bool, control: bool, meta: bool, shift: bool, ) -> ShortcutSerialization
Creates a ShortcutSerialization representing a specific LogicalKeyboardKey and
modifiers.
This is used by a SingleActivator to serialize itself.
Sourcepub fn trigger(&self) -> Option<LogicalKeyboardKey>
pub fn trigger(&self) -> Option<LogicalKeyboardKey>
The keyboard key that triggers this shortcut, if any.
Sourcepub fn character_value(&self) -> Option<&str>
pub fn character_value(&self) -> Option<&str>
The character that triggers this shortcut, if any.
Sourcepub fn alt(&self) -> Option<bool>
pub fn alt(&self) -> Option<bool>
If this shortcut has a trigger, this indicates whether or not the alt
modifier needs to be down or not.
Sourcepub fn control(&self) -> Option<bool>
pub fn control(&self) -> Option<bool>
If this shortcut has a trigger, this indicates whether or not the
control modifier needs to be down or not.
Sourcepub fn meta(&self) -> Option<bool>
pub fn meta(&self) -> Option<bool>
If this shortcut has a trigger, this indicates whether or not the meta
(also known as the Windows or Command key) modifier needs to be down or not.
Sourcepub fn shift(&self) -> Option<bool>
pub fn shift(&self) -> Option<bool>
If this shortcut has a trigger, this indicates whether or not the shift
modifier needs to be down or not.
Converts the internal representation to the shortcut a menu item carries to the platform.
Trait Implementations§
Source§impl Clone for ShortcutSerialization
impl Clone for ShortcutSerialization
Source§impl Debug for ShortcutSerialization
impl Debug for ShortcutSerialization
impl Eq for ShortcutSerialization
Source§impl PartialEq for ShortcutSerialization
impl PartialEq for ShortcutSerialization
impl StructuralPartialEq for ShortcutSerialization
Auto Trait Implementations§
impl Forget for ShortcutSerialization
impl Freeze for ShortcutSerialization
impl Move for ShortcutSerialization
impl RefUnwindSafe for ShortcutSerialization
impl Send for ShortcutSerializationwhere
RawVecInner: Send,
impl Sync for ShortcutSerializationwhere
RawVecInner: Sync,
impl Unpin for ShortcutSerialization
impl UnsafeUnpin for ShortcutSerialization
impl UnwindSafe for ShortcutSerializationwhere
RawVecInner: UnwindSafe,
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<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<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.