pub trait Adapter: Sync {
// Required methods
fn metadata(&self) -> &'static AdapterMetadata;
fn paths(
&self,
root: &AppRoot,
profile: &ProfileName,
) -> Vec<(PathBuf, PathKind)>;
fn plan(&self, ctx: &PlanContext<'_>) -> Result<PlannedLaunch>;
// Provided methods
fn presence(&self, root: &AppRoot, profile: &ProfileName) -> ProfilePresence { ... }
fn initialize(&self, planned: &PlannedLaunch) -> Result<()> { ... }
}Expand description
One supported coding agent (SP2 design §4.2).
Required Methods§
fn metadata(&self) -> &'static AdapterMetadata
Sourcefn paths(
&self,
root: &AppRoot,
profile: &ProfileName,
) -> Vec<(PathBuf, PathKind)>
fn paths( &self, root: &AppRoot, profile: &ProfileName, ) -> Vec<(PathBuf, PathKind)>
Pure: no filesystem access. Every path the adapter owns for profile, in creation order. The first
entry is always the adapter’s profile directory.
Sourcefn plan(&self, ctx: &PlanContext<'_>) -> Result<PlannedLaunch>
fn plan(&self, ctx: &PlanContext<'_>) -> Result<PlannedLaunch>
Reads the filesystem at most; never writes. Discovers the executable, then refuses case-only twins.
Provided Methods§
Sourcefn presence(&self, root: &AppRoot, profile: &ProfileName) -> ProfilePresence
fn presence(&self, root: &AppRoot, profile: &ProfileName) -> ProfilePresence
Reads the filesystem at most; never writes; never consults PATH or the executable (spec §8).
Sourcefn initialize(&self, planned: &PlannedLaunch) -> Result<()>
fn initialize(&self, planned: &PlannedLaunch) -> Result<()>
Ensures every path in planned.paths, in order; idempotent; never overwrites a file (spec §9, §9.1).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".