pub struct CommandRegistry { /* private fields */ }Implementations§
Source§impl CommandRegistry
impl CommandRegistry
pub fn new() -> Self
pub fn register( &self, id: impl Into<String>, title: impl Into<String>, category: impl Into<String>, shortcut: Option<impl Into<String>>, action: impl Fn() + 'static, )
pub fn run(&self, id: &str) -> bool
pub fn search(&self, query: &str) -> Vec<Command>
pub fn categories(&self) -> Vec<String>
pub fn commands_in(&self, category: &str) -> Vec<Command>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for CommandRegistry
impl Clone for CommandRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for CommandRegistry
impl !Send for CommandRegistry
impl !Sync for CommandRegistry
impl !UnwindSafe for CommandRegistry
impl Freeze for CommandRegistry
impl Unpin for CommandRegistry
impl UnsafeUnpin for CommandRegistry
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