| 1 | /// Specify how comfy_table should arrange the content in your table. |
| 2 | /// |
| 3 | /// ``` |
| 4 | /// use comfy_table::{ContentArrangement, Table}; |
| 5 | /// |
| 6 | /// let mut table = Table::new(); |
| 7 | /// table.set_content_arrangement(ContentArrangement::Dynamic); |
| 8 | /// ``` |
| 9 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(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:)] |
| 10 | pub enum ContentArrangementrust-analyzer cargo comfy-table 7.2.2 style/table/ContentArrangement# { |
| 11 | /// Don't do any content arrangement.\ |
| 12 | /// Tables with this mode might become wider than your output and look ugly.\ |
| 13 | /// Constraints on columns are still respected. |
| 14 | Disabledrust-analyzer cargo comfy-table 7.2.2 style/table/ContentArrangement#Disabled#, |
| 15 | /// Dynamically determine the width of columns in regard to terminal width and content length.\ |
| 16 | /// With this mode, the content in cells will wrap dynamically to get the best column layout |
| 17 | /// for the given content.\ |
| 18 | /// Constraints on columns are still respected. |
| 19 | /// |
| 20 | /// **Warning:** If terminal width cannot be determined and no table_width is set via |
| 21 | /// [Table::set_width](crate::table::Table::set_width), |
| 22 | /// this option won't work and [Disabled](ContentArrangement::Disabled) will be used as a |
| 23 | /// fallback. |
| 24 | Dynamicrust-analyzer cargo comfy-table 7.2.2 style/table/ContentArrangement#Dynamic#, |
| 25 | /// This is mode is the same as the [ContentArrangement::Dynamic] arrangement, but it will |
| 26 | /// always use as much space as it's given. Any surplus space will be distributed between |
| 27 | /// all columns. |
| 28 | DynamicFullWidthrust-analyzer cargo comfy-table 7.2.2 style/table/ContentArrangement#DynamicFullWidth#, |
| 29 | } |
| 30 | |
| 31 | /// All configurable table components. |
| 32 | /// A character can be assigned to each component via |
| 33 | /// [Table::set_style](crate::table::Table::set_style). This is then used to draw character of the |
| 34 | /// respective component to the commandline. |
| 35 | /// |
| 36 | /// I hope that most component names are self-explanatory. Just in case: |
| 37 | /// BorderIntersections are Intersections, where rows/columns lines meet outer borders. |
| 38 | /// E.g.: |
| 39 | /// ```text |
| 40 | /// --------- |
| 41 | /// v | |
| 42 | /// +---+---+---+ | |
| 43 | /// | a | b | c | | |
| 44 | /// +===+===+===+<-| |
| 45 | /// | | | | | |
| 46 | /// +---+---+---+<-- These "+" chars are Borderintersections. |
| 47 | /// | | | | The inner "+" chars are MiddleIntersections |
| 48 | /// +---+---+---+ |
| 49 | /// ``` |
| 50 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(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:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 51 | pub enum TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent# { |
| 52 | LeftBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#LeftBorder#, |
| 53 | RightBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#RightBorder#, |
| 54 | TopBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopBorder#, |
| 55 | BottomBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomBorder#, |
| 56 | LeftHeaderIntersectionrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#LeftHeaderIntersection#, |
| 57 | HeaderLinesrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#HeaderLines#, |
| 58 | MiddleHeaderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#MiddleHeaderIntersections#, |
| 59 | RightHeaderIntersectionrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#RightHeaderIntersection#, |
| 60 | VerticalLinesrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#VerticalLines#, |
| 61 | HorizontalLinesrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#HorizontalLines#, |
| 62 | MiddleIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#MiddleIntersections#, |
| 63 | LeftBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#LeftBorderIntersections#, |
| 64 | RightBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#RightBorderIntersections#, |
| 65 | TopBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopBorderIntersections#, |
| 66 | BottomBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomBorderIntersections#, |
| 67 | TopLeftCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopLeftCorner#, |
| 68 | TopRightCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopRightCorner#, |
| 69 | BottomLeftCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomLeftCorner#, |
| 70 | BottomRightCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomRightCorner#, |
| 71 | } |
| 72 | |
| 73 | impl TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent# { |
| 74 | const fn componentsrust-analyzer cargo comfy-table 7.2.2 style/table/impl#[TableComponent]components().() -> [TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#; 19] { |
| 75 | [ |
| 76 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::LeftBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#LeftBorder#, |
| 77 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::RightBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#RightBorder#, |
| 78 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::TopBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopBorder#, |
| 79 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::BottomBorderrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomBorder#, |
| 80 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::LeftHeaderIntersectionrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#LeftHeaderIntersection#, |
| 81 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::HeaderLinesrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#HeaderLines#, |
| 82 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::MiddleHeaderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#MiddleHeaderIntersections#, |
| 83 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::RightHeaderIntersectionrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#RightHeaderIntersection#, |
| 84 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::VerticalLinesrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#VerticalLines#, |
| 85 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::HorizontalLinesrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#HorizontalLines#, |
| 86 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::MiddleIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#MiddleIntersections#, |
| 87 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::LeftBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#LeftBorderIntersections#, |
| 88 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::RightBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#RightBorderIntersections#, |
| 89 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::TopBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopBorderIntersections#, |
| 90 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::BottomBorderIntersectionsrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomBorderIntersections#, |
| 91 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::TopLeftCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopLeftCorner#, |
| 92 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::TopRightCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#TopRightCorner#, |
| 93 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::BottomLeftCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomLeftCorner#, |
| 94 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::BottomRightCornerrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#BottomRightCorner#, |
| 95 | ] |
| 96 | } |
| 97 | |
| 98 | pub fn iterrust-analyzer cargo comfy-table 7.2.2 style/table/impl#[TableComponent]iter().() -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#> { |
| 99 | TableComponentrust-analyzer cargo comfy-table 7.2.2 style/table/TableComponent#::componentsrust-analyzer cargo comfy-table 7.2.2 style/table/impl#[TableComponent]components().().into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().() |
| 100 | } |
| 101 | } |