pub struct EffectiveShortcut<'a> {
pub shortcut: &'a Shortcut,
pub primary: Option<KeyStroke>,
pub secondary: Option<KeyStroke>,
pub enabled: bool,
}Expand description
The merged, read-only view of a shortcut with user overrides applied.
Menus, tooltips and dispatch consume this shape. Fields borrow from the registry so the consumer pays no clone cost.
enabled is the snapshot of the shortcut’s enabled_when signal
at construction time — convenient for settings UIs that render
greyed-out rows for currently-inapplicable shortcuts. Dispatch
does not need to inspect it because
ShortcutRegistry::find_by_keystroke already filters disabled
shortcuts out.
Fields§
§shortcut: &'a Shortcut§primary: Option<KeyStroke>§secondary: Option<KeyStroke>§enabled: boolImplementations§
Trait Implementations§
Source§impl<'a> Clone for EffectiveShortcut<'a>
impl<'a> Clone for EffectiveShortcut<'a>
Source§fn clone(&self) -> EffectiveShortcut<'a>
fn clone(&self) -> EffectiveShortcut<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for EffectiveShortcut<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EffectiveShortcut<'a>
impl<'a> !Send for EffectiveShortcut<'a>
impl<'a> !Sync for EffectiveShortcut<'a>
impl<'a> !UnwindSafe for EffectiveShortcut<'a>
impl<'a> Freeze for EffectiveShortcut<'a>
impl<'a> Unpin for EffectiveShortcut<'a>
impl<'a> UnsafeUnpin for EffectiveShortcut<'a>
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
Mutably borrows from an owned value. Read more