pub enum OutputMode {
Text,
Json,
}Expand description
Output format and destination strategy
OutputMode controls where messages and results are written and how
results are formatted. It is orthogonal to Verbosity, which controls
whether output is produced at all.
In text mode, all output goes to stdout. In JSON mode, messages go to stderr (keeping stdout reserved for machine-readable data) and results are serialized as JSON to stdout.
§Examples
use clawless_cli::output::OutputMode;
let mode = OutputMode::default();
assert_eq!(mode, OutputMode::Text);Variants§
Text
Human-readable text output; all output goes to stdout
Json
Machine-readable JSON output; messages go to stderr, results go to stdout as JSON
Trait Implementations§
Source§impl Clone for OutputMode
impl Clone for OutputMode
Source§fn clone(&self) -> OutputMode
fn clone(&self) -> OutputMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OutputMode
Source§impl Debug for OutputMode
impl Debug for OutputMode
Source§impl Default for OutputMode
impl Default for OutputMode
Source§fn default() -> OutputMode
fn default() -> OutputMode
Returns the “default value” for a type. Read more
impl Eq for OutputMode
Source§impl Hash for OutputMode
impl Hash for OutputMode
Source§impl Ord for OutputMode
impl Ord for OutputMode
Source§fn cmp(&self, other: &OutputMode) -> Ordering
fn cmp(&self, other: &OutputMode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OutputMode
impl PartialEq for OutputMode
Source§impl PartialOrd for OutputMode
impl PartialOrd for OutputMode
impl StructuralPartialEq for OutputMode
Auto Trait Implementations§
impl Freeze for OutputMode
impl RefUnwindSafe for OutputMode
impl Send for OutputMode
impl Sync for OutputMode
impl Unpin for OutputMode
impl UnsafeUnpin for OutputMode
impl UnwindSafe for OutputMode
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