Streamable templates
I found this issue: https://github.com/Keats/tera/issues/211 but it has been closed for the last 5 years without update.
So I wondered whether this is something that's still being considered. I think it makes a lot of sense to support streaming, both for better user experience in for example webserver responses, but most of all as it reduces RAM usage.
To be more precise: with streaming I mean that the renderer can take an iterator as input and loop over all items of the input to generate the template. The output of the renderer is then not a string, but something that implements the Write trait.
minijinja does support streaming for example, but I would prefer not to use minijinja for other reasons.
Does https://docs.rs/tera/latest/tera/struct.Tera.html#method.render_to not work for you?
Ah that solves the second part of my problem, but is there a way to pass variables of type iterator to the template's context? Like what happens here
No, not currently. It could maybe be added to v2 (https://github.com/Keats/tera2) but that would be a significant amount of work that I wouldn't have time to do myself
Ah okay, understandable, thanks for letting me know