Trait Environment

Source
pub trait Environment: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn get_tool_version(&self, tool_name: &str) -> Option<String>;
    fn set_tool_version(
        &mut self,
        tool_name: &str,
        version: String,
    ) -> Result<()>;
    fn get_environment_path(&self) -> PathBuf;
    fn activate(&self) -> Result<ToolContext>;
    fn list_tools(&self) -> Result<HashMap<String, String>>;
}
Expand description

Virtual environment management interface

Required Methods§

Source

fn name(&self) -> &str

Get environment name

Source

fn get_tool_version(&self, tool_name: &str) -> Option<String>

Get tool version for this environment

Source

fn set_tool_version(&mut self, tool_name: &str, version: String) -> Result<()>

Set tool version for this environment

Source

fn get_environment_path(&self) -> PathBuf

Get environment directory path

Source

fn activate(&self) -> Result<ToolContext>

Activate this environment and return tool context

Source

fn list_tools(&self) -> Result<HashMap<String, String>>

List all tools configured in this environment

Implementors§