pub trait Plugin: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn name(&self) -> &'static str;
fn supported_kinds(&self) -> &[ProjectKind];
fn markers(&self) -> Vec<ProjectMarker>;
fn detect(&self, path: &Path) -> Option<ProjectKind>;
fn find_artifacts(&self, project_root: &Path) -> Result<Vec<Artifact>>;
// Provided methods
fn calculate_size(&self, artifact: &Artifact) -> Result<u64> { ... }
fn pre_clean(&self, _artifact: &Artifact) -> Result<()> { ... }
fn post_clean(&self, _artifact: &Artifact) -> Result<()> { ... }
fn priority(&self) -> u8 { ... }
fn cleanable_dirs(&self) -> &[&'static str] { ... }
}Expand description
Trait that all language/framework plugins must implement
Required Methods§
Sourcefn supported_kinds(&self) -> &[ProjectKind]
fn supported_kinds(&self) -> &[ProjectKind]
Project kinds this plugin handles
Sourcefn markers(&self) -> Vec<ProjectMarker>
fn markers(&self) -> Vec<ProjectMarker>
Markers that identify projects this plugin handles
Sourcefn detect(&self, path: &Path) -> Option<ProjectKind>
fn detect(&self, path: &Path) -> Option<ProjectKind>
Detect if path is a project root for this plugin
Provided Methods§
Sourcefn calculate_size(&self, artifact: &Artifact) -> Result<u64>
fn calculate_size(&self, artifact: &Artifact) -> Result<u64>
Custom size calculation (override for special cases)
Sourcefn pre_clean(&self, _artifact: &Artifact) -> Result<()>
fn pre_clean(&self, _artifact: &Artifact) -> Result<()>
Pre-clean hook (e.g., stop running processes)
Sourcefn post_clean(&self, _artifact: &Artifact) -> Result<()>
fn post_clean(&self, _artifact: &Artifact) -> Result<()>
Post-clean hook (e.g., update state files)
Sourcefn cleanable_dirs(&self) -> &[&'static str]
fn cleanable_dirs(&self) -> &[&'static str]
Get cleanable directory names for fast scanning