pub struct Modifier { /* private fields */ }Expand description
The modifier settings for an Item when a modifier key is pressed.
Implementations§
Source§impl Modifier
impl Modifier
Sourcepub fn new_multi(keys: impl IntoIterator<Item = Key>) -> Self
pub fn new_multi(keys: impl IntoIterator<Item = Key>) -> Self
Create a new modifier with multiple keys.
§Examples
let m = Modifier::new_multi([Key::Command, Key::Option]);Sourcepub fn subtitle(self, subtitle: impl Into<String>) -> Self
pub fn subtitle(self, subtitle: impl Into<String>) -> Self
The subtitle for when this modifier is activated.
Sourcepub fn valid(self, valid: bool) -> Self
pub fn valid(self, valid: bool) -> Self
Whether this item is valid when the modifier is activated.
Sourcepub fn variables<K, V>(
self,
variables: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn variables<K, V>( self, variables: impl IntoIterator<Item = (K, V)>, ) -> Self
Override the variables when the item is actioned with this modifier.
See Output::variables for more information.
-
If not set, inherits the item variables.
-
If set, overrides the item’s variables.
let m = Modifier::new(Key::Command).variables([("key1", "value1")]); -
If set to an empty object, no variables are passed out.
let m = Modifier::new(Key::Command).variables::<&str, &str>([]);
Trait Implementations§
impl Eq for Modifier
impl StructuralPartialEq for Modifier
Auto Trait Implementations§
impl Freeze for Modifier
impl RefUnwindSafe for Modifier
impl Send for Modifier
impl Sync for Modifier
impl Unpin for Modifier
impl UnwindSafe for Modifier
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