wip: examples for the edn rendering

This commit is contained in:
🪞👃🪞 2025-01-05 04:25:31 +01:00
parent 433e4df0f2
commit 174a7ee614
9 changed files with 51 additions and 30 deletions

View file

@ -27,6 +27,9 @@ impl<E: Engine, C: Content<E>> Render<E> for C {
fn layout (&self, area: E::Area) -> E::Area { Content::layout(self, area) }
fn render (&self, output: &mut E::Output) { Content::render(self, output) }
}
impl<'a, E: Engine> Content<E> for Box<dyn Render<E> + 'a> {
fn content (&self) -> impl Render<E> { self }
}
impl<'a, E: Engine> Content<E> for Box<dyn Render<E> + Send + Sync + 'a> {
fn content (&self) -> impl Render<E> { self }
}
@ -74,6 +77,7 @@ impl<E: Engine, T: Content<E>> Content<E> for Option<T> {
}
}
#[macro_export] macro_rules! render {
(($self:ident:$Struct:ty) => $content:expr) => {
impl <E: Engine> Content<E> for $Struct {