pub struct PackageState {
pub protected: BTreeSet<PackageName>,
pub pubkeys: BTreeMap<String, PublicKeyFile>,
pub installed: BTreeMap<PackageName, InstallState>,
}Expand description
Contains current user packages state
Fields§
§protected: BTreeSet<PackageName>list of can’t be accidentally uninstalled packages
pubkeys: BTreeMap<String, PublicKeyFile>installed public keys per remote name. using pkgar_keys as a wrapper of dryoc public key.
installed: BTreeMap<PackageName, InstallState>install state per packages
Implementations§
Source§impl PackageState
impl PackageState
pub fn from_toml(text: &str) -> Result<Self, Error>
pub fn to_toml(&self) -> String
Sourcepub fn install(&mut self, packages: &[RemotePackage]) -> Vec<PackageName>
pub fn install(&mut self, packages: &[RemotePackage]) -> Vec<PackageName>
Returns list of packages that need to be resolved, which are not yet added to the package config. If zero vector returned, it means all package deps are satisfied
Sourcepub fn uninstall(&mut self, packages: &[PackageName]) -> Vec<PackageName>
pub fn uninstall(&mut self, packages: &[PackageName]) -> Vec<PackageName>
Returns list of packages that also need to be resolved, which are not all of their deps is listed in list of packages. If zero vector returned, it means uninstallation can be executed.
pub fn diff(&self, newer: &Self) -> PackageList
pub fn get_installed_list(&self) -> Vec<PackageName>
Sourcepub fn mark_as_manual(
&mut self,
manual: bool,
packages: &[PackageName],
) -> Vec<PackageName>
pub fn mark_as_manual( &mut self, manual: bool, packages: &[PackageName], ) -> Vec<PackageName>
Mark packages manually installed or not. Returns list of changed packages. PackageState are not marked automatically in any install mechanism.
Trait Implementations§
Source§impl Clone for PackageState
impl Clone for PackageState
Source§fn clone(&self) -> PackageState
fn clone(&self) -> PackageState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackageState
impl Debug for PackageState
Source§impl Default for PackageState
impl Default for PackageState
Source§impl<'de> Deserialize<'de> for PackageStatewhere
PackageState: Default,
impl<'de> Deserialize<'de> for PackageStatewhere
PackageState: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PackageState
impl RefUnwindSafe for PackageState
impl Send for PackageState
impl Sync for PackageState
impl Unpin for PackageState
impl UnsafeUnpin for PackageState
impl UnwindSafe for PackageState
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