Skip to main content

ParentElementTyped

Trait ParentElementTyped 

Source
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§

Source

type Child

The type of child that this element accepts.

Required Methods§

Source

fn extend(&mut self, elements: impl IntoIterator<Item = Self::Child>)

Adds the given children to the end of this element’s children.

Provided Methods§

Source

fn child(self, child: Self::Child) -> Self
where Self: Sized,

Adds one child to this element, and returns the element for chaining.

Source

fn children(self, children: impl IntoIterator<Item = Self::Child>) -> Self
where 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".

Implementors§