[][src]Struct xcli::App

pub struct App<'a> { /* fields omitted */ }

Xcli object

Implementations

impl<'a> App<'a>[src]

pub fn new<S: Into<String>>(n: S) -> Self[src]

Create a new cli instance and return it

pub fn get_name(&self) -> &str[src]

Get the name of this instance

pub fn get_author(&self) -> &str[src]

Get the author of this instance

pub fn get_version(&self) -> &str[src]

Get the version of this instance

pub fn author<S: Into<&'a str>>(mut self: Self, author: S) -> Self[src]

Set the author of this instance

pub fn version<S: Into<&'a str>>(mut self: Self, ver: S) -> Self[src]

Get the version of this instance.

pub fn add_subcommand(&mut self, subcmd: Command<'a>)[src]

Add sub commands to command tree.

pub fn add_subcommand_with_userdata(
    &mut self,
    subcmd: Command<'a>,
    value: Box<dyn Any>
)
[src]

Add sub commands to commands, with user defined data.

userdata must be an IAny trait object, which will be associated with the command name of the subcmd.

pub fn show_tree(&self)[src]

Show all commands and their subcommands like a tree

pub fn get_handler<S: Into<String>>(
    &self,
    key: S
) -> stdResult<&Box<dyn Any>, XcliError>
[src]

Get handler

pub fn run(mut self: Self)[src]

Run the instance

Auto Trait Implementations

impl<'a> !RefUnwindSafe for App<'a>[src]

impl<'a> !Send for App<'a>[src]

impl<'a> !Sync for App<'a>[src]

impl<'a> Unpin for App<'a>[src]

impl<'a> !UnwindSafe for App<'a>[src]

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.