Skip to main content

TextGeneratorNode

Trait TextGeneratorNode 

Source
pub trait TextGeneratorNode {
    // Required method
    fn generate_text(
        &self,
        state: &mut RenderState<'_>,
    ) -> Result<String, RenderError>;
}
Expand description

A renderable text-generating piece of a compiled rule.

Nodes are produced from config values, template expressions, and template statements. Text generation is driven by RenderState, which carries the rule table, bound variables, RNG, and rule call stack for cycle detection.

Required Methods§

Source

fn generate_text( &self, state: &mut RenderState<'_>, ) -> Result<String, RenderError>

Generates text using the supplied render state.

Implementations on Foreign Types§

Source§

impl TextGeneratorNode for String

Literal text node.

String is used for plain template spans such as "Hello " and for scalar config values that do not need further expansion. Rendering returns the string unchanged.

Source§

fn generate_text( &self, _state: &mut RenderState<'_>, ) -> Result<String, RenderError>

Implementors§