pub struct MiniBar { /* private fields */ }Expand description
Compact progress indicator for dashboard-style metrics.
Implementations§
Source§impl MiniBar
impl MiniBar
Sourcepub fn new(value: f64, width: u16) -> Self
pub fn new(value: f64, width: u16) -> Self
Create a new MiniBar with value in the 0.0..=1.0 range.
Sourcepub fn show_percent(self, show: bool) -> Self
pub fn show_percent(self, show: bool) -> Self
Enable or disable percentage text.
Sourcepub fn filled_char(self, ch: char) -> Self
pub fn filled_char(self, ch: char) -> Self
Override the filled block character.
Sourcepub fn empty_char(self, ch: char) -> Self
pub fn empty_char(self, ch: char) -> Self
Override the empty block character.
Sourcepub fn thresholds(self, thresholds: MiniBarThresholds) -> Self
pub fn thresholds(self, thresholds: MiniBarThresholds) -> Self
Override the color thresholds.
Sourcepub fn colors(self, colors: MiniBarColors) -> Self
pub fn colors(self, colors: MiniBarColors) -> Self
Override the color palette.
Sourcepub fn color_for_value(value: f64) -> PackedRgba
pub fn color_for_value(value: f64) -> PackedRgba
Map a value to a color using default thresholds.
Sourcepub fn render_string(&self) -> String
pub fn render_string(&self) -> String
Render the bar as a string (for testing/debugging).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MiniBar
impl RefUnwindSafe for MiniBar
impl Send for MiniBar
impl Sync for MiniBar
impl Unpin for MiniBar
impl UnsafeUnpin for MiniBar
impl UnwindSafe for MiniBar
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