Skip to main content

TableExt

Trait TableExt 

Source
pub trait TableExt {
    // Required methods
    fn rows(&self) -> &[CTTableRow];
    fn row_count(&self) -> usize;
    fn col_count(&self) -> usize;
    fn cell(&self, row: usize, col: usize) -> Option<&CTTableCell>;
    fn to_text_grid(&self) -> Vec<Vec<String>>;
    fn text(&self) -> String;
}
Expand description

Extension trait for CTTable providing convenience methods.

Required Methods§

Source

fn rows(&self) -> &[CTTableRow]

Get all rows in the table.

Source

fn row_count(&self) -> usize

Get the number of rows.

Source

fn col_count(&self) -> usize

Get the number of columns (from grid, or first row if empty).

Source

fn cell(&self, row: usize, col: usize) -> Option<&CTTableCell>

Get a cell by row and column index (0-based).

Source

fn to_text_grid(&self) -> Vec<Vec<String>>

Get all cell text as a 2D vector.

Source

fn text(&self) -> String

Get plain text representation (tab-separated values).

Implementors§

Source§

impl TableExt for CTTable

Available on crate feature dml-tables only.