Skip to main content

Database

Struct Database 

Source
pub struct Database { /* private fields */ }
Expand description

Every installed package, with indexes by provided name and by file.

Implementations§

Source§

impl Database

Source

pub fn closure(&self, root: &str, optional: &[String]) -> Closure

The transitive depends closure of root and of every package named in optional, plus every optional dependency so named, resolved through provides. Naming a package nothing depends on, a Vulkan driver say, is how it enters at all.

Source

pub fn closure_excluding( &self, root: &str, optional: &[String], excluded: &BTreeSet<String>, ) -> Closure

As Self::closure, with excluded packages treated as absent: neither they nor what only they depend on enter.

Source

pub fn files_of(&self, closure: &Closure) -> Vec<String>

Every file owned by the packages in closure, sorted.

Source§

impl Database

Source

pub fn read(root: &Path) -> Result<Self>

Read the database of the sysroot at root.

Source

pub fn insert(&mut self, package: Package)

Add a package, indexing what it provides and owns. Later packages never displace an earlier owner of the same file.

Source

pub fn package(&self, name: &str) -> Option<&Package>

Source

pub fn packages(&self) -> impl Iterator<Item = &Package>

Source

pub fn owner(&self, path: &str) -> Option<&Package>

The package owning path, given relative to the root.

Source

pub fn satisfier(&self, name: &str) -> Option<&Package>

The package satisfying a dependency name: the package itself, or the first provider of a virtual name.

Trait Implementations§

Source§

impl Debug for Database

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Database

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.