Skip to main content

views

Function views 

Source
pub fn views<State, I>(iter: I) -> Views<I>
where State: 'static, I: IntoIterator, <I as IntoIterator>::Item: View<State>,
Expand description

Wrap an iterator of views as a ViewSeq — the child-sequence spelling of “one child per item”, e.g. views(items.iter().map(|i| text(&i.name))).

ViewSeq has no blanket impl over IntoIterator (it would overlap the tuple impls), so an iterator goes through this adapter; a Vec or array needs no wrapping. Each item is erased once, as it is pushed.