pub trait ChildrenExt: Sized {
// Required method
fn get_children(&mut self) -> &mut Vec<Element>;
// Provided methods
fn children(self, children: impl IntoIterator<Item = Element>) -> Self { ... }
fn maybe_child<C: IntoElement>(self, child: Option<C>) -> Self { ... }
fn child<C: IntoElement>(self, child: C) -> Self { ... }
}Expand description
Trait for composing child elements.
Required Methods§
Provided Methods§
Sourcefn children(self, children: impl IntoIterator<Item = Element>) -> Self
fn children(self, children: impl IntoIterator<Item = Element>) -> Self
Sourcefn maybe_child<C: IntoElement>(self, child: Option<C>) -> Self
fn maybe_child<C: IntoElement>(self, child: Option<C>) -> Self
Sourcefn child<C: IntoElement>(self, child: C) -> Self
fn child<C: IntoElement>(self, child: C) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl ChildrenExt for Image
impl ChildrenExt for Paragraph
Children added to a Paragraph flow inline at the point they were added, each laid out at
its own measured size, so give them an explicit width and height.