Struct node_cli::Cli [−][src]
pub struct Cli { pub subcommand: Option<Subcommand>, pub run: RunCmd, }
Expand description
An overarching CLI command definition.
Fields
subcommand: Option<Subcommand>
Possible subcommand with parameters.
run: RunCmd
Trait Implementations
Builds the struct from clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by [StructOpt::clap
] called on
the same type, otherwise it must panic. Read more
fn from_args() -> Self
fn from_args() -> Self
Builds the struct from the command line arguments (std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program. Read more
fn from_args_safe() -> Result<Self, Error>
fn from_args_safe() -> Result<Self, Error>
Builds the struct from the command line arguments (std::env::args_os
).
Unlike [StructOpt::from_args
], returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making.
Print the error message and quit the program in case of failure. Read more
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making. Read more
Implementation version. Read more
Executable file description.
Executable file author.
Support URL.
Copyright starting year (x-current year)
Native runtime version.
Executable file name. Read more
Helper function used to parse the command line arguments. This is the equivalent of
structopt
’s from_iter()
except that it takes a VersionInfo
argument to provide the name of
the application, author, “about” and version. It will also set AppSettings::GlobalVersion
. Read more
fn from_iter<I>(iter: I) -> Self where
Self: StructOpt,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
Self: StructOpt,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Helper function used to parse the command line arguments. This is the equivalent of
structopt
’s from_iter()
except that it takes a VersionInfo
argument to provide the name of
the application, author, “about” and version. It will also set AppSettings::GlobalVersion
. Read more
fn try_from_iter<I>(iter: I) -> Result<Self, Error> where
Self: StructOpt,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn try_from_iter<I>(iter: I) -> Result<Self, Error> where
Self: StructOpt,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Helper function used to parse the command line arguments. This is the equivalent of
structopt
’s from_iter()
except that it takes a VersionInfo
argument to provide the name of
the application, author, “about” and version. It will also set AppSettings::GlobalVersion
. Read more
fn create_configuration<T, DVC>(
&self,
command: &T,
task_executor: TaskExecutor
) -> Result<Configuration, Error> where
T: CliConfiguration<DVC>,
DVC: DefaultConfigurationValues,
fn create_configuration<T, DVC>(
&self,
command: &T,
task_executor: TaskExecutor
) -> Result<Configuration, Error> where
T: CliConfiguration<DVC>,
DVC: DefaultConfigurationValues,
Only create a Configuration for the command provided in argument
fn create_runner<T>(&self, command: &T) -> Result<Runner<Self>, Error> where
T: CliConfiguration<()>,
fn create_runner<T>(&self, command: &T) -> Result<Runner<Self>, Error> where
T: CliConfiguration<()>,
Create a runner for the command provided in argument. This will create a Configuration and a tokio runtime Read more
Auto Trait Implementations
impl RefUnwindSafe for Cli
impl UnwindSafe for Cli
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,