pub struct Command {
pub name: String,
pub description: String,
pub exec: Box<dyn Fn(&[String], &[Command]) -> Result<(), CommandError>>,
}Expand description
Represents an executable command
Fields§
§name: StringThis field represents the name of the command that the user will call
description: StringA short description what this command does
exec: Box<dyn Fn(&[String], &[Command]) -> Result<(), CommandError>>The function that will be executed if the user called the command
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl !RefUnwindSafe for Command
impl !Send for Command
impl !Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
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