pub struct CachePolicy {
pub root: PathBuf,
pub max_size_bytes: Option<u64>,
pub max_age: Option<Duration>,
pub compress: bool,
}Expand description
Cache policy configuration.
Fields§
§root: PathBuf§max_size_bytes: Option<u64>§max_age: Option<Duration>§compress: boolImplementations§
Source§impl CachePolicy
impl CachePolicy
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn with_max_size(self, bytes: u64) -> Self
pub fn with_max_age(self, age: Duration) -> Self
pub fn with_compression(self, compress: bool) -> Self
pub fn absolute_root(&self, workspace_root: &Path) -> PathBuf
pub fn cache_key(&self, workspace_root: &Path, target: &TargetTriple) -> String
pub fn download_dir(&self, workspace_root: &Path) -> PathBuf
pub fn sysroot_dir(&self, workspace_root: &Path) -> PathBuf
pub fn toolchain_dir(&self, workspace_root: &Path) -> PathBuf
pub fn build_dir(&self, workspace_root: &Path, target: &TargetTriple) -> PathBuf
pub fn metadata_path(&self, workspace_root: &Path) -> PathBuf
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§impl Debug for CachePolicy
impl Debug for CachePolicy
Source§impl Default for CachePolicy
impl Default for CachePolicy
Source§impl<'de> Deserialize<'de> for CachePolicy
impl<'de> Deserialize<'de> for CachePolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CachePolicy
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnsafeUnpin for CachePolicy
impl UnwindSafe for CachePolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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