pub struct Command<Context, E> { /* private fields */ }
Expand description
Struct to define a command in the REPL
Implementations§
source§impl<Context, E> Command<Context, E>
impl<Context, E> Command<Context, E>
sourcepub fn new(name: &str, callback: Callback<Context, E>) -> Self
pub fn new(name: &str, callback: Callback<Context, E>) -> Self
Create a new command with the given name and callback function
sourcepub fn with_parameter(self, parameter: Parameter) -> Result<Command<Context, E>>
pub fn with_parameter(self, parameter: Parameter) -> Result<Command<Context, E>>
Add a parameter to the command. The order of the parameters is the same as the order in which this is called for each parameter.
Trait Implementations§
Auto Trait Implementations§
impl<Context, E> RefUnwindSafe for Command<Context, E>
impl<Context, E> Send for Command<Context, E>
impl<Context, E> Sync for Command<Context, E>
impl<Context, E> Unpin for Command<Context, E>
impl<Context, E> UnwindSafe for Command<Context, E>
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