pub struct CommandRegistry { /* private fields */ }
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
pub fn new() -> Self
pub fn register<H: CommandHandler + 'static>(&mut self, handler: H)
pub fn register_method( &mut self, method: String, handler: Box<dyn CommandHandler + Send + Sync>, )
pub fn get(&self, name: &str) -> Option<&Box<dyn CommandHandler>>
pub fn handle_command( &self, method: &str, params: Option<&Value>, id: Option<&Value>, ) -> HandlerResult
Auto Trait Implementations§
impl Freeze for CommandRegistry
impl !RefUnwindSafe for CommandRegistry
impl Send for CommandRegistry
impl Sync for CommandRegistry
impl Unpin for CommandRegistry
impl !UnwindSafe 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