pub struct KeybindRegistry { /* private fields */ }Expand description
Registry of all keybinds with conflict resolution.
Implementations§
Source§impl KeybindRegistry
impl KeybindRegistry
pub fn new() -> Self
Sourcepub fn collisions(&self) -> &[KeybindCollision]
pub fn collisions(&self) -> &[KeybindCollision]
Plugin keybinds that were rejected due to collisions. Phase 8 slice 8B.2.
Sourcepub fn clear_collisions(&mut self)
pub fn clear_collisions(&mut self)
Reset the recorded collision list (e.g. before a registry rebuild).
Sourcepub fn register_plugin(
&mut self,
plugin_name: &str,
keybinds: &[ManifestKeybind],
plugin_dir: &Path,
)
pub fn register_plugin( &mut self, plugin_name: &str, keybinds: &[ManifestKeybind], plugin_dir: &Path, )
Register keybinds from a plugin manifest.
Sourcepub fn register_user(&mut self, config_keybinds: &HashMap<String, String>)
pub fn register_user(&mut self, config_keybinds: &HashMap<String, String>)
Register user keybind overrides from config.
Sourcepub fn set_slash_command_key(
&mut self,
slash_command: &str,
new_key: &str,
) -> Result<(), String>
pub fn set_slash_command_key( &mut self, slash_command: &str, new_key: &str, ) -> Result<(), String>
Live-replace the keybind that fires slash_command.
Removes every existing user/plugin bind whose action is the same
slash command, then registers new_key → /slash_command as a User
bind. Used by /settings to hot-swap the sidecar toggle key without
requiring a restart.
Sourcepub fn match_key(
&self,
code: KeyCode,
modifiers: KeyModifiers,
) -> Option<&Keybind>
pub fn match_key( &self, code: KeyCode, modifiers: KeyModifiers, ) -> Option<&Keybind>
Match a key event against registered keybinds. Returns None for core binds (handled by the existing match block).
Sourcepub fn all(&self) -> &[Keybind]
pub fn all(&self) -> &[Keybind]
All registered keybinds (for display in /keybinds and settings).
Sourcepub fn custom_binds(&self) -> Vec<&Keybind>
pub fn custom_binds(&self) -> Vec<&Keybind>
Non-core keybinds only (plugin + user).
Trait Implementations§
Source§impl Clone for KeybindRegistry
impl Clone for KeybindRegistry
Source§fn clone(&self) -> KeybindRegistry
fn clone(&self) -> KeybindRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for KeybindRegistry
impl RefUnwindSafe for KeybindRegistry
impl Send for KeybindRegistry
impl Sync for KeybindRegistry
impl Unpin for KeybindRegistry
impl UnsafeUnpin for KeybindRegistry
impl UnwindSafe for KeybindRegistry
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.