pub struct PackageManager { /* private fields */ }Expand description
Installs collection package versions into versioned directories.
Implementations§
Source§impl PackageManager
impl PackageManager
pub fn new(root: impl Into<PathBuf>, db: NodeDatabase) -> Self
pub fn root(&self) -> &Path
Sourcepub fn state(&self) -> Result<CollectionState>
pub fn state(&self) -> Result<CollectionState>
§Errors
Returns an error if state cannot be read or decoded.
Sourcepub fn available_versions(&self) -> Result<BTreeMap<Uuid, Version>>
pub fn available_versions(&self) -> Result<BTreeMap<Uuid, Version>>
Return the currently selected version for each installed collection.
§Errors
Returns an error if an installed version is not valid semver.
Sourcepub fn install(
&self,
manifest: &CollectionManifest,
source: impl AsRef<Path>,
) -> Result<()>
pub fn install( &self, manifest: &CollectionManifest, source: impl AsRef<Path>, ) -> Result<()>
Stage, verify, and atomically make a collection version current.
§Errors
Returns an error when source content does not match the manifest or installation fails.
Sourcepub async fn install_from_ticket(
&self,
manifest_ticket: &BlobTicket,
endpoint: &Endpoint,
blobs: &BlobStore,
) -> Result<CollectionManifest>
pub async fn install_from_ticket( &self, manifest_ticket: &BlobTicket, endpoint: &Endpoint, blobs: &BlobStore, ) -> Result<CollectionManifest>
Fetch a manifest and all of its content blobs, then install it atomically.
§Errors
Returns an error if a ticket, manifest, content blob, or installation step is invalid.
Sourcepub fn switch(
&self,
collection_id: Uuid,
requested_version: impl AsRef<str>,
) -> Result<()>
pub fn switch( &self, collection_id: Uuid, requested_version: impl AsRef<str>, ) -> Result<()>
§Errors
Returns an error if the requested version is not installed or the active link cannot be switched.
Trait Implementations§
Source§impl Clone for PackageManager
impl Clone for PackageManager
Source§fn clone(&self) -> PackageManager
fn clone(&self) -> PackageManager
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 PackageManager
impl RefUnwindSafe for PackageManager
impl Send for PackageManager
impl Sync for PackageManager
impl Unpin for PackageManager
impl UnsafeUnpin for PackageManager
impl UnwindSafe for PackageManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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