pub struct PackageDatabase { /* private fields */ }Implementations§
Source§impl PackageDatabase
impl PackageDatabase
pub fn open(package_database_path: &Path) -> Result<Self>
pub fn database_path_for(package_database_path: &Path) -> PathBuf
pub fn schema_version(&self) -> Result<u32>
pub fn package_exists(&self, name: &str) -> Result<bool>
pub fn get_package(&self, name: &str) -> Result<Option<Package>>
pub fn list_packages(&self) -> Result<Vec<Package>>
pub fn upsert_package(&mut self, package: &Package) -> Result<()>
pub fn replace_all_packages(&mut self, packages: &[Package]) -> Result<()>
pub fn remove_package(&mut self, name: &str) -> Result<bool>
pub fn update_package<F>(&mut self, name: &str, update: F) -> Result<bool>
pub fn rename_package(&mut self, old_name: &str, new_name: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for PackageDatabase
impl Clone for PackageDatabase
Source§fn clone(&self) -> PackageDatabase
fn clone(&self) -> PackageDatabase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PackageDatabase
impl RefUnwindSafe for PackageDatabase
impl Send for PackageDatabase
impl Sync for PackageDatabase
impl Unpin for PackageDatabase
impl UnsafeUnpin for PackageDatabase
impl UnwindSafe for PackageDatabase
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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