Skip to main content

scaffold_plugin

Function scaffold_plugin 

Source
pub fn scaffold_plugin(
    name: &str,
    project_root: &Path,
    local_umbral_repo: Option<&Path>,
) -> Result<ScaffoldReport, ScaffoldError>
Expand description

Write a richer plugin scaffold at <project_root>/plugins/<name>/ targeted at distributable / reusable plugins (third-party crates you’d publish or share across projects). Layout:

plugins/<name>/
├── Cargo.toml         — deps: umbral, serde, sqlx, chrono, async-trait
├── README.md          — what this plugin does, how to wire it
└── src/
    ├── lib.rs         — Plugin trait impl, glues models + routes
    ├── models.rs      — one example Model showing common field types
    │                    (Text + max_length, Choice enum, optional DateTime)
    └── handlers.rs    — one example axum handler using AppContext

Contrast with scaffold_app, which writes a minimal skeleton (Cargo.toml + lib.rs with a stub Plugin impl, nothing else). Use startplugin when you’re building a plugin you intend to ship; use startapp for an internal module that just needs a Plugin seam.