pub struct CliOutput {
pub verbosity: Verbosity,
pub color: bool,
pub format: String,
}Fields§
§verbosity: Verbosity§color: boolResolved: true if color should be emitted.
format: StringImplementations§
Source§impl CliOutput
impl CliOutput
pub fn from_args(args: &OutputArgs) -> Self
Sourcepub fn format_info(&self, msg: impl AsRef<str>) -> String
pub fn format_info(&self, msg: impl AsRef<str>) -> String
Format a status line with the green > prefix nh uses.
Returns the formatted string — useful in tests to assert the prefix without capturing stderr.
Sourcepub fn format_warn(&self, msg: impl AsRef<str>) -> String
pub fn format_warn(&self, msg: impl AsRef<str>) -> String
Format a warning line with the yellow ! prefix nh uses.
Sourcepub fn format_error(&self, msg: impl AsRef<str>) -> String
pub fn format_error(&self, msg: impl AsRef<str>) -> String
Format an error line with the red ERROR prefix.
Sourcepub fn info(&self, msg: impl AsRef<str>)
pub fn info(&self, msg: impl AsRef<str>)
Print a status message with the green > prefix to stderr.
Always written to stderr so it doesn’t pollute stdout pipes.
Sourcepub fn is_verbose(&self) -> bool
pub fn is_verbose(&self) -> bool
Returns true if -v / –verbose was passed at least once.
Auto Trait Implementations§
impl Freeze for CliOutput
impl RefUnwindSafe for CliOutput
impl Send for CliOutput
impl Sync for CliOutput
impl Unpin for CliOutput
impl UnsafeUnpin for CliOutput
impl UnwindSafe for CliOutput
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