pub struct CacheManager { /* private fields */ }Expand description
Cache manager for handling all cache operations.
Implementations§
Source§impl CacheManager
impl CacheManager
Sourcepub fn policy(&self) -> &CachePolicy
pub fn policy(&self) -> &CachePolicy
Returns a reference to the cache policy.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Returns current cache statistics.
Sourcepub fn new(
policy: CachePolicy,
workspace_root: impl AsRef<Path>,
) -> Result<Self, CrossBuildError>
pub fn new( policy: CachePolicy, workspace_root: impl AsRef<Path>, ) -> Result<Self, CrossBuildError>
Creates a new cache manager.
Sourcepub fn get_download(&self, url: &str, checksum: Option<&str>) -> Option<PathBuf>
pub fn get_download(&self, url: &str, checksum: Option<&str>) -> Option<PathBuf>
Gets the path for a cached download.
Sourcepub fn store_download(
&mut self,
url: &str,
checksum: Option<&str>,
source_path: &Path,
) -> Result<PathBuf, CrossBuildError>
pub fn store_download( &mut self, url: &str, checksum: Option<&str>, source_path: &Path, ) -> Result<PathBuf, CrossBuildError>
Stores a downloaded file in the cache.
Sourcepub fn get_sysroot(
&self,
target: &TargetTriple,
provider: &str,
) -> Option<PathBuf>
pub fn get_sysroot( &self, target: &TargetTriple, provider: &str, ) -> Option<PathBuf>
Gets or creates a sysroot cache entry.
Sourcepub fn store_sysroot(
&mut self,
target: &TargetTriple,
provider: &str,
source_path: &Path,
) -> Result<PathBuf, CrossBuildError>
pub fn store_sysroot( &mut self, target: &TargetTriple, provider: &str, source_path: &Path, ) -> Result<PathBuf, CrossBuildError>
Stores a sysroot in the cache.
Sourcepub fn build_dir(&self, target: &TargetTriple) -> PathBuf
pub fn build_dir(&self, target: &TargetTriple) -> PathBuf
Gets the build directory for a target.
Sourcepub fn cleanup(&mut self) -> Result<CleanupReport, CrossBuildError>
pub fn cleanup(&mut self) -> Result<CleanupReport, CrossBuildError>
Cleans up old or excess cache entries.
Auto Trait Implementations§
impl Freeze for CacheManager
impl RefUnwindSafe for CacheManager
impl Send for CacheManager
impl Sync for CacheManager
impl Unpin for CacheManager
impl UnsafeUnpin for CacheManager
impl UnwindSafe for CacheManager
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
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