pub trait EcosystemAdapter: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn detect(&self, worktree_path: &Path) -> bool;
fn setup(
&self,
worktree_path: &Path,
source_worktree: &Path,
) -> Result<(), WorktreeError>;
fn teardown(&self, worktree_path: &Path) -> Result<(), WorktreeError>;
// Provided method
fn branch_name(&self, input: &str) -> String { ... }
}Expand description
Trait for language/framework-specific setup in new worktrees.
Required Methods§
Sourcefn detect(&self, worktree_path: &Path) -> bool
fn detect(&self, worktree_path: &Path) -> bool
Return true if this adapter should run for the given worktree path. Called during auto-detection. Inspect package.json, Cargo.toml, etc.
Provided Methods§
Sourcefn branch_name(&self, input: &str) -> String
fn branch_name(&self, input: &str) -> String
Optionally transform the branch name before use. Default: identity (no transformation). The core library NEVER calls this internally. Only adapters that opt in use it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".