pub struct KeybindingRegistry { /* private fields */ }Expand description
Registry for extension-provided keybindings.
Implementations§
Source§impl KeybindingRegistry
impl KeybindingRegistry
Sourcepub fn register_keybinding(&mut self, def: KeybindingDefinition) -> Result<()>
pub fn register_keybinding(&mut self, def: KeybindingDefinition) -> Result<()>
Registers a keybinding.
Returns an error if a keybinding with the same key is already registered.
Sourcepub fn unregister_keybinding(&mut self, key: &str) -> Result<()>
pub fn unregister_keybinding(&mut self, key: &str) -> Result<()>
Unregisters a keybinding by key.
Returns an error if the keybinding is not found.
Sourcepub fn get_keybinding(&self, key: &str) -> Option<&KeybindingDefinition>
pub fn get_keybinding(&self, key: &str) -> Option<&KeybindingDefinition>
Gets a keybinding definition by key.
Sourcepub fn list_keybindings(&self) -> Vec<&KeybindingDefinition>
pub fn list_keybindings(&self) -> Vec<&KeybindingDefinition>
Lists all registered keybindings.
Sourcepub fn execute_keybinding(&self, key: &str) -> Result<()>
pub fn execute_keybinding(&self, key: &str) -> Result<()>
Executes a keybinding handler by key.
Returns an error if the keybinding is not found or execution fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeybindingRegistry
impl !RefUnwindSafe for KeybindingRegistry
impl Send for KeybindingRegistry
impl Sync for KeybindingRegistry
impl Unpin for KeybindingRegistry
impl !UnwindSafe for KeybindingRegistry
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