pub struct OutputMode {
pub verbose: bool,
pub quiet: bool,
pub dry_run: bool,
}Expand description
Carries the three standard CLI output-mode flags.
Construct with struct literal syntax or Default::default (all flags
false):
use jt_consoleutils::output::OutputMode;
let mode = OutputMode { verbose: true, ..OutputMode::default() };
assert!(mode.is_verbose());
assert!(!mode.is_quiet());Fields§
§verbose: boolEnable verbose output: commands and their output are echoed.
quiet: boolSuppress all output, including normal progress messages.
dry_run: boolDry-run mode: announce operations without executing them.
Implementations§
Source§impl OutputMode
impl OutputMode
Sourcepub fn is_verbose(self) -> bool
pub fn is_verbose(self) -> bool
Returns true when verbose output is enabled.
Sourcepub fn is_dry_run(self) -> bool
pub fn is_dry_run(self) -> bool
Returns true when dry-run mode is active.
Trait Implementations§
Source§impl Clone for OutputMode
impl Clone for OutputMode
Source§fn clone(&self) -> OutputMode
fn clone(&self) -> OutputMode
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 moreSource§impl Debug for OutputMode
impl Debug for OutputMode
Source§impl Default for OutputMode
impl Default for OutputMode
Source§fn default() -> OutputMode
fn default() -> OutputMode
Returns the “default value” for a type. Read more
impl Copy for OutputMode
Auto Trait Implementations§
impl Freeze for OutputMode
impl RefUnwindSafe for OutputMode
impl Send for OutputMode
impl Sync for OutputMode
impl Unpin for OutputMode
impl UnsafeUnpin for OutputMode
impl UnwindSafe for OutputMode
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