generate_application

Function generate_application 

Source
pub fn generate_application(
    document: &DampenDocument,
    model_name: &str,
    message_name: &str,
    handlers: &[HandlerSignature],
) -> Result<CodegenOutput, CodegenError>
Expand description

Generate complete application code from a Dampen document

This is the main entry point for code generation. It orchestrates the generation of all necessary components.

§Arguments

  • document - Parsed Dampen document
  • model_name - Name of the model struct (e.g., “Model”)
  • message_name - Name of the message enum (e.g., “Message”)
  • handlers - List of handler signatures

§Returns

Ok(CodegenOutput) with generated code and warnings

§Errors

Returns CodegenError if:

  • Handler validation fails
  • Widget generation fails