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 variation on ParentElement which only supports children of a particular type.

Required Associated Types§

Source

type Child

The specific item type that this element accepts (could simply implement IntoElement or be an element itself).

Required Methods§

Source

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

Extend this element’s children with the given child elements.

Provided Methods§

Source

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

Add a single child element to this element.

Source

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

Implementors§