Type Alias BuilderResult

Source
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§

§1.0.0

Ok(Builder<R>)

Contains the success value

§1.0.0

Err(BuildError)

Contains the error value

Trait Implementations§

Source§

impl<R> BuilderChain<R> for BuilderResult<R>

Source§

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>

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>

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>
where H: Into<CmdStr>, F: FnMut(&mut dyn Write, &[&str]) -> R + Send + 'static,

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>

Finishes the construction of the command tree and returns the build Commander. Read more