Skip to main content

ShortcutRegistryEntry

Struct ShortcutRegistryEntry 

Source
pub struct ShortcutRegistryEntry { /* private fields */ }
Expand description

An entry returned by ShortcutRegistry::add_all that allows the caller to identify the shortcuts they registered with the ShortcutRegistry through the ShortcutRegistrar.

When the entry is no longer needed, dispose should be called, and the entry should no longer be used.

Implementations§

Source§

impl ShortcutRegistryEntry

Source

pub fn registry(self: Handle<Self>, app: &App) -> Handle<ShortcutRegistry>

The ShortcutRegistry that this entry was issued by.

Source

pub fn replace_all(self: Handle<Self>, app: &mut App, value: ShortcutMap)

Replaces the given shortcut bindings in the ShortcutRegistry that this entry was created from.

It will assert if this entry has already been disposed.

If two equivalent, but different, ShortcutActivators are added, all of them will be executed when triggered.

Source

pub fn dispose(self: Handle<Self>, app: &mut App)

Called when the entry is no longer needed.

Calling this will remove all shortcuts associated with this ShortcutRegistryEntry from the registry.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>