mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: examples for the edn rendering
This commit is contained in:
parent
433e4df0f2
commit
174a7ee614
9 changed files with 51 additions and 30 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue