Struct wry::application::accelerator::Accelerator
source · [−]pub struct Accelerator { /* private fields */ }
Expand description
Base Accelerator
functions.
Implementations
sourceimpl Accelerator
impl Accelerator
sourcepub fn new(mods: impl Into<Option<ModifiersState>>, key: KeyCode) -> Accelerator
pub fn new(mods: impl Into<Option<ModifiersState>>, key: KeyCode) -> Accelerator
Creates a new accelerator to define keyboard shortcuts throughout your application.
sourcepub fn with_id(self, id: AcceleratorId) -> Accelerator
pub fn with_id(self, id: AcceleratorId) -> Accelerator
Assign a custom accelerator id.
sourcepub fn id(self) -> AcceleratorId
pub fn id(self) -> AcceleratorId
Returns an identifier unique to the accelerator.
sourcepub fn matches(
&self,
modifiers: impl Borrow<ModifiersState>,
key: impl Borrow<KeyCode>
) -> bool
pub fn matches(
&self,
modifiers: impl Borrow<ModifiersState>,
key: impl Borrow<KeyCode>
) -> bool
Returns true
if this KeyCode
and ModifiersState
matches this Accelerator
.
Trait Implementations
sourceimpl Clone for Accelerator
impl Clone for Accelerator
sourcepub fn clone(&self) -> Accelerator
pub fn clone(&self) -> Accelerator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Accelerator
impl Debug for Accelerator
sourceimpl FromStr for Accelerator
impl FromStr for Accelerator
type Err = AcceleratorParseError
type Err = AcceleratorParseError
The associated error which can be returned from parsing.
sourcepub fn from_str(
accelerator_string: &str
) -> Result<Accelerator, <Accelerator as FromStr>::Err>
pub fn from_str(
accelerator_string: &str
) -> Result<Accelerator, <Accelerator as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
sourceimpl Hash for Accelerator
impl Hash for Accelerator
sourceimpl PartialEq<Accelerator> for Accelerator
impl PartialEq<Accelerator> for Accelerator
sourcepub fn eq(&self, other: &Accelerator) -> bool
pub fn eq(&self, other: &Accelerator) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &Accelerator) -> bool
pub fn ne(&self, other: &Accelerator) -> bool
This method tests for !=
.
impl StructuralPartialEq for Accelerator
Auto Trait Implementations
impl RefUnwindSafe for Accelerator
impl Send for Accelerator
impl Sync for Accelerator
impl Unpin for Accelerator
impl UnwindSafe for Accelerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more