pub struct Cache { /* private fields */ }Expand description
Provides access to a set of manifests describing packages.
Provides two primary operations:
- Self::lookup: Support for finding previously-built packages
- Self::update: Support for updating a package’s latest manifest
Implementations§
Source§impl Cache
impl Cache
Sourcepub async fn new(output_directory: &Utf8Path) -> Result<Self>
pub async fn new(output_directory: &Utf8Path) -> Result<Self>
Ensures the cache directory exists within the output directory
Sourcepub fn set_disable(&mut self, disable: bool)
pub fn set_disable(&mut self, disable: bool)
If “disable” is true, causes cache operations to be no-ops. Otherwise, causes the cache to act normally.
Sourcepub async fn lookup(
&self,
inputs: &BuildInputs,
output_path: &Utf8Path,
) -> Result<ArtifactManifest, CacheError>
pub async fn lookup( &self, inputs: &BuildInputs, output_path: &Utf8Path, ) -> Result<ArtifactManifest, CacheError>
Looks up an entry from the cache.
Confirms that the artifact exists.
Sourcepub async fn update(
&self,
inputs: &BuildInputs,
output_path: &Utf8Path,
) -> Result<(), CacheError>
pub async fn update( &self, inputs: &BuildInputs, output_path: &Utf8Path, ) -> Result<(), CacheError>
Updates an artifact’s entry within the cache
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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