pub enum Verbosity {
Quite = 0,
Terse = 1,
Verbose = 2,
}Expand description
Verbosity level option <Verbose|Terse|Quite>
Variants§
Implementations§
Source§impl Verbosity
impl Verbosity
Sourcepub fn level() -> Self
pub fn level() -> Self
Gets the global Verbosity level
Verbosity::Verbose.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Verbose);Sourcepub fn is_quite() -> bool
pub fn is_quite() -> bool
Checks if global Verbosity level is Quite
Verbosity::Quite.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Quite);Sourcepub fn is_terse() -> bool
pub fn is_terse() -> bool
Checks if global Verbosity level is Terse
- is not terse if level is ‘Quite’
Verbosity::Quite.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Quite);
assert!(!Verbosity::is_terse())- is terse if level is
Terse
Verbosity::Terse.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Terse);
assert!(Verbosity::is_terse())- is terse also if level is ‘Verbose’
Verbosity::Verbose.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Verbose);
assert!(Verbosity::is_terse())Sourcepub fn is_verbose() -> bool
pub fn is_verbose() -> bool
Checks if global Verbosity level is ‘Verbose’
- is not verbose if level is ‘Quite’
Verbosity::Quite.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Quite);
assert!(!Verbosity::is_verbose())- is not verbose if level is
Terse
Verbosity::Terse.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Terse);
assert!(!Verbosity::is_verbose())- is verbose if level is ‘Verbose’
Verbosity::Verbose.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Verbose);
assert!(Verbosity::is_verbose())Sourcepub fn set_as_global(self)
pub fn set_as_global(self)
Sets the instance of a Verbosity level as the global level
Verbosity::Verbose.set_as_global();
assert_eq!(Verbosity::level(), Verbosity::Verbose);
Verbosity::Quite.set_as_global();
assert_ne!(Verbosity::level(), Verbosity::Quite);
assert_eq!(Verbosity::level(), Verbosity::Verbose);* this can only be set once, all other calls will be ignored
Trait Implementations§
Source§impl Ord for Verbosity
impl Ord for Verbosity
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 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
Mutably borrows from an owned value. Read more