Skip to main content

expand_str_to_string

Function expand_str_to_string 

Source
pub fn expand_str_to_string(spec: &str) -> Result<String, CodegenError>
Expand description

Parse, validate, emit, and pretty-print the Rust code for a DSL string.

This is convenient when you want stable, human-readable source for inspection or to write to disk with expand_str_to_file.

§Parameters

  • spec: The graph DSL as a UTF-8 string. It must contain exactly one graph definition.

§Returns

  • Ok(String): Formatted Rust source for the generated graph.
  • Err(CodegenError): If parsing, validation, emission, or pretty-printing fails.

§Errors

Returns: