pub enum ElementKind {
Leaf,
Text {
text: String,
size: f64,
color: Color,
},
Stack {
axis: Axis,
gap: f64,
main_align: Align,
cross_align: Align,
children: Vec<Element>,
},
Viewport {
id: ViewportId,
},
}Expand description
What an element arranges; all kinds share Element::decoration.
Variants§
Leaf
A leaf with no children.
Text
A single line of text. Sizes to the shaped run (via the active font);
painted with Scene::fill_text.
Stack
A linear container that lays children along axis.
Viewport
An embedded-content viewport: a leaf reserving a rectangle the compositor
fills with externally-rendered pixels for id. Sizes to its
width/height overrides (or grow),
not to content.
Fields
§
id: ViewportIdTrait Implementations§
Source§impl Clone for ElementKind
impl Clone for ElementKind
Source§fn clone(&self) -> ElementKind
fn clone(&self) -> ElementKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElementKind
impl Debug for ElementKind
Source§impl PartialEq for ElementKind
impl PartialEq for ElementKind
Source§fn eq(&self, other: &ElementKind) -> bool
fn eq(&self, other: &ElementKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ElementKind
Auto Trait Implementations§
impl Freeze for ElementKind
impl RefUnwindSafe for ElementKind
impl Send for ElementKind
impl Sync for ElementKind
impl Unpin for ElementKind
impl UnsafeUnpin for ElementKind
impl UnwindSafe for ElementKind
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