Comments (3)
This example shows how you can invoke async functions in your templates: https://github.com/mitsuhiko/minijinja/blob/main/examples/object-using-async/src/main.rs
What call_method
there is doing you can also do in a function added with add_function
. You would however need to pass the handle by other means.
from minijinja.
I added a better example here: https://github.com/mitsuhiko/minijinja/blob/main/examples/function-using-async/src/main.rs
from minijinja.
Dear author, hello. I was unsuccessful in trying under activx_web because I wanted the template to be able to automatically reload and also have the add_function to call asynchronous functions. As I have just started working with this engine, it is challenging for beginners to write an example that can both automatically reload templates and call asynchronous functions. If you have time, I hope you can provide an example of activx_web to facilitate our learning. Thank you very much for your prompt reply. Thank you
from minijinja.
Related Issues (20)
- Don't allocate to `reverse` HOT 1
- 2.0: One-Shot vs Repeatable Iteration
- 2.0: Rename Value::from_serializable HOT 1
- 2.0: Make Syntax extensible and move whitespace control into it
- `Object::len()` and `Object::is_empty()` conflict with inherent `len()`, `is_empty()` HOT 1
- 2.0: Investigate Performance Regressions HOT 2
- Add Protection Against Buffering
- `undeclared_variables()` stuck with `for loop` ({% for ... in ... %})
- String concatenation without "+" operator HOT 1
- Fallible Iteration
- set_lstrip_blocks should not apply to expressions, only to blocks.
- Custom time format strings HOT 5
- UndefinedBehavior::Strict and undefined key in mapping HOT 4
- Option to always chomp whitespace HOT 3
- async support for Object trait HOT 1
- Add support for the `*` operator HOT 2
- Rendering template using yaml data file containing anchors HOT 4
- actix_web使用的时候正确使用示例有吗?
- nanoserde HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minijinja.