pub struct StandardPackageManager { /* private fields */ }
Expand description
Standard package manager implementation
This is a convenience implementation for package managers that follow common patterns. It provides sensible defaults and can be customized through configuration.
Implementations§
Source§impl StandardPackageManager
impl StandardPackageManager
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
ecosystem: Ecosystem,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, ecosystem: Ecosystem, ) -> Self
Create a new standard package manager
Sourcepub fn with_config_file(self, config_file: impl Into<String>) -> Self
pub fn with_config_file(self, config_file: impl Into<String>) -> Self
Add a configuration file that indicates this package manager should be used
Sourcepub fn with_install_command(self, command: Vec<String>) -> Self
pub fn with_install_command(self, command: Vec<String>) -> Self
Set custom install command
Sourcepub fn with_remove_command(self, command: Vec<String>) -> Self
pub fn with_remove_command(self, command: Vec<String>) -> Self
Set custom remove command
Sourcepub fn with_update_command(self, command: Vec<String>) -> Self
pub fn with_update_command(self, command: Vec<String>) -> Self
Set custom update command
Trait Implementations§
Source§impl VxPackageManager for StandardPackageManager
impl VxPackageManager for StandardPackageManager
Source§fn ecosystem(&self) -> Ecosystem
fn ecosystem(&self) -> Ecosystem
Ecosystem this package manager belongs to (required) Read more
Source§fn description(&self) -> &str
fn description(&self) -> &str
Description of the package manager (optional) Read more
Source§fn get_config_files(&self) -> Vec<&str>
fn get_config_files(&self) -> Vec<&str>
Get configuration files that indicate this package manager should be used Read more
Source§fn install_packages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
packages: &'life1 [PackageSpec],
project_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn install_packages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
packages: &'life1 [PackageSpec],
project_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Install packages (main method to implement) Read more
Source§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_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 Read more
Source§fn is_preferred_for_project(&self, project_path: &Path) -> bool
fn is_preferred_for_project(&self, project_path: &Path) -> bool
Check if this package manager should be used for a project Read more
Source§fn remove_packages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
project_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_packages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
project_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove packages Read more
Source§fn update_packages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
project_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_packages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
packages: &'life1 [String],
project_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update packages Read more
Source§fn list_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
project_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
project_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List installed packages Read more
Source§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 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 Read more
Source§fn run_command<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
command: &'life1 [&'life2 str],
args: &'life3 [String],
project_path: &'life4 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn run_command<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
command: &'life1 [&'life2 str],
args: &'life3 [String],
project_path: &'life4 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Run a package manager command with arguments Read more
Source§fn default_list_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
_project_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn default_list_packages<'life0, 'life1, 'async_trait>(
&'life0 self,
_project_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Default implementation for listing packages Read more
Source§fn run_search_command<'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 run_search_command<'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,
Default implementation for searching packages Read more
Source§fn get_config(&self) -> PackageManagerConfig
fn get_config(&self) -> PackageManagerConfig
Get package manager configuration Read more
Source§fn run_command_with_code<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
command: &'life1 [&'life2 str],
args: &'life3 [String],
project_path: &'life4 Path,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn run_command_with_code<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
command: &'life1 [&'life2 str],
args: &'life3 [String],
project_path: &'life4 Path,
) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Run a package manager command and return the exit code Read more
Auto Trait Implementations§
impl Freeze for StandardPackageManager
impl RefUnwindSafe for StandardPackageManager
impl Send for StandardPackageManager
impl Sync for StandardPackageManager
impl Unpin for StandardPackageManager
impl UnwindSafe for StandardPackageManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more