//! Groupings of elements. use crate::*; /// A function or closure that emits renderables. pub trait Collector: Send + Sync + Fn(&mut dyn FnMut(&dyn Render)) {} /// Any function or closure that emits renderables for the given engine matches [CollectCallback]. impl Collector for F where E: Engine, F: Send + Sync + Fn(&mut dyn FnMut(&dyn Render)) {} pub trait Render { fn area (&self, to: E::Area) -> E::Area; fn render (&self, to: &mut E::Output); } impl> Render for C { fn area (&self, to: E::Area) -> E::Area { Content::area(self, to) } fn render (&self, to: &mut E::Output) { Content::render(self, to) } }