#[non_exhaustive]pub enum RunResult {
Handled(String),
Binary(Vec<u8>, String),
Silent,
Error(String),
NoMatch(ArgMatches),
}Expand description
Result of running the CLI dispatcher.
After processing arguments, the dispatcher either handles a command, surfaces an error, or falls through for manual handling.
Marked #[non_exhaustive] so future variants can be added without
breaking exhaustive matchers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Handled(String)
A handler processed the command successfully; 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)
Error(String)
A handler, hook, or output step failed; contains the formatted error message. Consumers should write this to stderr and exit non-zero.
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 successfully (text output).
Sourcepub fn error(&self) -> Option<&str>
pub fn error(&self) -> Option<&str>
Returns the error message if this is an error, or None otherwise.
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.