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 moreSource§impl Debug for ColumnConstraint
impl Debug for ColumnConstraint
Source§impl PartialEq for ColumnConstraint
impl PartialEq for ColumnConstraint
impl Copy for ColumnConstraint
impl Eq for ColumnConstraint
impl StructuralPartialEq for ColumnConstraint
Auto Trait Implementations§
impl Freeze for ColumnConstraint
impl RefUnwindSafe for ColumnConstraint
impl Send for ColumnConstraint
impl Sync for ColumnConstraint
impl Unpin for ColumnConstraint
impl UnwindSafe for ColumnConstraint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)