pub mod human;
pub mod json;
pub mod progress;
pub mod spinner;
#[derive(Debug, Clone)]
pub enum OutputMode {
Human {
color: bool,
interactive: bool,
},
Json,
}
impl OutputMode {
#[must_use]
pub const fn is_json(&self) -> bool {
matches!(self, Self::Json)
}
#[must_use]
pub const fn is_human(&self) -> bool {
matches!(self, Self::Human { .. })
}
#[must_use]
pub const fn color_enabled(&self) -> bool {
matches!(self, Self::Human { color: true, .. })
}
#[must_use]
pub const fn interactive(&self) -> bool {
matches!(
self,
Self::Human {
interactive: true,
..
}
)
}
#[must_use]
pub const fn use_hyperlinks(&self) -> bool {
matches!(
self,
Self::Human {
interactive: true,
color: true
}
)
}
}