#[non_exhaustive]pub enum RunResult {
Handled(RunOutput),
Binary(Vec<u8>, String),
Artifact(ArtifactRun),
Silent,
Error(RunError),
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(RunOutput)
A handler processed the command successfully; contains the rendered output
Binary(Vec<u8>, String)
A handler produced binary output (bytes, suggested filename)
Artifact(ArtifactRun)
A handler produced a compound artifact the framework completed: the bytes, the receipt naming the destination the write completed to, and the report rendered after that write.
For a file destination the bytes are already on disk. For the stdout destination the byte write is deferred to the framework’s stdout writer.
Silent
Silent output (handler completed but produced no output)
Error(RunError)
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 is_artifact(&self) -> bool
pub fn is_artifact(&self) -> bool
Returns true if the result is a completed artifact run.
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 success_kind(&self) -> Option<SuccessKind>
pub fn success_kind(&self) -> Option<SuccessKind>
Returns the typed success origin for captured text.
Sourcepub fn error_kind(&self) -> Option<RunErrorKind>
pub fn error_kind(&self) -> Option<RunErrorKind>
Returns the typed error origin, if this run failed.
Sourcepub fn exit_status(&self) -> Option<ExitStatus>
pub fn exit_status(&self) -> Option<ExitStatus>
Returns the completed run’s shell status.
NoMatch returns None: it is a fallback handoff, not a completed
framework execution and is deliberately not treated as a usage error.
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 artifact(&self) -> Option<&ArtifactRun>
pub fn artifact(&self) -> Option<&ArtifactRun>
Returns the completed artifact run, or None otherwise.
Sourcepub fn matches(&self) -> Option<&ArgMatches>
pub fn matches(&self) -> Option<&ArgMatches>
Returns the matches if unhandled, or None if handled.