pub struct Table {
pub subject: TextContent,
pub header_rows: Vec<TableRow>,
pub body_rows: Vec<TableRow>,
pub footnotes: Option<Box<List>>,
pub annotations: Vec<Annotation>,
pub location: Range,
pub mode: VerbatimBlockMode,
}Expand description
A table element with structured, pipe-delimited content.
Fields§
§subject: TextContentCaption/subject line (inline-parsed)
header_rows: Vec<TableRow>Header rows (typically first row; controlled by header=N parameter)
body_rows: Vec<TableRow>Body/data rows
footnotes: Option<Box<List>>Optional scoped footnote definitions
annotations: Vec<Annotation>Annotations attached to this table (including :: table :: config annotation)
location: RangeLocation spanning the entire table element
mode: VerbatimBlockModeRendering mode (Inflow or Fullwidth, same as verbatim blocks)
Implementations§
Source§impl Table
impl Table
pub fn new( subject: TextContent, header_rows: Vec<TableRow>, body_rows: Vec<TableRow>, mode: VerbatimBlockMode, ) -> Self
pub fn with_footnotes(self, footnotes: List) -> Self
pub fn at(self, location: Range) -> Self
Sourcepub fn all_rows(&self) -> impl Iterator<Item = &TableRow>
pub fn all_rows(&self) -> impl Iterator<Item = &TableRow>
All rows (header + body) in document order
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Maximum column count across all rows
Sourcepub fn annotations(&self) -> &[Annotation]
pub fn annotations(&self) -> &[Annotation]
Annotations attached to this table.
Sourcepub fn annotations_mut(&mut self) -> &mut Vec<Annotation>
pub fn annotations_mut(&mut self) -> &mut Vec<Annotation>
Mutable access to table annotations.
Trait Implementations§
Source§impl Container for Table
impl Container for Table
fn label(&self) -> &str
fn children(&self) -> &[ContentItem]
fn children_mut(&mut self) -> &mut Vec<ContentItem>
Source§impl VisualStructure for Table
impl VisualStructure for Table
Source§fn is_source_line_node(&self) -> bool
fn is_source_line_node(&self) -> bool
Whether this node corresponds to a line in the source document Read more
Source§fn has_visual_header(&self) -> bool
fn has_visual_header(&self) -> bool
Whether this node has a visual header line separate from its content Read more
Source§fn collapses_with_children(&self) -> bool
fn collapses_with_children(&self) -> bool
Whether this is a homogeneous container whose children can collapse with parent icon Read more
impl StructuralPartialEq for Table
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
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>
Converts
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>
Converts
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 more