pub struct Command<'a> {
pub description: String,
pub args_info: Vec<String>,
pub handler: Box<Handler<'a>>,
}
Expand description
Single command that can be called in the REPL.
Though it is possible to construct it by manually, it is not advised.
One should rather use the provided command!
macro which will generate
appropriate arguments validation and args_info based on passed specification.
Fields
description: String
Command desctiption that will be displayed in the help message
args_info: Vec<String>
Names and types of arguments to the command
handler: Box<Handler<'a>>
Command handler which should validate arguments and perform command logic
Implementations
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Command<'a>
impl<'a> !Send for Command<'a>
impl<'a> !Sync for Command<'a>
impl<'a> Unpin for Command<'a>
impl<'a> !UnwindSafe for Command<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more