pub struct UpdateCache { /* private fields */ }Expand description
Filesystem cache for resumable, opaque artifact downloads.
Implementations§
Source§impl UpdateCache
impl UpdateCache
Sourcepub fn open(
root: impl Into<PathBuf>,
options: CacheOptions,
) -> UpdateResult<Self>
pub fn open( root: impl Into<PathBuf>, options: CacheOptions, ) -> UpdateResult<Self>
Opens or creates a cache root and its bounded subdirectories.
Sourcepub fn stage(
&self,
verifier: &dyn ArtifactAuthenticityVerifier,
descriptor: &ArtifactDescriptor,
source: &dyn ArtifactSource,
transfer: &ArtifactTransferPolicy,
) -> UpdateResult<CachedArtifact>
pub fn stage( &self, verifier: &dyn ArtifactAuthenticityVerifier, descriptor: &ArtifactDescriptor, source: &dyn ArtifactSource, transfer: &ArtifactTransferPolicy, ) -> UpdateResult<CachedArtifact>
Stages one artifact, resuming a valid partial file when possible.
Sourcepub fn artifact_path(&self, descriptor: &ArtifactDescriptor) -> PathBuf
pub fn artifact_path(&self, descriptor: &ArtifactDescriptor) -> PathBuf
Returns the hash-addressed artifact path for a descriptor.
Sourcepub fn descriptor_path(&self, descriptor: &ArtifactDescriptor) -> PathBuf
pub fn descriptor_path(&self, descriptor: &ArtifactDescriptor) -> PathBuf
Returns the descriptor metadata path for a descriptor.
Sourcepub fn partial_path(&self, descriptor: &ArtifactDescriptor) -> PathBuf
pub fn partial_path(&self, descriptor: &ArtifactDescriptor) -> PathBuf
Returns the resumable partial path for a descriptor.
Trait Implementations§
Source§impl Clone for UpdateCache
impl Clone for UpdateCache
Auto Trait Implementations§
impl Freeze for UpdateCache
impl RefUnwindSafe for UpdateCache
impl Send for UpdateCache
impl Sync for UpdateCache
impl Unpin for UpdateCache
impl UnsafeUnpin for UpdateCache
impl UnwindSafe for UpdateCache
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