pub struct Binding {
pub key: Key,
pub modifiers: Vec<Key>,
pub trigger: Trigger,
pub priority: i32,
pub display: String,
}Expand description
A single key binding entry.
Fields§
§key: KeyPrimary key required for this binding.
modifiers: Vec<Key>Optional modifier keys that must also be held.
trigger: TriggerWhen to trigger the action.
priority: i32Priority — higher priority bindings shadow lower ones.
display: StringHuman-readable display name (e.g., “Ctrl+S” for display in UI).
Implementations§
Source§impl Binding
impl Binding
pub fn simple(key: Key) -> Self
pub fn held(key: Key) -> Self
pub fn with_modifier(self, modifier: Key) -> Self
pub fn with_priority(self, p: i32) -> Self
pub fn with_display(self, s: impl Into<String>) -> Self
Sourcepub fn matches_held(&self, held: &HashSet<Key>) -> bool
pub fn matches_held(&self, held: &HashSet<Key>) -> bool
Returns true if this binding fires given the held key set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.