Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any way to pass context as parameters? #668

Open
TheTechRobo opened this issue Sep 9, 2021 · 1 comment
Open

any way to pass context as parameters? #668

TheTechRobo opened this issue Sep 9, 2021 · 1 comment

Comments

@TheTechRobo
Copy link

I'm using Rocket and one issue I've noticed with Tera is that I need to make a BTreeMap or HashMap or similar to pass variables. This is a problem because I have mismatched types in that hashmap.

I've tried using Box as per https://www.simonewebdesign.it/rust-hashmap-insert-values-multiple-types/, but that doesn't seem to be serialisable. I also don't really understand emums. Can I pass the variables as parameters? Thanks!

@Keats
Copy link
Owner

Keats commented Sep 9, 2021

The context takes anything that impl Serialize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants