[−][src]Struct xcli::App
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]
&mut self,
subcmd: Command<'a>,
value: Box<dyn Any>
)
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]
&self,
key: S
) -> stdResult<&Box<dyn Any>, XcliError>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,