Skip to main content

execute

Function execute 

Source
pub fn execute(args: &NewArgs) -> Result<(), String>
Expand description

Execute the new command

Creates a new Dampen project directory with:

  • Cargo.toml with Dampen dependencies
  • src/main.rs with a complete Hello World application using auto-loading
  • src/ui/mod.rs - UI module
  • src/ui/window.rs - UI model and handlers with #[dampen_ui] macro
  • src/ui/window.dampen - Declarative UI definition (XML)
  • tests/integration.rs - Integration tests
  • README.md with comprehensive getting started instructions

§Arguments

  • args - Command arguments containing the project name

§Returns

  • Ok(()) - If project was created successfully
  • Err(String) - If creation failed with error message

§Errors

This function will return an error if:

  • The project name is invalid
  • A directory with the same name already exists
  • File system operations fail (e.g., permission denied)