pub trait ParentElement {
// Required method
fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>);
// Provided methods
fn child(self, child: impl IntoElement) -> Self
where Self: Sized { ... }
fn children(
self,
children: impl IntoIterator<Item = impl IntoElement>,
) -> Self
where Self: Sized { ... }
}Expand description
This is a helper trait to provide a uniform interface for constructing elements that can accept any number of any kind of child elements
Required Methods§
Sourcefn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>)
fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>)
Extend this element’s children with the given child elements.
Provided Methods§
Sourcefn child(self, child: impl IntoElement) -> Selfwhere
Self: Sized,
fn child(self, child: impl IntoElement) -> Selfwhere
Self: Sized,
Add a single child element to this element.
Sourcefn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Selfwhere
Self: Sized,
fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Selfwhere
Self: Sized,
Add multiple child elements to this element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".