| 1 | /// A Constraint can be added to a [columns](crate::Column). |
| 2 | /// |
| 3 | /// They allow some control over Column widths as well as the dynamic arrangement process. |
| 4 | /// |
| 5 | /// All percental boundaries will be ignored, if: |
| 6 | /// - you aren't using one of ContentArrangement::{Dynamic, DynamicFullWidth} |
| 7 | /// - the width of the table/terminal cannot be determined. |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 9 | pub enum ColumnConstraintrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint# { |
| 10 | /// This will completely hide a column. |
| 11 | Hiddenrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#Hidden#, |
| 12 | /// Force the column to be as long as it's content. |
| 13 | /// Use with caution! This can easily mess up your table formatting, |
| 14 | /// if a column's content is overly long. |
| 15 | ContentWidthrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#ContentWidth#, |
| 16 | /// Enforce a absolute width for a column. |
| 17 | Absoluterust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#Absolute#(Widthrust-analyzer cargo comfy-table 7.2.2 style/column/Width#), |
| 18 | /// Specify a lower boundary, either fixed or as percentage of the total width. |
| 19 | /// A column with this constraint will be at least as wide as specified. |
| 20 | /// If the content isn't as long as that boundary, it will be padded. |
| 21 | /// If the column has longer content and is allowed to grow, the column may take more space. |
| 22 | LowerBoundaryrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#LowerBoundary#(Widthrust-analyzer cargo comfy-table 7.2.2 style/column/Width#), |
| 23 | /// Specify a upper boundary, either fixed or as percentage of the total width. |
| 24 | /// A column with this constraint will be at most as wide as specified. |
| 25 | /// The column may be smaller than that width. |
| 26 | UpperBoundaryrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#UpperBoundary#(Widthrust-analyzer cargo comfy-table 7.2.2 style/column/Width#), |
| 27 | /// Specify both, an upper and a lower boundary. |
| 28 | Boundariesrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#Boundaries# { lowerrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#Boundaries#lower.: Widthrust-analyzer cargo comfy-table 7.2.2 style/column/Width#, upperrust-analyzer cargo comfy-table 7.2.2 style/column/ColumnConstraint#Boundaries#upper.: Widthrust-analyzer cargo comfy-table 7.2.2 style/column/Width# }, |
| 29 | } |
| 30 | |
| 31 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 32 | pub enum Widthrust-analyzer cargo comfy-table 7.2.2 style/column/Width# { |
| 33 | /// A fixed amount of characters. |
| 34 | Fixedrust-analyzer cargo comfy-table 7.2.2 style/column/Width#Fixed#(u16), |
| 35 | /// A width equivalent to a certain percentage of the available width. |
| 36 | /// Values above 100 will be automatically reduced to 100. |
| 37 | /// |
| 38 | /// **Warning:** This option will be ignored if: |
| 39 | /// - you aren't using one of ContentArrangement::{Dynamic, DynamicFullWidth} |
| 40 | /// - the width of the table/terminal cannot be determined. |
| 41 | Percentagerust-analyzer cargo comfy-table 7.2.2 style/column/Width#Percentage#(u16), |
| 42 | } |