wip: fix(dsl): maybe getting somewhere?
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-06-21 13:48:45 +03:00
parent 91dc77cfea
commit 11f686650f
19 changed files with 964 additions and 918 deletions

View file

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