pub struct Command<C = Context> { /* private fields */ }Expand description
Command structure which represents command-line task.
Implementations§
Source§impl<C> Command<C>
Command structure implementation.
impl<C> Command<C>
Command structure implementation.
Sourcepub fn description(&self) -> &Option<String>
pub fn description(&self) -> &Option<String>
Returns description.
Returns author.
Source§impl<C> Command<C>
Command structure implementation.
impl<C> Command<C>
Command structure implementation.
Sourcepub fn with_about<S: Into<String>>(self, val: S) -> Self
pub fn with_about<S: Into<String>>(self, val: S) -> Self
Sets about.
Sourcepub fn with_description<S: Into<String>>(self, val: S) -> Self
pub fn with_description<S: Into<String>>(self, val: S) -> Self
Sets description.
Sets about.
Sourcepub fn with_version<S: Into<String>>(self, val: S) -> Self
pub fn with_version<S: Into<String>>(self, val: S) -> Self
Sets version.
Sourcepub fn with_handler(self, handler: CommandHandler<C>) -> Self
pub fn with_handler(self, handler: CommandHandler<C>) -> Self
Sets error handler function.
Sourcepub fn with_resolver(self, resolver: CommandResolver<C>) -> Self
pub fn with_resolver(self, resolver: CommandResolver<C>) -> Self
Sets resolver function.
Sourcepub fn with_param(self, param: Param) -> Self
pub fn with_param(self, param: Param) -> Self
Adds param.
Sourcepub fn with_resource(self, resource: Resource) -> Self
pub fn with_resource(self, resource: Resource) -> Self
Adds resource.
Sourcepub fn with_subcommand(self, command: Command<C>) -> Self
pub fn with_subcommand(self, command: Command<C>) -> Self
Adds subcommand.
Auto Trait Implementations§
impl<C> Freeze for Command<C>
impl<C> RefUnwindSafe for Command<C>
impl<C> Send for Command<C>
impl<C> Sync for Command<C>
impl<C> Unpin for Command<C>
impl<C> UnsafeUnpin for Command<C>
impl<C> UnwindSafe for Command<C>
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