mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-28 13:06:56 +02:00
output: more big refactors
This commit is contained in:
parent
194f2f9874
commit
5e6338fad8
68 changed files with 1604 additions and 1016 deletions
|
|
@ -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>> })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue