pub struct Accelerator { /* private fields */ }
Expand description
Implementations§
Source§impl Accelerator
impl Accelerator
Sourcepub fn new(mods: Option<Modifiers>, key: Code) -> Accelerator
pub fn new(mods: Option<Modifiers>, key: Code) -> Accelerator
Creates a new accelerator to define keyboard shortcuts throughout your application.
Only Modifiers::ALT
, Modifiers::SHIFT
, Modifiers::CONTROL
, and Modifiers::SUPER
Source§impl Accelerator
impl Accelerator
Sourcepub fn key_equivalent(self) -> Result<String, AcceleratorParseError>
pub fn key_equivalent(self) -> Result<String, AcceleratorParseError>
Return the string value of this hotkey, without modifiers.
Returns the empty string if no key equivalent is known.
Sourcepub fn key_modifier_mask(self) -> NSEventModifierFlags
pub fn key_modifier_mask(self) -> NSEventModifierFlags
Return the modifiers of this hotkey, as an NSEventModifierFlags bitflag.
Trait Implementations§
Source§impl Clone for Accelerator
impl Clone for Accelerator
Source§fn clone(&self) -> Accelerator
fn clone(&self) -> Accelerator
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Accelerator
impl Debug for Accelerator
Source§impl FromStr for Accelerator
impl FromStr for Accelerator
Source§type Err = AcceleratorParseError
type Err = AcceleratorParseError
The associated error which can be returned from parsing.
Source§fn from_str(
accelerator_string: &str,
) -> Result<Accelerator, <Accelerator as FromStr>::Err>
fn from_str( accelerator_string: &str, ) -> Result<Accelerator, <Accelerator as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl Hash for Accelerator
impl Hash for Accelerator
Source§impl PartialEq for Accelerator
impl PartialEq for Accelerator
Source§impl TryFrom<&str> for Accelerator
impl TryFrom<&str> for Accelerator
Source§type Error = AcceleratorParseError
type Error = AcceleratorParseError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<Accelerator, <Accelerator as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<Accelerator, <Accelerator as TryFrom<&str>>::Error>
Performs the conversion.
Source§impl TryFrom<String> for Accelerator
impl TryFrom<String> for Accelerator
Source§type Error = AcceleratorParseError
type Error = AcceleratorParseError
The type returned in the event of a conversion error.
Source§fn try_from(
value: String,
) -> Result<Accelerator, <Accelerator as TryFrom<String>>::Error>
fn try_from( value: String, ) -> Result<Accelerator, <Accelerator as TryFrom<String>>::Error>
Performs the conversion.
impl Copy for Accelerator
impl Eq for Accelerator
impl StructuralPartialEq for Accelerator
Auto Trait Implementations§
impl Freeze for Accelerator
impl RefUnwindSafe for Accelerator
impl Send for Accelerator
impl Sync for Accelerator
impl Unpin for Accelerator
impl UnwindSafe for Accelerator
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