pub struct Store<S, B, const BAR: bool = true> { /* private fields */ }
Expand description
A Store that contains all the packages installed by any user Content Addressable Store
Implementations
sourceimpl Store<(), MemoryBackend>
impl Store<(), MemoryBackend>
pub fn init() -> Result<Self, StoreError>
sourceimpl<B: ReadBackend<Source = Url>> Store<Url, B>
impl<B: ReadBackend<Source = Url>> Store<Url, B>
pub fn open(url: Url) -> Result<Self, StoreError>
sourceimpl<B: ReadBackend<Source = PathBuf>> Store<PathBuf, B>
impl<B: ReadBackend<Source = PathBuf>> Store<PathBuf, B>
sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, StoreError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, StoreError>
Opens a store under the specified path. Returns an error if the path does not exists or does not contain the necessary files
sourcepub fn link_package(
&self,
package_id: &PackageId,
to: &ComponentPathBuf
) -> Result<(), StoreError>
pub fn link_package(
&self,
package_id: &PackageId,
to: &ComponentPathBuf
) -> Result<(), StoreError>
Links only the package at the specified path. If the package itself has object linked to other packages, link to the link.
sourcepub fn link_packages<'a>(
&self,
indices: impl IntoIterator<Item = &'a PackageId>,
to: &ComponentPathBuf
) -> Result<(), StoreError>
pub fn link_packages<'a>(
&self,
indices: impl IntoIterator<Item = &'a PackageId>,
to: &ComponentPathBuf
) -> Result<(), StoreError>
Links all the packages to the specified path.
sourceimpl<B: WriteBackend<Source = PathBuf>> Store<PathBuf, B>
impl<B: WriteBackend<Source = PathBuf>> Store<PathBuf, B>
sourceimpl<S, B: ReadBackend, const BAR: bool> Store<S, B, BAR>
impl<S, B: ReadBackend, const BAR: bool> Store<S, B, BAR>
pub fn packages(&self) -> &Packages
pub fn objects(&self) -> &Objects
pub fn matches<'a>(
&'a self,
requirement: &'a Requirement
) -> impl Iterator<Item = (&'a PackageId, &'a Derivation, impl Iterator<Item = &'a Blob>)> + '_
pub fn is_matching(
&self,
package_id: &PackageId,
requirement: &Requirement
) -> bool
pub fn get_blobs_of_package<'a>(
&'a self,
package_id: &PackageId
) -> Option<impl Iterator<Item = &'a Blob>>
pub fn get_blobs_cloned_of_package(
&self,
package_id: &PackageId
) -> Option<impl Iterator<Item = Blob> + '_>
sourceimpl<S, B: WriteBackend, const BAR: bool> Store<S, B, BAR>
impl<S, B: WriteBackend, const BAR: bool> Store<S, B, BAR>
pub fn objects_mut(&mut self) -> &mut Objects
pub fn packages_mut(&mut self) -> &mut Packages
sourceimpl<B: WriteBackend<Source = PathBuf> + ReadBackend<Source = PathBuf>, const BAR: bool> Store<PathBuf, B, BAR>
impl<B: WriteBackend<Source = PathBuf> + ReadBackend<Source = PathBuf>, const BAR: bool> Store<PathBuf, B, BAR>
pub fn insert_remote(
&mut self,
source: RemotePackageSource
) -> Result<PathBuf, StoreError>
sourcepub fn insert(
&mut self,
source: LocalPackageSource
) -> Result<PathBuf, StoreError>
pub fn insert(
&mut self,
source: LocalPackageSource
) -> Result<PathBuf, StoreError>
Inserts a package into the store and returns true if the package was not present and was inserted and false if it was already present.
pub fn extend<'a>(
&'a mut self,
packages: impl IntoIterator<Item = LocalPackageSource> + 'a
) -> impl Iterator<Item = Result<PathBuf, StoreError>> + 'a
sourcepub fn remove_unused(
&mut self,
user_manager: &UserManager
) -> Result<Vec<PackageId>, StoreError>
pub fn remove_unused(
&mut self,
user_manager: &UserManager
) -> Result<Vec<PackageId>, StoreError>
Remove all packages that are currently unused in all generations.
sourcepub fn flush(self) -> Result<(), StoreError>
pub fn flush(self) -> Result<(), StoreError>
Flushes all data to the backend
Trait Implementations
Auto Trait Implementations
impl<S, B, const BAR: bool> RefUnwindSafe for Store<S, B, BAR> where
B: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, B, const BAR: bool> Send for Store<S, B, BAR> where
B: Send,
S: Send,
impl<S, B, const BAR: bool> Sync for Store<S, B, BAR> where
B: Sync,
S: Sync,
impl<S, B, const BAR: bool> Unpin for Store<S, B, BAR> where
B: Unpin,
S: Unpin,
impl<S, B, const BAR: bool> UnwindSafe for Store<S, B, BAR> where
B: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more