pub struct BarColumn {
pub bar_width: usize,
pub complete_char: char,
pub incomplete_char: char,
pub edge_char: Option<char>,
pub complete_style: Style,
pub finished_style: Option<Style>,
pub incomplete_style: Style,
pub pulse_style: Style,
pub expand: bool,
pub use_sub_blocks: bool,
}Expand description
Renders the progress bar with distinct filled/unfilled characters.
Uses Unicode box-drawing characters for clear visual distinction:
━(U+2501) for filled portion╸(U+257A) for edge pointer (shows progress position)─(U+2500) for unfilled portion
For indeterminate tasks (no total), shows a pulsing animation.
Use expand(true) to make the bar expand to fill available width.
Use use_sub_blocks(true) for smoother progress using 8th-block Unicode characters.
Fields§
§bar_width: usizeWidth of the bar in characters (used as min_width when expand is true)
complete_char: charCharacter for filled portion (default: ‘━’)
incomplete_char: charCharacter for unfilled portion (default: ‘─’)
edge_char: Option<char>Optional edge pointer character (default: Some(‘╸’))
complete_style: StyleStyle for completed portion
finished_style: Option<Style>Style for finished tasks
incomplete_style: StyleStyle for unfilled portion
pulse_style: StyleStyle for pulse animation (indeterminate)
expand: boolIf true, expand to fill available width
use_sub_blocks: boolIf true, use sub-character (8th-block) Unicode for smoother progress
Implementations§
Source§impl BarColumn
impl BarColumn
pub fn new(bar_width: usize) -> Self
Sourcepub fn complete_char(self, c: char) -> Self
pub fn complete_char(self, c: char) -> Self
Set the complete character
Sourcepub fn incomplete_char(self, c: char) -> Self
pub fn incomplete_char(self, c: char) -> Self
Set the incomplete character
Sourcepub fn edge_char(self, c: Option<char>) -> Self
pub fn edge_char(self, c: Option<char>) -> Self
Set the edge pointer character (or None to disable)
Sourcepub fn complete_style(self, style: Style) -> Self
pub fn complete_style(self, style: Style) -> Self
Set the style for completed portion
Sourcepub fn finished_style(self, style: Option<Style>) -> Self
pub fn finished_style(self, style: Option<Style>) -> Self
Set the style for finished tasks
Sourcepub fn expand(self, expand: bool) -> Self
pub fn expand(self, expand: bool) -> Self
Set whether the bar should expand to fill available width.
When expand is true, the bar will use the remaining terminal width
after other columns are rendered. The bar_width becomes the minimum width.
Sourcepub fn use_sub_blocks(self, enabled: bool) -> Self
pub fn use_sub_blocks(self, enabled: bool) -> Self
Enable sub-character progress using 8th-block Unicode characters.
When enabled, uses characters like ▏▎▍▌▋▊▉█ for smoother progress rendering with 8 levels of precision per character.