pub struct Output { /* private fields */ }Expand description
The terminal writer used by every command.
Writing goes through locked handles with write!, so a closed pipe is
reported as an error rather than a panic. Every string written, error
reports included, first has any registered secret replaced by
<redacted> (see BootstrapToken).
Implementations§
Source§impl Output
impl Output
Sourcepub fn new(format: OutputFormat) -> Self
pub fn new(format: OutputFormat) -> Self
Creates a writer for format.
Sourcepub fn format(&self) -> OutputFormat
pub fn format(&self) -> OutputFormat
Returns the output format.
Sourcepub fn error(&self, error: &CliError)
pub fn error(&self, error: &CliError)
Reports a failed command on standard error: error: <message> and
its causes, then any validation details. Under --json the report is
one JSON object, {"error": {"code", "message", "details"}, "exit_code"}.
Failures to write the report itself are ignored: there is nowhere left to report them.
Trait Implementations§
impl Copy for Output
impl Eq for Output
impl StructuralPartialEq for Output
Auto Trait Implementations§
impl Forget for Output
impl Freeze for Output
impl Move for Output
impl RefUnwindSafe for Output
impl Send for Output
impl Sync for Output
impl Unpin for Output
impl UnsafeUnpin for Output
impl UnwindSafe for Output
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.