ProgressColumn

Trait ProgressColumn 

Source
pub trait ProgressColumn:
    Send
    + Sync
    + Debug {
    // Required method
    fn render(&self, task: &Task) -> Vec<Span>;

    // Provided methods
    fn render_with_width(
        &self,
        task: &Task,
        _available_width: Option<usize>,
    ) -> Vec<Span> { ... }
    fn is_expandable(&self) -> bool { ... }
    fn min_width(&self) -> usize { ... }
}
Expand description

A trait for rendering a column in a progress bar.

Required Methods§

Source

fn render(&self, task: &Task) -> Vec<Span>

Render the column for the given task.

Provided Methods§

Source

fn render_with_width( &self, task: &Task, _available_width: Option<usize>, ) -> Vec<Span>

Render the column with an available width hint.

Columns that can expand (like BarColumn with expand: true) should override this to use the provided width. Default implementation ignores the width and calls render().

Source

fn is_expandable(&self) -> bool

Returns true if this column should expand to fill available width.

Source

fn min_width(&self) -> usize

Get the minimum width this column needs.

Implementors§