pub struct CommandRegistry { /* private fields */ }Implementations§
Source§impl CommandRegistry
impl CommandRegistry
pub fn new() -> Self
pub fn register<T: Command>(&mut self, command: T) -> &mut Self
pub fn register_boxed(&mut self, command: Box<dyn Command>) -> &mut Self
pub fn initialize(&mut self) -> &mut Self
pub fn find_command(&self, input: &str) -> Option<&dyn Command>
pub fn execute_sync( &self, command: &str, args: &[&str], ) -> Option<Result<String>>
pub async fn execute_async( &self, command: &str, args: &[&str], ) -> Option<Result<String>>
pub fn list_commands(&self) -> Vec<(&str, &str)>
pub fn debug_info(&self) -> String
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more