pub struct Inventory { /* private fields */ }Expand description
A snapshot of the machine’s packages.
Implementations§
Source§impl Inventory
impl Inventory
Sourcepub fn gather_for(manager: Option<PackageManager>) -> Self
pub fn gather_for(manager: Option<PackageManager>) -> Self
Read this machine, whose packages manager keeps.
Sourcepub fn from_parts(
manager: Option<PackageManager>,
native: Option<HashMap<String, String>>,
native_updates: HashMap<String, String>,
flatpaks: HashMap<String, String>,
flatpak_updates: HashSet<String>,
) -> Self
pub fn from_parts( manager: Option<PackageManager>, native: Option<HashMap<String, String>>, native_updates: HashMap<String, String>, flatpaks: HashMap<String, String>, flatpak_updates: HashSet<String>, ) -> Self
An inventory from known facts, for tests.
Sourcepub fn with_owners(self, owners: HashMap<PathBuf, String>) -> Self
pub fn with_owners(self, owners: HashMap<PathBuf, String>) -> Self
The same, with which package owns each file fixed, for tests.
Sourcepub fn holds(&self, probe: &Probe) -> bool
pub fn holds(&self, probe: &Probe) -> bool
Whether a probe holds, answered from the snapshot where it can be, and by asking the machine where it cannot (families not read).
Sourcepub fn version(&self, probe: &Probe) -> Option<String>
pub fn version(&self, probe: &Probe) -> Option<String>
A package’s installed version, when the snapshot has it.
Sourcepub fn plan_update<'a>(
&self,
entries: impl IntoIterator<Item = &'a Entry>,
platform: &LinuxInfo,
on_path: &dyn Fn(&str) -> Option<PathBuf>,
) -> Plan
pub fn plan_update<'a>( &self, entries: impl IntoIterator<Item = &'a Entry>, platform: &LinuxInfo, on_path: &dyn Fn(&str) -> Option<PathBuf>, ) -> Plan
Plan updating entries: each package with a newer version through its own package manager or Flatpak, and on Arch one update of the whole system for all of them, since pacman does not support updating one package alone. Entries with nothing to update become notes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Inventory
impl RefUnwindSafe for Inventory
impl Send for Inventory
impl Sync for Inventory
impl Unpin for Inventory
impl UnsafeUnpin for Inventory
impl UnwindSafe for Inventory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.