pub trait PackageManager: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn ecosystem(&self) -> Ecosystem;
fn install_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [PackageSpec],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_packages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn search_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_preferred_for_project(&self, project_path: &Path) -> bool;
fn get_config(&self) -> PackageManagerConfig;
fn run_command<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for package managers
Required Methods§
Sourcefn install_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [PackageSpec],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn install_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [PackageSpec],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Install packages
Sourcefn remove_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove packages
Sourcefn list_packages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_packages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List installed packages
Sourcefn search_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search for packages
Sourcefn update_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update packages
Sourcefn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if this package manager is available on the system
Sourcefn is_preferred_for_project(&self, project_path: &Path) -> bool
fn is_preferred_for_project(&self, project_path: &Path) -> bool
Check if this package manager is preferred for the given project
Sourcefn get_config(&self) -> PackageManagerConfig
fn get_config(&self) -> PackageManagerConfig
Get package manager configuration