pub type BuilderResult<R> = Result<Builder<R>, BuildError>;
Expand description
The common result of BuilderChain
functions.
Aliased Type§
pub enum BuilderResult<R> {
Ok(Builder<R>),
Err(BuildError),
}
Variants§
Trait Implementations§
Source§impl<R> BuilderChain<R> for BuilderResult<R>
impl<R> BuilderChain<R> for BuilderResult<R>
Source§fn begin_class<H: Into<CmdStr>>(
self,
name: &str,
help_msg: H,
) -> BuilderResult<R>
fn begin_class<H: Into<CmdStr>>( self, name: &str, help_msg: H, ) -> BuilderResult<R>
Start a new nested class. If the name already exists a
BuildError
will be returned.Source§fn end_class(self) -> BuilderResult<R>
fn end_class(self) -> BuilderResult<R>
Close a class and move to it’s parent.
If no parent exists (this function is called on the root), a
BuildError
will be returned.Source§fn root(self) -> BuilderResult<R>
fn root(self) -> BuilderResult<R>
Navigates to the root class, closing out the classes as it goes.
Source§fn add_action<H, F>(
self,
name: &str,
help_msg: H,
closure: F,
) -> BuilderResult<R>
fn add_action<H, F>( self, name: &str, help_msg: H, closure: F, ) -> BuilderResult<R>
Add an action. The closure type gives the arguments after the action command as an array of strings.
Source§fn into_commander<'c>(self) -> Result<Commander<R>, BuildError>
fn into_commander<'c>(self) -> Result<Commander<R>, BuildError>
Finishes the construction of the command tree and returns the build
Commander
. Read more