[][src]Struct rawcmd::Intent

pub struct Intent { /* fields omitted */ }

Intent structure which represents user intent.

Implementations

impl Intent[src]

Intent structure implementation.

pub fn new(
    args: Vec<String>,
    command: CommandSummary,
    supcommands: Vec<CommandSummary>,
    subcommands: Vec<CommandSummary>,
    flags: Vec<FlagSummary>,
    params: Vec<ParamSummary>,
    resources: Vec<ResourceSummary>
) -> Self
[src]

Returns new instance.

pub fn args(&self) -> &Vec<String>[src]

Returns raw command-line arguments.

pub fn command(&self) -> &CommandSummary[src]

Returns summary objects of the executed command.

pub fn supcommands(&self) -> &Vec<CommandSummary>[src]

Returns summary objects of parent commands in a tree.

pub fn subcommands(&self) -> &Vec<CommandSummary>[src]

Returns summary objects of child commands.

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

Returns summary objects of all flags.

pub fn flag<S: Into<String>>(&self, name: S) -> Option<&FlagSummary>[src]

Returns summary objects of a specific flag.

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

Returns summary objects of all params.

pub fn param<S: Into<String>>(&self, name: S) -> Option<&ParamSummary>[src]

Returns summary objects of a specific flag.

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

Returns summary objects of all resources.

pub fn resource<S: Into<String>>(&self, name: S) -> Option<&ResourceSummary>[src]

Returns summary objects of a specific resource.

pub fn has_args(&self) -> bool[src]

Returns true if command-line arguments are present.

pub fn has_arg<S: Into<String>>(&self, name: S) -> bool[src]

Returns true if command-line argument is present.

pub fn has_supcommands(&self) -> bool[src]

Returns true if the executed command has parent commands.

pub fn has_subcommands(&self) -> bool[src]

Returns true if the executed command has child commands.

pub fn has_flags(&self) -> bool[src]

Returns true if the executed command has flags.

pub fn has_flag<S: Into<String>>(&self, name: S) -> bool[src]

Returns true if flag is present.

pub fn has_provided_flag<S: Into<String>>(&self, name: S) -> bool[src]

Returns true if flag is present.

pub fn has_params(&self) -> bool[src]

Returns true if the executed command has params.

pub fn has_param<S: Into<String>>(&self, name: S) -> bool[src]

Returns true if param is present.

pub fn has_provided_param<S: Into<String>>(&self, name: S) -> bool[src]

Returns true if param is present.

pub fn has_resources(&self) -> bool[src]

Returns true if the executed command has resources.

pub fn has_resource<S: Into<String>>(&self, name: S) -> bool[src]

Returns true if resource is present.

Trait Implementations

impl Clone for Intent[src]

impl Debug for Intent[src]

impl PartialEq<Intent> for Intent[src]

impl StructuralPartialEq for Intent[src]

Auto Trait Implementations

impl RefUnwindSafe for Intent

impl Send for Intent

impl Sync for Intent

impl Unpin for Intent

impl UnwindSafe for Intent

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.