pub enum CommandOutcome {
Success {
output: String,
total: Option<u64>,
},
RawOutput(String),
UserError(String),
}Expand description
Result of a command execution: either success (exit 0) or a user-facing error (exit 1).
Internal/unexpected errors are represented by anyhow::Error at the call site.
Invariant: Success.output must always be a valid JSON string — the pipeline handles
format conversion. Commands must never store pre-formatted text here.
For commands like read whose text output is raw file content (not structured data),
use RawOutput to bypass the JSON pipeline entirely.
Variants§
Success
Successful operation — JSON output goes to stdout via the pipeline.
Fields
RawOutput(String)
Raw text output, bypasses the JSON pipeline — printed directly to stdout as-is.
Used by read command for text-format content output.
UserError(String)
User error (file not found, property missing, etc.) — output goes to stderr.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandOutcome
impl RefUnwindSafe for CommandOutcome
impl Send for CommandOutcome
impl Sync for CommandOutcome
impl Unpin for CommandOutcome
impl UnsafeUnpin for CommandOutcome
impl UnwindSafe for CommandOutcome
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more