pub enum Element {
Text(Text),
Row(Row),
Column(Column),
Spacer(Spacer),
Line(Line),
Rect(Rect),
Table(Table),
Image(Image),
List(List),
PageBreak,
}Expand description
One element in the document tree. Enum-based (not Box<dyn Layoutable>)
— a closed, small set of primitives.
Variants§
Text(Text)
Row(Row)
Column(Column)
Spacer(Spacer)
Line(Line)
Rect(Rect)
Table(Table)
Image(Image)
List(List)
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnsafeUnpin for Element
impl UnwindSafe for Element
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