pub struct System {
pub arch: SystemArch,
pub manager: Option<SystemPackageManager>,
pub os: SystemOS,
}
Expand description
Represents the current system, including architecture, operating system, and package manager information.
Fields§
§arch: SystemArch
Platform architecture.
manager: Option<SystemPackageManager>
Package manager.
os: SystemOS
Operating system.
Implementations§
Source§impl System
impl System
Sourcepub fn with_manager(manager: SystemPackageManager) -> Self
pub fn with_manager(manager: SystemPackageManager) -> Self
Create a new instance with the provided package manager.
Sourcepub fn get_install_package_command(
&self,
dep_config: &DependencyConfig,
interactive: bool,
) -> Result<Option<Vec<String>>, Error>
pub fn get_install_package_command( &self, dep_config: &DependencyConfig, interactive: bool, ) -> Result<Option<Vec<String>>, Error>
Return the command and arguments to “install a package” for the
current package manager. Will replace $
in an argument with the
dependency name, derived from [DependencyName
].
The DependencyConfig
must be filtered for the current operating
system and package manager beforehad.
Sourcepub fn get_install_packages_command(
&self,
dep_configs: &[DependencyConfig],
interactive: bool,
) -> Result<Option<Vec<String>>, Error>
pub fn get_install_packages_command( &self, dep_configs: &[DependencyConfig], interactive: bool, ) -> Result<Option<Vec<String>>, Error>
Return the command and arguments to “install many packages” for the
current package manager. Will replace $
in an argument with the
dependency name, derived from [DependencyName
].
The DependencyConfig
s must be filtered for the current operating
system and package manager beforehad.
Sourcepub fn get_list_packages_command(
&self,
interactive: bool,
) -> Result<Option<Vec<String>>, Error>
pub fn get_list_packages_command( &self, interactive: bool, ) -> Result<Option<Vec<String>>, Error>
Return the command and arguments to “list installed packages” for the current package manager.
Sourcepub fn get_update_index_command(
&self,
interactive: bool,
) -> Result<Option<Vec<String>>, Error>
pub fn get_update_index_command( &self, interactive: bool, ) -> Result<Option<Vec<String>>, Error>
Return the command and arguments to “update the registry index” for the current package manager.
Sourcepub fn resolve_dependencies(
&self,
deps: &[SystemDependency],
) -> Vec<DependencyConfig>
pub fn resolve_dependencies( &self, deps: &[SystemDependency], ) -> Vec<DependencyConfig>
Resolve and reduce the dependencies to a list that’s applicable to the current system.