Module render_common

Module render_common 

Source
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 for loops.

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
length may 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 e is a chain of .attr segments 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 loop variable object for for loops.
inject_loop
Reuses the same loop object 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 Value to an Iterable.
jinja_slice_array
Jinja-compat slice (nunjucks sliceLookup).
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 / length filters. Returns filter names in application order and the leaf expression.
try_dispatch_builtin
Dispatches builtin function calls (range, cycler, joiner).

Type Aliases§

ExtendsLayout
{% extends %} parent expression plus block name → AST bodies.