rust-sailfish / sailfish

Simple, small, and extremely fast template engine for Rust
https://rust-sailfish.github.io/sailfish/
MIT License
829 stars 56 forks source link

Rendering trait objects #122

Closed aalowlevel closed 1 year ago

aalowlevel commented 1 year ago

Hello. I have a question. Considering this example:

    #[derive(TemplateOnce)]
    #[template(path = "my_component.stpl")]
    pub struct MyComponent {
        sub: Box<dyn TemplateOnce>
    }

give this error:

the trait `sailfish::TemplateOnce` cannot be made into an object
the trait cannot be made into an object because it requires `Self: Sized`

Is there any way to render trait objects?