[][src]Struct rawcmd::Command

pub struct Command<C = Context> { /* fields omitted */ }

Command structure which represents command-line task.

Implementations

impl<C> Command<C>[src]

Command structure implementation.

pub fn name(&self) -> &String[src]

Returns name.

pub fn about(&self) -> &Option<String>[src]

Returns about.

pub fn description(&self) -> &Option<String>[src]

Returns description.

pub fn author(&self) -> &Option<String>[src]

Returns author.

pub fn version(&self) -> &Option<String>[src]

Returns version.

pub fn flags(&self) -> &Vec<Flag>[src]

Returns flags.

pub fn params(&self) -> &Vec<Param>[src]

Returns flags.

pub fn resources(&self) -> &Vec<Resource>[src]

Returns resources.

pub fn commands(&self) -> &Vec<Command<C>>[src]

Returns commands.

impl<C> Command<C>[src]

Command structure implementation.

pub fn with_name<S: Into<String>>(name: S) -> Self[src]

Returns new instance.

pub fn with_about<S: Into<String>>(self, val: S) -> Self[src]

Sets about.

pub fn with_description<S: Into<String>>(self, val: S) -> Self[src]

Sets description.

pub fn with_author<S: Into<String>>(self, val: S) -> Self[src]

Sets about.

pub fn with_version<S: Into<String>>(self, val: S) -> Self[src]

Sets version.

pub fn with_handler(self, handler: CommandHandler<C>) -> Self[src]

Sets error handler function.

pub fn with_resolver(self, resolver: CommandResolver<C>) -> Self[src]

Sets resolver function.

pub fn with_flag(self, flag: Flag) -> Self[src]

Adds flag.

pub fn with_param(self, param: Param) -> Self[src]

Adds param.

pub fn with_resource(self, resource: Resource) -> Self[src]

Adds resource.

pub fn with_subcommand(self, command: Command<C>) -> Self[src]

Adds subcommand.

pub fn run(self, ctx: &mut C) -> Result<i32>[src]

Executes as a command-line application.

pub fn run_args<A, T>(self, args: A, ctx: &mut C) -> Result<i32> where
    A: IntoIterator<Item = T>,
    T: Into<String>, 
[src]

Executes as a command-line application.

Auto Trait Implementations

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> UnwindSafe for Command<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.