pub struct CliPresentation {
pub format: OutputFormat,
pub verbose: bool,
}Expand description
Resolved CLI output mode for a single command invocation.
Fields§
§format: OutputFormat§verbose: boolImplementations§
Source§impl CliPresentation
impl CliPresentation
pub fn from_cli(global_json: bool, local_json: bool, verbose: bool) -> Self
pub fn is_json(&self) -> bool
pub fn is_text(&self) -> bool
Sourcepub fn supports_ansi_color(&self) -> bool
pub fn supports_ansi_color(&self) -> bool
True when ANSI styling is allowed on CLI output.
Sourcepub fn shows_progress(&self) -> bool
pub fn shows_progress(&self) -> bool
True when indicatif progress bars/spinners may be shown.
pub fn progress_draw_target(&self) -> ProgressDrawTarget
pub fn progress_style( &self, template_plain: &str, template_color: &str, ) -> ProgressStyle
pub fn multi_progress(&self) -> Option<MultiProgress>
Sourcepub fn emit_status(&self, message: impl AsRef<str>)
pub fn emit_status(&self, message: impl AsRef<str>)
Human status line on stderr (omitted in JSON mode).
Sourcepub fn emit_json<T: Serialize>(&self, value: &T) -> Result<(), RommError>
pub fn emit_json<T: Serialize>(&self, value: &T) -> Result<(), RommError>
Pretty JSON on stdout (JSON mode only).
Sourcepub fn emit_command_error(&self, err: &RommError)
pub fn emit_command_error(&self, err: &RommError)
Actionable error line on stderr (text mode batch failures).
Trait Implementations§
Source§impl Clone for CliPresentation
impl Clone for CliPresentation
Source§fn clone(&self) -> CliPresentation
fn clone(&self) -> CliPresentation
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 CliPresentation
Auto Trait Implementations§
impl Freeze for CliPresentation
impl RefUnwindSafe for CliPresentation
impl Send for CliPresentation
impl Sync for CliPresentation
impl Unpin for CliPresentation
impl UnsafeUnpin for CliPresentation
impl UnwindSafe for CliPresentation
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