Skip to main content

render_auto_with_spec

Function render_auto_with_spec 

Source
pub fn render_auto_with_spec<T: Serialize>(
    template: &str,
    data: &T,
    theme: &Theme,
    mode: OutputMode,
    spec: Option<&FlatDataSpec>,
) -> Result<String, Error>
Expand description

Auto-dispatches with granular control over structured output.

Similar to render_auto, but allows passing an optional FlatDataSpec. This is particularly useful for controlling CSV output structure (columns, headers) instead of relying on automatic JSON flattening.

ยงArguments

  • template - A minijinja template string
  • data - Any serializable data to render or serialize
  • theme - Theme definitions for the style filter
  • mode - Output mode determining the output format
  • spec - Optional FlatDataSpec for defining CSV/Table structure