pub trait ParentElementTyped {
type Child;
// Required method
fn extend(&mut self, elements: impl IntoIterator<Item = Self::Child>);
// Provided methods
fn child(self, child: Self::Child) -> Self
where Self: Sized { ... }
fn children(self, children: impl IntoIterator<Item = Self::Child>) -> Self
where Self: Sized { ... }
}Expand description
A parent element whose children all have one concrete type.
Use it when a container’s children carry a shared type, such as rows with their own data.
Most containers use ParentElement, which accepts any IntoElement.
Required Associated Types§
Required Methods§
Sourcefn extend(&mut self, elements: impl IntoIterator<Item = Self::Child>)
fn extend(&mut self, elements: impl IntoIterator<Item = Self::Child>)
Adds the given children to the end of this element’s children.
Provided Methods§
Sourcefn child(self, child: Self::Child) -> Selfwhere
Self: Sized,
fn child(self, child: Self::Child) -> Selfwhere
Self: Sized,
Adds one child to this element, and returns the element for chaining.
Sourcefn children(self, children: impl IntoIterator<Item = Self::Child>) -> Selfwhere
Self: Sized,
fn children(self, children: impl IntoIterator<Item = Self::Child>) -> Selfwhere
Self: Sized,
Adds several children to this element, in iteration order, and returns the element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".