MCPcopy Create free account

hub / github.com/Nukesor/comfy-table / functions

Functions261 in github.com/Nukesor/comfy-table

↓ 56 callersMethodadd_row
Add a new row to the table. ``` use comfy_table::{Row, Table}; let mut table = Table::new(); table.add_row(vec!["One", "Two"]); ```
src/table.rs:143
↓ 50 callersMethodset_header
Set the header row of the table. This is usually the title of each column.\ There'll be no header unless you explicitly set it with this function. ``
src/table.rs:108
↓ 39 callersMethodset_content_arrangement
Specify how Comfy Table should arrange the content in your table. ``` use comfy_table::{ContentArrangement, Table}; let mut table = Table::new(); ta
src/table.rs:292
↓ 38 callersMethodset_width
Enforce a max width that should be used in combination with [dynamic content arrangement](ContentArrangement::Dynamic).\ This is usually not necessary
src/table.rs:250
↓ 28 callersMethodload_style
Load a [TableStyle] for this table, replacing the current style. \ Preset styles can be found in the [presets](crate::style::presets) module. You can
src/table.rs:453
↓ 16 callersFunctionassert_table_line_width
(table: &Table, count: usize)
tests/all/mod.rs:26
↓ 13 callersFunctionget_preset_table
()
tests/all/presets_test.rs:4
↓ 13 callersMethodwidth
(&self)
src/utils/mod.rs:44
↓ 12 callersMethodset_constraints
Convenience method to set a [ColumnConstraint] for all columns at once. Constraints are used to influence the way the columns will be arranged. Check
src/table.rs:426
↓ 9 callersMethodcolumn_mut
Get a mutable reference to a specific column.
src/table.rs:499
↓ 9 callersMethodnext
(&mut self)
src/table.rs:701
↓ 8 callersMethodset_constraint
Constraints allow to influence the auto-adjustment behavior of columns.\ This can be useful to counter undesired auto-adjustment of content in tables.
src/column.rs:83
↓ 7 callersMethodforce_no_tty
(&mut self)
src/table.rs:334
↓ 7 callersFunctionget_constraint_table
()
tests/all/constraints_test.rs:6
↓ 7 callersMethodmax_height
Truncate content of cells which occupies more than X lines of space. At least one line of content is always shown, hence a value of `0` is implicitly
src/row.rs:54
↓ 6 callersMethodlines
This is an alternative to `fmt`, but rather returns an iterator to each line, rather than one String separated by newlines.
src/table.rs:94
↓ 5 callersMethodadd_row_if
Add a new row to the table if the predicate evaluates to `true`. ``` use comfy_table::{Row, Table}; let mut table = Table::new(); table.add_row_if(|
src/table.rs:160
↓ 5 callersMethodcolumn_iter
Iterator over all columns
src/table.rs:504
↓ 5 callersMethodenforce_styling
(&mut self)
src/table.rs:382
↓ 5 callersFunctionmax
A little wrapper, which resolves possible upper boundary constraints to their actual value for the current table and terminal width. This returns the
src/utils/arrangement/constraint.rs:88
↓ 5 callersFunctionshould_draw_left_border
(table: &Table)
src/utils/formatting/borders.rs:206
↓ 5 callersFunctionshould_draw_right_border
(table: &Table)
src/utils/formatting/borders.rs:210
↓ 4 callersFunctionabsolute_value_from_width
Resolve an absolute value from a given boundary
src/utils/arrangement/constraint.rs:108
↓ 4 callersFunctionabsolute_width_with_padding
The ColumnDisplayInfo works with a fixed value for content width. However, if a column is supposed to get a absolute width, we have to make sure that
src/utils/arrangement/helper.rs:15
↓ 4 callersMethodadd_cell
Add a cell to the row. Attention: If a row has already been added to a table and you add more cells to it than there're columns currently know to the
src/row.rs:37
↓ 4 callersMethodadd_rows
Add multiple rows to the table. ``` use comfy_table::{Row, Table}; let mut table = Table::new(); let rows = vec![vec!["One", "Two"], vec!["Three", "
src/table.rs:181
↓ 4 callersMethodadd_rows_if
Add multiple rows to the table if the predicate evaluates to `true`. ``` use comfy_table::{Row, Table}; let mut table = Table::new(); let rows = vec
src/table.rs:205
↓ 4 callersMethodis_decided
Whether this column already has a decided width.
src/utils/arrangement/dynamic.rs:89
↓ 4 callersMethodis_empty
Returns if the table is empty (contains no data rows). ``` use comfy_table::Table; let mut table = Table::new(); assert!(table.is_empty()); table.a
src/table.rs:243
↓ 4 callersMethodis_hidden
Returns weather the columns is hidden via [ColumnConstraint::Hidden].
src/column.rs:102
↓ 4 callersMethodis_visible
(&self)
src/style/table_style.rs:70
↓ 4 callersFunctionmeasure_text_width
(s: &str)
src/utils/formatting/content_split/normal.rs:8
↓ 4 callersMethodset_padding
Set the padding for all cells of this column. Padding is provided in the form of (left, right).\ Default is `(1, 1)`.
src/column.rs:59
↓ 3 callersMethodautogenerate_columns
Autogenerate new columns, if a row is added with more cells than existing columns.
src/table.rs:662
↓ 3 callersMethodaverage_space
The average remaining space per undecided column. Returns 0 if no undecided columns remain.
src/utils/arrangement/dynamic.rs:82
↓ 3 callersMethodcolumn_iter_mut
Get a mutable iterator over all columns. ``` use comfy_table::{ColumnConstraint::*, Table, Width::*}; let mut table = Table::new(); table.add_row(&v
src/table.rs:532
↓ 3 callersFunctioncount_border_columns
Return the amount of border columns, that will be visible in the final table output.
src/utils/arrangement/helper.rs:41
↓ 3 callersMethodfix_column
Fix `column` to `content_width` and adjust `remaining_width` and `remaining_columns` accordingly. Returns `false` when no undecided columns remain af
src/utils/arrangement/dynamic.rs:96
↓ 3 callersFunctionget_preset_table
()
tests/all/styling_test.rs:4
↓ 3 callersFunctionget_preset_table
()
tests/all/inner_style_test.rs:4
↓ 3 callersFunctionget_table
()
tests/all/hidden_test.rs:4
↓ 3 callersFunctionmin
A little wrapper, which resolves possible lower boundary constraints to their actual value for the current table and terminal width. This returns the
src/utils/arrangement/constraint.rs:62
↓ 3 callersMethodpadding_width
Convenience helper that returns the total width of the combined padding.
src/column.rs:66
↓ 3 callersMethodrow_iter_mut
Get a mutable iterator over all rows. ``` use comfy_table::Table; let mut table = Table::new(); table.add_row(&vec!["First", "Second", "Third"]); //
src/table.rs:624
↓ 3 callersFunctionshould_draw_vertical_lines
(table: &Table)
src/utils/formatting/borders.rs:214
↓ 2 callersFunctionabsolute_width
(table: &Table, width: &Width)
tests/all/property_test.rs:549
↓ 2 callersFunctionarrange_content
Top level entry point for content arrangement.
src/utils/arrangement/mod.rs:14
↓ 2 callersMethodcell_count
Get the amount of cells on this row.
src/row.rs:78
↓ 2 callersMethodcell_iter
Returns an iterator over all cells of this row
src/row.rs:83
↓ 2 callersMethodcolumn_max_content_widths
Return a vector representing the maximum amount of characters in any line of this column.\ Attention** This scans the whole current content of the ta
src/table.rs:631
↓ 2 callersMethodconstraint
Get the constraint that is used for this column.
src/column.rs:90
↓ 2 callersMethodcontent_lines
Set the style of the lines that contain the rows' content.
src/style/table_style.rs:208
↓ 2 callersMethoddiscover_columns
Calling this might be necessary if you add new cells to rows that're already added to the table. If more cells than're currently know to the table ar
src/table.rs:679
↓ 2 callersFunctioneven_widths
Split `width` into `count` relatively equal chunks. Since we do integer division, there is most likely a little bit of non equally-divisible space. W
src/utils/arrangement/dynamic.rs:491
↓ 2 callersMethodfill
Set the fill character.
src/style/table_style.rs:53
↓ 2 callersFunctionfix_style_in_split_str
Fixes ansi escape codes in a split string 1. Adds reset code to the end of each substring if needed. 2. Keeps track of previous substring's escape cod
src/utils/formatting/content_split/custom_styling.rs:133
↓ 2 callersFunctionget_preset_table
()
tests/all/modifiers_test.rs:4
↓ 2 callersMethodheader
(&self)
src/table.rs:116
↓ 2 callersMethodheader_lines
Set the style of the lines that contain the header's content.
src/style/table_style.rs:196
↓ 2 callersMethodheader_separator
Set the line that's drawn between the header and the first row.
src/style/table_style.rs:202
↓ 2 callersMethodis_tty
(&self)
src/table.rs:355
↓ 2 callersMethodleft
Set the left border character.
src/style/table_style.rs:47
↓ 2 callersMethodmax_content_widths
Get the longest content width for all cells of this row
src/row.rs:61
↓ 2 callersMethodright
Set the right border character.
src/style/table_style.rs:65
↓ 2 callersMethodset_truncation_indicator
Set the truncation indicator for cells that are too long to be displayed. Defaults to "…". Set it to "..." for example if you want to stick to ASCII.
src/table.rs:317
↓ 2 callersFunctionsplit_line
Split a line if it's longer than the allowed columns (width - padding). This function tries to do this in a smart way, by splitting the content with
src/utils/formatting/content_split/mod.rs:25
↓ 2 callersFunctionsplit_long_word
Splits a long word at a given character width. This needs some special logic, as we have to take multi-character UTF-8 symbols into account. When simp
src/utils/formatting/content_split/normal.rs:21
↓ 2 callersMethodstyle_text_only
(&mut self)
src/table.rs:402
↓ 2 callersFunctionwide_columns
Determine which columns contain wide (display width 2) characters. Wide characters cannot be broken apart to fit into a column with a content width o
tests/all/property_test.rs:302
↓ 2 callersMethodwidth
(&self)
src/table.rs:265
↓ 1 callersFunctionalign_line
(table: &Table, info: &ColumnDisplayInfo, cell: &Cell, mut line: String)
src/utils/formatting/content_format.rs:280
↓ 1 callersFunctionarrange
Try to find the best fit for a given content and table_width 1. Determine the amount of available space after applying fixed columns, padding, and bo
src/utils/arrangement/dynamic.rs:127
↓ 1 callersMethodbottom_border
Set the bottom border of the table.
src/style/table_style.rs:220
↓ 1 callersFunctionbuild_error
(table: &str, context: &str)
tests/all/property_test.rs:289
↓ 1 callersFunctionbuild_table
(table: &Table)
src/utils/mod.rs:51
↓ 1 callersFunctioncell_alignment
Each cell can have any alignment.
tests/all/property_test.rs:15
↓ 1 callersFunctioncell_content
Generate random cell content. The `|` char, newlines and control chars are explicitly not included. Those would break the delimiter-based column chec
tests/all/property_test.rs:65
↓ 1 callersFunctioncheck_if_full
Check if the current line is too long and whether we should start a new one If it's too long, we add the current line to the list of lines and return
src/utils/formatting/content_split/mod.rs:175
↓ 1 callersMethodcolumn_cells_with_header_iter
Get a mutable iterator over cells of a column, including the header cell. The header cell will be the very first cell returned. The iterator returns a
src/table.rs:583
↓ 1 callersFunctioncolumn_constraint
Any Column can have any constellation of ColumnConstraints
tests/all/property_test.rs:25
↓ 1 callersMethodcontent
Return a copy of the content contained in this cell.
src/cell.rs:54
↓ 1 callersMethodcontent_arrangement
Get the current content arrangement of the table.
src/table.rs:299
↓ 1 callersFunctioncount_remaining_columns
Return the amount of visible columns that haven't been checked yet. - `column_count` is the total amount of columns that are visible, calculated with
src/utils/arrangement/helper.rs:36
↓ 1 callersFunctioncount_visible_columns
Return the amount of visible columns
src/utils/arrangement/helper.rs:27
↓ 1 callersFunctiondelimiter
Get the delimiter for a Cell. Priority is in decreasing order: Cell -> Column -> Table.
src/utils/arrangement/helper.rs:59
↓ 1 callersFunctiondelimiter
(cell: &Cell, info: &ColumnDisplayInfo, table: &Table)
src/utils/formatting/content_format.rs:13
↓ 1 callersFunctiondistribute_remaining_space
Step 6 - Second branch Not all columns have a determined width yet -> The content still doesn't fully fit into the given width. This function now eq
src/utils/arrangement/dynamic.rs:536
↓ 1 callersFunctiondraw_borders
( table: &Table, rows: &[Vec<Vec<String>>], display_info: &[ColumnDisplayInfo], )
src/utils/formatting/borders.rs:5
↓ 1 callersFunctiondraw_bottom_border
(table: &Table, display_info: &[ColumnDisplayInfo])
src/utils/formatting/borders.rs:172
↓ 1 callersFunctiondraw_horizontal_lines
The horizontal line that separates between rows.
src/utils/formatting/borders.rs:126
↓ 1 callersFunctiondraw_rows
( lines: &mut Vec<String>, rows: &[Vec<Vec<String>>], table: &Table, display_info: &[ColumnDis
src/utils/formatting/borders.rs:67
↓ 1 callersFunctiondraw_top_border
(table: &Table, display_info: &[ColumnDisplayInfo])
src/utils/formatting/borders.rs:33
↓ 1 callersFunctionenforce_lower_boundary_constraints
Step 5 Determine, whether there are any columns that are allowed to occupy more width than the current `average_space` via a [LowerBoundary] constrai
src/utils/arrangement/dynamic.rs:327
↓ 1 callersFunctionevaluate
Look at given constraints of a column and check if some of them can be resolved at the very beginning. For example: - We get an absolute width. - Min
src/utils/arrangement/constraint.rs:15
↓ 1 callersFunctionfind_columns_that_fit_into_average
Step 2-4 This function is part of the column width calculation process. It checks if there are columns that take less space than there's currently ava
src/utils/arrangement/dynamic.rs:232
↓ 1 callersFunctionformat_content
Returns the formatted content of the table. The content is organized in the following structure tc stands for table content and represents the return
src/utils/formatting/content_format.rs:42
↓ 1 callersFunctionformat_row
( row: &Row, display_infos: &[ColumnDisplayInfo], table: &Table, )
src/utils/formatting/content_format.rs:57
↓ 1 callersFunctionget_preset_table
()
tests/all/combined_test.rs:4
↓ 1 callersMethodhas_bottom_border
(&self)
src/style/table_style.rs:264
↓ 1 callersMethodhas_header_separator
(&self)
src/style/table_style.rs:268
next →1–100 of 261, ranked by callers