pub struct TableResult {
pub bbox: BoundingBox,
pub table_type: TableType,
pub classification_confidence: Option<f32>,
pub structure_confidence: Option<f32>,
pub cells: Vec<TableCell>,
pub html_structure: Option<String>,
pub cell_texts: Option<Vec<Option<String>>>,
pub structure_tokens: Option<Vec<String>>,
}Expand description
Result of table recognition.
Fields§
§bbox: BoundingBoxBounding box of the table in the original image
table_type: TableTypeTable type (wired or wireless)
classification_confidence: Option<f32>Confidence score for table type classification (None if classifier wasn’t configured/run)
structure_confidence: Option<f32>Confidence score for table structure recognition (None if structure recognition failed)
cells: Vec<TableCell>Detected table cells
html_structure: Option<String>HTML structure of the table (if available)
cell_texts: Option<Vec<Option<String>>>OCR text content for each cell (if OCR was integrated)
structure_tokens: Option<Vec<String>>Structure tokens from table structure recognition (used for HTML generation after stitching)
Implementations§
Source§impl TableResult
impl TableResult
Sourcepub fn new(bbox: BoundingBox, table_type: TableType) -> Self
pub fn new(bbox: BoundingBox, table_type: TableType) -> Self
Creates a new table result.
Sourcepub fn with_classification_confidence(self, confidence: f32) -> Self
pub fn with_classification_confidence(self, confidence: f32) -> Self
Sets the classification confidence.
Sourcepub fn with_structure_confidence(self, confidence: f32) -> Self
pub fn with_structure_confidence(self, confidence: f32) -> Self
Sets the structure recognition confidence.
Sourcepub fn with_cells(self, cells: Vec<TableCell>) -> Self
pub fn with_cells(self, cells: Vec<TableCell>) -> Self
Sets the table cells.
Sourcepub fn with_html_structure(self, html: impl Into<String>) -> Self
pub fn with_html_structure(self, html: impl Into<String>) -> Self
Sets the HTML structure.
Sourcepub fn with_cell_texts(self, texts: Vec<Option<String>>) -> Self
pub fn with_cell_texts(self, texts: Vec<Option<String>>) -> Self
Sets the cell texts from OCR.
Sourcepub fn with_structure_tokens(self, tokens: Vec<String>) -> Self
pub fn with_structure_tokens(self, tokens: Vec<String>) -> Self
Sets the structure tokens for later HTML generation.
Sourcepub fn confidence(&self) -> Option<f32>
pub fn confidence(&self) -> Option<f32>
Returns the best available confidence score for this table.
This method provides a unified confidence API for callers who want to filter tables by confidence without caring whether classification or structure recognition was used. Priority:
- If both classification and structure confidence are available, returns the minimum (most conservative estimate)
- If only structure confidence is available (common when classifier isn’t configured), returns that
- If only classification confidence is available, returns that
- Returns
Noneonly if neither confidence is available (stub result)
Sourcepub fn has_structure(&self) -> bool
pub fn has_structure(&self) -> bool
Returns true if this table has valid structure data.
A table is considered valid if it has either cells or an HTML structure. Stub results (created when structure recognition fails) will return false.
Trait Implementations§
Source§impl Clone for TableResult
impl Clone for TableResult
Source§fn clone(&self) -> TableResult
fn clone(&self) -> TableResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableResult
impl Debug for TableResult
Source§impl<'de> Deserialize<'de> for TableResult
impl<'de> Deserialize<'de> for TableResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TableResult
impl RefUnwindSafe for TableResult
impl Send for TableResult
impl Sync for TableResult
impl Unpin for TableResult
impl UnwindSafe for TableResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.