Expand description
Shared pure-computation helpers used by both the synchronous crate::renderer
and the asynchronous [crate::async_renderer] (when the async feature is enabled).
These functions have no &mut state dependencies and can be called from any context.
Enums§
- Iterable
- Iteration abstraction for
forloops.
Functions§
- add_
like_ js - Handles
+operator: numeric add or string concat. - apply_
builtin_ filter_ chain_ on_ cow_ value - Applies a chain of builtin filters on a Cow value.
- as_
number - Numeric coercion: number, string parse, bool → 0/1.
- builtin_
filter_ chain_ application_ order_ valid lengthmay only appear as the final step.- can_
dispatch_ builtin_ check - Checks if a name can be dispatched as a builtin function.
- collect_
attr_ chain_ from_ getattr - If
eis a chain of.attrsegments on a plain variable (foo.bar.baz), returns the root name and path segments in order. - compare_
values - Comparison operators.
- eval_in
- Implements membership test: array element, string substring, object key.
- fill_
loop_ object - Fills a
loopvariable object forforloops. - inject_
loop - Reuses the same
loopobject map in the innermost frame when possible. - is_
test_ parts - Right-hand side of
is: identifier, string/null literal, or call (equalto(3)). - is_
truthy - Nunjucks truthiness:
null,false,0/NaN, and""are falsy. - iterable_
empty - Checks if an iterable is empty.
- iterable_
from_ value - Converts a
Valueto anIterable. - jinja_
slice_ array - Jinja-compat slice (
nunjuckssliceLookup). - json_
num - Converts float to int if no fractional part.
- json_
partial_ cmp - Partial ordering for numbers and strings.
- peel_
builtin_ upper_ lower_ length_ chain - Peels a chain of built-in
upper/lower/capitalize/trim/lengthfilters. Returns filter names in application order and the leaf expression. - try_
dispatch_ builtin - Dispatches builtin function calls (
range,cycler,joiner).
Type Aliases§
- Extends
Layout {% extends %}parent expression plus block name → AST bodies.