Skip to main content

AnyElementIterExt

Trait AnyElementIterExt 

Source
pub trait AnyElementIterExt: Iterator<Item = AnyElement> + Sized {
    // Provided methods
    fn elements(self) -> Vec<AnyElement> { ... }
    fn elements_owned(self) -> Elements { ... }
}
Expand description

Authoring helper for collecting iterator-produced child elements.

This exists to reduce boilerplate after switching common children: Vec<AnyElement> APIs to accept IntoIterator<Item = AnyElement> (e.g. ElementContext::{row,column}), where the target collection type is no longer implied by the callee.

Example: let children = (0..10).map(|i| cx.text(format!("row-{i}"))).elements();

Provided Methods§

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§

Source§

impl<T> AnyElementIterExt for T
where T: Iterator<Item = AnyElement> + Sized,