pub struct Table {
pub rows: Vec<TableRow>,
pub has_header: bool,
pub col_count: usize,
pub bbox: Option<Rect>,
}Expand description
A complete extracted table with rows and optional header information.
Fields§
§rows: Vec<TableRow>Rows of the table (alternating between header and body rows)
has_header: boolWhether the table has an explicit header section
col_count: usizeNumber of columns (inferred from first row)
bbox: Option<Rect>Bounding box of the table region (used to exclude table spans from normal rendering)
Implementations§
Source§impl Table
impl Table
Sourcepub fn is_real_grid(&self) -> bool
pub fn is_real_grid(&self) -> bool
Check whether this table looks like a real data grid as opposed to spurious spatial output (form layouts, label-colon-value pairs).
A real grid has:
- ≥2 rows
- ≥2 columns
- Consistent column population: at least 50% of rows must have
at least 2 non-empty cells. Filters out the common
form-as-table false positive where rows look like
| Single label, all other slots empty | | | |.
Sourcepub fn render_text(&self) -> String
pub fn render_text(&self) -> String
Render the table as clean, space-padded plain text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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
Mutably borrows from an owned value. Read more