Skip to main content

evaluate_template_string

Function evaluate_template_string 

Source
pub fn evaluate_template_string(
    template: &str,
    state: &Value,
    item: Option<&Value>,
) -> Result<String, String>
Expand description

Evaluate a template string that may contain expressions

Handles strings like:

  • "Hello ${state.user.name}" - simple binding
  • "Color: ${state.selected ? '#FFA7E1' : '#374151'}" - expression
  • "${state.count} items" - mixed