Struct tauri_plugin_global_shortcut::GlobalShortcut

source ·
pub struct GlobalShortcut<R: Runtime> { /* private fields */ }

Implementations§

source§

impl<R: Runtime> GlobalShortcut<R>

source

pub fn register<S>(&self, shortcut: S) -> Result<(), Error>

Register a shortcut.

source

pub fn on_shortcut<S, F>(&self, shortcut: S, handler: F) -> Result<(), Error>
where S: TryInto<ShortcutWrapper>, S::Error: Error, F: Fn(&AppHandle<R>, &Shortcut, ShortcutEvent) + Send + Sync + 'static,

Register a shortcut with a handler.

source

pub fn register_all<S, T>(&self, shortcuts: S) -> Result<(), Error>
where S: IntoIterator<Item = T>, T: TryInto<ShortcutWrapper>, T::Error: Error,

Register multiple shortcuts.

source

pub fn on_all_shortcuts<S, T, F>( &self, shortcuts: S, handler: F ) -> Result<(), Error>
where S: IntoIterator<Item = T>, T: TryInto<ShortcutWrapper>, T::Error: Error, F: Fn(&AppHandle<R>, &Shortcut, ShortcutEvent) + Send + Sync + 'static,

Register multiple shortcuts with a handler.

source

pub fn unregister<S: TryInto<ShortcutWrapper>>( &self, shortcut: S ) -> Result<(), Error>
where S::Error: Error,

source

pub fn unregister_all<T: TryInto<ShortcutWrapper>, S: IntoIterator<Item = T>>( &self, shortcuts: S ) -> Result<(), Error>
where T::Error: Error,

source

pub fn is_registered<S: TryInto<ShortcutWrapper>>(&self, shortcut: S) -> bool
where S::Error: Error,

Determines whether the given shortcut is registered by this application or not.

If the shortcut is registered by another application, it will still return false.

Auto Trait Implementations§

§

impl<R> Freeze for GlobalShortcut<R>

§

impl<R> !RefUnwindSafe for GlobalShortcut<R>

§

impl<R> Send for GlobalShortcut<R>

§

impl<R> Sync for GlobalShortcut<R>

§

impl<R> Unpin for GlobalShortcut<R>

§

impl<R> !UnwindSafe for GlobalShortcut<R>

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<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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.