Skip to main content

Adapter

Trait Adapter 

Source
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§

Source

fn metadata(&self) -> &'static AdapterMetadata

Source

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.

Source

fn plan(&self, ctx: &PlanContext<'_>) -> Result<PlannedLaunch>

Reads the filesystem at most; never writes. Discovers the executable, then refuses case-only twins.

Provided Methods§

Source

fn presence(&self, root: &AppRoot, profile: &ProfileName) -> ProfilePresence

Reads the filesystem at most; never writes; never consults PATH or the executable (spec §8).

Source

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".

Implementors§