output: more big refactors

This commit is contained in:
🪞👃🪞 2025-09-07 12:34:30 +03:00
parent 194f2f9874
commit 5e6338fad8
68 changed files with 1604 additions and 1016 deletions

View file

@ -77,12 +77,12 @@ impl ViewDef {
quote! {
/// Generated by [tengri_proc].
///
/// Makes [#self_ty] able to construct the [Render]able
/// Makes [#self_ty] able to construct the [Draw]able
/// which might correspond to a given [TokenStream],
/// while taking [#self_ty]'s state into consideration.
impl<'state> ::tengri::dsl::DslInto<Box<dyn ::tengri::output::Render<#output> + 'state>> for #self_ty {
impl<'state> ::tengri::dsl::DslInto<Box<dyn ::tengri::output::Draw<#output> + 'state>> for #self_ty {
fn dsl_into (&self, dsl: &impl ::tengri::dsl::Dsl)
-> Perhaps<Box<dyn ::tengri::output::Render<#output> + 'state>>
-> Perhaps<Box<dyn ::tengri::output::Draw<#output> + 'state>>
{
#(#builtins)*
if let Some(sym) = dsl.sym()? {
@ -128,9 +128,9 @@ fn _builtins_with_holes () -> impl Iterator<Item=(Builtin, TokenStream2)> {
}
fn _builtins_with_boxes () -> impl Iterator<Item=(Builtin, TokenStream2)> {
builtins_with(quote! { _ }, quote! { Box<dyn Render<_>> })
builtins_with(quote! { _ }, quote! { Box<dyn Draw<_>> })
}
fn builtins_with_boxes_output (o: TokenStream2) -> impl Iterator<Item=(Builtin, TokenStream2)> {
builtins_with(quote! { _ }, quote! { Box<dyn Render<#o>> })
builtins_with(quote! { _ }, quote! { Box<dyn Draw<#o>> })
}