Struct system_env::System
source · pub struct System {
pub arch: SystemArch,
pub manager: SystemPackageManager,
pub os: SystemOS,
}
Expand description
Represents the current system, including architecture, operating system, and package manager information.
Fields§
§arch: SystemArch
Platform architecture.
manager: 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<Vec<String>, Error>
pub fn get_install_package_command( &self, dep_config: &DependencyConfig, interactive: bool ) -> Result<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
].
sourcepub fn get_update_index_command(&self, interactive: bool) -> Option<Vec<String>>
pub fn get_update_index_command(&self, interactive: bool) -> Option<Vec<String>>
Return the command and arguments to “update the registry index” for the current package manager.
sourcepub fn resolve_dependencies(
&self,
deps: Vec<SystemDependency>
) -> Vec<DependencyConfig>
pub fn resolve_dependencies( &self, deps: Vec<SystemDependency> ) -> Vec<DependencyConfig>
Resolve and reduce the dependencies to a list that’s applicable to the current system.
Auto Trait Implementations§
impl RefUnwindSafe for System
impl Send for System
impl Sync for System
impl Unpin for System
impl UnwindSafe for System
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