Skip to main content

load_stack_spec

Function load_stack_spec 

Source
pub fn load_stack_spec(
    json: &str,
) -> Result<SerializableStackSpec, VersionedLoadError>
Expand description

Load a stack spec from JSON with automatic version detection and migration.

This function:

  1. Detects the AST version from the JSON
  2. Deserializes the appropriate version
  3. Migrates to the latest format if needed

§Arguments

  • json - The JSON string containing the AST

§Returns

The deserialized and migrated SerializableStackSpec

§Example

let json = std::fs::read_to_string("MyStack.stack.json")?;
let spec = load_stack_spec(&json)?;