pub struct OutputConfig {
pub json: bool,
pub quiet: bool,
}Expand description
Output configuration for agent-friendly CLI design.
Supports TTY detection (auto-JSON when piped), quiet mode, and structured JSON output for all commands including mutations.
Fields§
§json: bool§quiet: boolImplementations§
Source§impl OutputConfig
impl OutputConfig
pub fn new(json_flag: bool, quiet: bool) -> Self
Sourcepub fn print_data(&self, data: &str)
pub fn print_data(&self, data: &str)
Print data to stdout (tables or JSON). Always shown.
Sourcepub fn print_message(&self, msg: &str)
pub fn print_message(&self, msg: &str)
Print a human-readable message to stderr. Suppressed by –quiet.
Sourcepub fn print_result(&self, json_value: &Value, human_message: &str)
pub fn print_result(&self, json_value: &Value, human_message: &str)
Print a structured JSON result for mutation commands. In JSON mode, prints to stdout. In human mode, prints message to stderr.
Trait Implementations§
Source§impl Clone for OutputConfig
impl Clone for OutputConfig
Source§fn clone(&self) -> OutputConfig
fn clone(&self) -> OutputConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OutputConfig
Auto Trait Implementations§
impl Freeze for OutputConfig
impl RefUnwindSafe for OutputConfig
impl Send for OutputConfig
impl Sync for OutputConfig
impl Unpin for OutputConfig
impl UnsafeUnpin for OutputConfig
impl UnwindSafe for OutputConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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