pub enum Verbosity {
Quiet,
Normal,
Verbose,
VeryVerbose,
}Expand description
User-selected verbosity for Cabin-owned status output.
The default is Verbosity::Normal, which preserves Cabin’s
pre-existing status-message volume. Variants are ordered from
quietest to loudest so callers can compare with >=:
if verbosity >= Verbosity::Verbose { ... }Variants§
Quiet
Suppress Cabin-owned status / progress / log messages.
Errors and explicitly-requested output (build artifacts,
JSON documents, the user program’s stdout under
cabin run) are unaffected.
Normal
Default volume. Status lines such as cabin: wrote build.ninja are emitted; verbose-only lines are not.
Verbose
Adds Cabin-owned context lines such as the resolved build profile, build directory, and toolchain summary.
VeryVerbose
Adds further detail intended for diagnosing local builds. Output stays deterministic and never includes secrets, tokens, or environment-dependent values that Normal / Verbose would not already print.
Implementations§
Source§impl Verbosity
impl Verbosity
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Stable string label for this variant; matches the spelling Cabin documents.
Sourcepub fn shows_status(self) -> bool
pub fn shows_status(self) -> bool
Whether this verbosity emits Cabin-owned status messages.
Sourcepub fn shows_verbose(self) -> bool
pub fn shows_verbose(self) -> bool
Whether this verbosity emits verbose-only context lines.
Sourcepub fn shows_very_verbose(self) -> bool
pub fn shows_very_verbose(self) -> bool
Whether this verbosity emits very-verbose detail lines.
Sourcepub fn from_verbose_count(count: u8) -> Self
pub fn from_verbose_count(count: u8) -> Self
Convert a -v repetition count into a verbosity. Counts
of two or more clamp to Verbosity::VeryVerbose so
-vvv and similar keep working without erroring.
Sourcepub fn from_config_pair(
verbose: Option<bool>,
quiet: Option<bool>,
) -> Result<Option<Self>, InvalidVerbosityCombination>
pub fn from_config_pair( verbose: Option<bool>, quiet: Option<bool>, ) -> Result<Option<Self>, InvalidVerbosityCombination>
Combine the two config booleans term.verbose and
term.quiet into a single verbosity. Returns
Ok(None) when neither is set so callers can fall through
to the next layer in the precedence chain. Returns
InvalidVerbosityCombination when both are true.
§Errors
Returns InvalidVerbosityCombination when both verbose and quiet
are Some(true).
Sourcepub fn parse_bool_env(
variable: &'static str,
raw: &str,
) -> Result<bool, VerbosityEnvError>
pub fn parse_bool_env( variable: &'static str, raw: &str, ) -> Result<bool, VerbosityEnvError>
Parse a verbosity from a single env-var value. Used by
CABIN_TERM_VERBOSE and CABIN_TERM_QUIET: a non-empty
truthy value (1, true) opts in; 0, false, or empty
opt out. Other strings produce a typed error so the CLI
can surface a copy-pasteable message.
§Errors
Returns VerbosityEnvError when raw is non-empty and not one of
1, true, 0, or false.
Trait Implementations§
Source§impl Ord for Verbosity
impl Ord for Verbosity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Verbosity
impl PartialOrd for Verbosity
impl Copy for Verbosity
impl Eq for Verbosity
impl StructuralPartialEq for Verbosity
Auto Trait Implementations§
impl Freeze for Verbosity
impl RefUnwindSafe for Verbosity
impl Send for Verbosity
impl Sync for Verbosity
impl Unpin for Verbosity
impl UnsafeUnpin for Verbosity
impl UnwindSafe for Verbosity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.