pub struct Db {
pub packages: Vec<MetaPackage>,
/* private fields */
}Fields§
§packages: Vec<MetaPackage>Implementations§
Source§impl Db
impl Db
Sourcepub fn sync_dbs(location: impl AsRef<Path>) -> Result<Vec<Db>, Error>
pub fn sync_dbs(location: impl AsRef<Path>) -> Result<Vec<Db>, Error>
Pass this "/var/lib/pacman". WIP: This is multithreaded, but
threads are hard and this is probably naive.
Sourcepub fn pkg(&self, pkgname: impl AsRef<str>) -> Option<&MetaPackage>
pub fn pkg(&self, pkgname: impl AsRef<str>) -> Option<&MetaPackage>
Get some package metadata from this Db. Helper function over this function’s source
Sourcepub fn provides(&self, provide: &Provide) -> bool
pub fn provides(&self, provide: &Provide) -> bool
Determines if a Provide is provided by this db.
let db = Db::local_db("/var/lib/pacman").unwrap();
// This indicates any version
db.provides(&Provide::parse("java-environment").unwrap());
// Version 8 only
db.provides(&Provide::parse("java-environment=8").unwrap());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Db
impl RefUnwindSafe for Db
impl Send for Db
impl Sync for Db
impl Unpin for Db
impl UnwindSafe for Db
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more