pub enum ColumnConstraint {
Hidden,
ContentWidth,
Absolute(Width),
LowerBoundary(Width),
UpperBoundary(Width),
Boundaries {
lower: Width,
upper: Width,
},
}
Expand description
A Constraint can be added to a columns.
They allow some control over Column widths as well as the dynamic arrangement process.
All percental boundaries will be ignored, if:
- you aren’t using one of ContentArrangement::{Dynamic, DynamicFullWidth}
- the width of the table/terminal cannot be determined.
Variants§
Hidden
This will completely hide a column.
ContentWidth
Force the column to be as long as it’s content. Use with caution! This can easily mess up your table formatting, if a column’s content is overly long.
Absolute(Width)
Enforce a absolute width for a column.
LowerBoundary(Width)
Specify a lower boundary, either fixed or as percentage of the total width. A column with this constraint will be at least as wide as specified. If the content isn’t as long as that boundary, it will be padded. If the column has longer content and is allowed to grow, the column may take more space.
UpperBoundary(Width)
Specify a upper boundary, either fixed or as percentage of the total width. A column with this constraint will be at most as wide as specified. The column may be smaller than that width.
Boundaries
Specify both, an upper and a lower boundary.
Trait Implementations§
Source§impl Clone for ColumnConstraint
impl Clone for ColumnConstraint
Source§fn clone(&self) -> ColumnConstraint
fn clone(&self) -> ColumnConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more