pub struct Accelerator { /* private fields */ }Expand description
A keyboard shortcut that consists of an optional combination
of modifier keys (provided by Modifiers and
one key (Code).
§Warning
This struct cannot represent all shortcuts found on non-U.S. keyboard layouts and might
be deprecated in the future.
Please use KeyAccelerator instead.
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
Trait Implementations§
Source§impl Clone for Accelerator
impl Clone for Accelerator
Source§fn clone(&self) -> Accelerator
fn clone(&self) -> Accelerator
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 Copy for Accelerator
Source§impl Debug for Accelerator
impl Debug for Accelerator
impl Eq for Accelerator
Source§impl From<Accelerator> for KeyAccelerator
impl From<Accelerator> for KeyAccelerator
Source§fn from(accel: Accelerator) -> KeyAccelerator
fn from(accel: Accelerator) -> KeyAccelerator
Converts to this type from the input type.
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
impl StructuralPartialEq 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.
Auto Trait Implementations§
impl Freeze for Accelerator
impl RefUnwindSafe for Accelerator
impl Send for Accelerator
impl Sync for Accelerator
impl Unpin for Accelerator
impl UnsafeUnpin 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