pub struct OutputFormatter { /* private fields */ }Expand description
Formats command output in different modes
Implementations§
Source§impl OutputFormatter
impl OutputFormatter
Sourcepub const fn new(json_mode: bool, quiet_mode: bool) -> Self
pub const fn new(json_mode: bool, quiet_mode: bool) -> Self
Create a new output formatter
§Arguments
json_mode- If true, output JSON; otherwise output textquiet_mode- If true and not in JSON mode, suppress all output
Sourcepub fn format(&self, result: &CommandResult) -> String
pub fn format(&self, result: &CommandResult) -> String
Format a command result for output
Trait Implementations§
Source§impl Clone for OutputFormatter
impl Clone for OutputFormatter
Source§fn clone(&self) -> OutputFormatter
fn clone(&self) -> OutputFormatter
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 moreAuto Trait Implementations§
impl Freeze for OutputFormatter
impl RefUnwindSafe for OutputFormatter
impl Send for OutputFormatter
impl Sync for OutputFormatter
impl Unpin for OutputFormatter
impl UnwindSafe for OutputFormatter
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