pub enum Element {
Text(Text),
Row(Row),
Column(Column),
Spacer(Spacer),
Line(Line),
Rect(Rect),
Table(Table),
Image(Image),
List(List),
TableOfContents(TableOfContents),
PageBreak,
}Expand description
One element in the document tree. Enum-based (not Box<dyn Layoutable>)
— a closed, small set of primitives.
serde (issue #17): internally tagged on a type field
({"type": "text", "content": "...", ...}), snake_case variant
names. Image’s JSON shape is base64 (see its own doc comment), not
the same fields its Rust builder exposes.
Variants§
Text(Text)
Row(Row)
Column(Column)
Spacer(Spacer)
Line(Line)
Rect(Rect)
Table(Table)
Image(Image)
List(List)
TableOfContents(TableOfContents)
PageBreak
Forces a page break at this point in the enclosing flow, regardless of whether the remaining content would still fit (Phase 2).
Implementations§
Source§impl Element
impl Element
Sourcepub fn common(&self) -> Option<&Common>
pub fn common(&self) -> Option<&Common>
Shared style properties, where applicable. Spacer and PageBreak
carry no Common (nothing to size/clip/keep-with-next).
Sourcepub fn common_mut(&mut self) -> Option<&mut Common>
pub fn common_mut(&mut self) -> Option<&mut Common>
Mutable counterpart to Self::common — used by List’s layout
translation to make item content fill the remaining row width
(flex(1.0)) without needing a bespoke setter per element variant.