pub struct ProgressProps {Show 13 fields
pub progress: f32,
pub width: usize,
pub style: ProgressStyle,
pub custom_chars: Option<ProgressChars>,
pub show_percentage: bool,
pub label: Option<String>,
pub filled_color: Option<Color>,
pub empty_color: Option<Color>,
pub text_color: Option<Color>,
pub bg_color: Option<Color>,
pub brackets: bool,
pub bold: bool,
pub dim_empty: bool,
}Expand description
Properties for the Progress component.
Fields§
§progress: f32Progress value from 0.0 to 1.0.
width: usizeWidth of the progress bar in characters.
style: ProgressStyleProgress bar style.
custom_chars: Option<ProgressChars>Custom characters (overrides style if set).
show_percentage: boolWhether to show percentage text.
label: Option<String>Optional label to show before the bar.
filled_color: Option<Color>Color for filled portion.
empty_color: Option<Color>Color for empty portion.
text_color: Option<Color>Color for percentage text.
bg_color: Option<Color>Background color.
brackets: boolWhether to show brackets around the bar.
bold: boolWhether the filled portion should be bold.
dim_empty: boolWhether the empty portion should be dimmed.
Implementations§
Source§impl ProgressProps
impl ProgressProps
Sourcepub fn style(self, style: ProgressStyle) -> Self
pub fn style(self, style: ProgressStyle) -> Self
Set the progress bar style.
Sourcepub fn custom_chars(self, chars: ProgressChars) -> Self
pub fn custom_chars(self, chars: ProgressChars) -> Self
Set custom characters.
Sourcepub fn show_percentage(self) -> Self
pub fn show_percentage(self) -> Self
Show percentage text after the bar.
Sourcepub fn filled_color(self, color: Color) -> Self
pub fn filled_color(self, color: Color) -> Self
Set the color for the filled portion.
Sourcepub fn empty_color(self, color: Color) -> Self
pub fn empty_color(self, color: Color) -> Self
Set the color for the empty portion.
Sourcepub fn text_color(self, color: Color) -> Self
pub fn text_color(self, color: Color) -> Self
Set the color for percentage/label text.
Sourcepub fn percentage(&self) -> u32
pub fn percentage(&self) -> u32
Get the percentage as an integer (0-100).
Sourcepub fn render_string(&self) -> String
pub fn render_string(&self) -> String
Build the progress bar string.
Trait Implementations§
Source§impl Clone for ProgressProps
impl Clone for ProgressProps
Source§fn clone(&self) -> ProgressProps
fn clone(&self) -> ProgressProps
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 ProgressProps
impl Debug for ProgressProps
Auto Trait Implementations§
impl Freeze for ProgressProps
impl RefUnwindSafe for ProgressProps
impl Send for ProgressProps
impl Sync for ProgressProps
impl Unpin for ProgressProps
impl UnwindSafe for ProgressProps
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