use std::path::Path;
use anyhow::Result;
use crate::config::SastriConfig;
pub struct MechanismContext<'a> {
pub config: &'a SastriConfig,
pub root: &'a Path,
pub force: bool,
}
#[derive(Debug, Clone)]
pub struct GeneratedFile {
pub relative_path: String,
pub contents: String,
pub executable: bool,
}
#[derive(Debug, Clone)]
pub struct StepResult {
pub files: Vec<GeneratedFile>,
pub notes: Vec<String>,
}
pub trait Mechanism: Send + Sync {
fn id(&self) -> &'static str;
fn description(&self) -> &'static str;
fn stable(&self) -> bool {
true
}
fn wizard_hints(&self) -> Vec<&'static str> {
Vec::new()
}
fn generate(&self, ctx: &MechanismContext<'_>) -> Result<StepResult>;
}