pub enum RunResult {
Handled(String),
Binary(Vec<u8>, String),
Silent,
NoMatch(ArgMatches),
}Expand description
Result of running the CLI dispatcher.
After processing arguments, the dispatcher either handles a command or falls through for manual handling.
Variants§
Handled(String)
A handler processed the command; contains the rendered output
Binary(Vec<u8>, String)
A handler produced binary output (bytes, suggested filename)
Silent
Silent output (handler completed but produced no output)
NoMatch(ArgMatches)
No handler matched; contains the ArgMatches for manual handling
Implementations§
Source§impl RunResult
impl RunResult
Sourcepub fn is_handled(&self) -> bool
pub fn is_handled(&self) -> bool
Returns true if a handler processed the command (text output).
Sourcepub fn binary(&self) -> Option<(&[u8], &str)>
pub fn binary(&self) -> Option<(&[u8], &str)>
Returns the binary data and filename if binary, or None otherwise.
Sourcepub fn matches(&self) -> Option<&ArgMatches>
pub fn matches(&self) -> Option<&ArgMatches>
Returns the matches if unhandled, or None if handled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RunResult
impl !RefUnwindSafe for RunResult
impl Send for RunResult
impl Sync for RunResult
impl Unpin for RunResult
impl !UnwindSafe for RunResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more