pub struct ArtifactCacheSpec { /* private fields */ }Expand description
Complete caller-owned description of one transactional artifact set.
Declared inputs and tools must not be located inside cache_root. Output
destinations must remain outside it, resolve to distinct paths, and not
overlap a declared input or tool. Cargo-derived cache/output paths must
likewise remain outside resolved inputs unless covered by their exact
generated-state exclusions.
Implementations§
Source§impl ArtifactCacheSpec
impl ArtifactCacheSpec
Sourcepub fn new(cache_root: &Path, namespace: &str, recipe_id: &str) -> Self
pub fn new(cache_root: &Path, namespace: &str, recipe_id: &str) -> Self
Describe one external artifact recipe using non-secret stable identifiers.
The namespace selects an independent content store. recipe_id must be
bumped whenever undeclared pipeline semantics change. The default
coordination scope is the namespace.
Sourcepub fn with_coordination_scope(self, coordination_scope: &str) -> Self
pub fn with_coordination_scope(self, coordination_scope: &str) -> Self
Serialize recipes that share caller-owned mutable external build state.
Sourcepub fn with_input(self, label: &str, path: &Path) -> Self
pub fn with_input(self, label: &str, path: &Path) -> Self
Add one exact input file or directory outside the cache root under a stable label.
Sourcepub fn with_tool(self, label: &str, path: &Path) -> Self
pub fn with_tool(self, label: &str, path: &Path) -> Self
Add one exact executable or tool path outside the cache root under a stable label.
Sourcepub fn with_arguments(self, arguments: &[&str]) -> Self
pub fn with_arguments(self, arguments: &[&str]) -> Self
Set ordered command arguments that contribute to the content key.
Sourcepub fn with_arguments_os<I, S>(self, arguments: I) -> Self
pub fn with_arguments_os<I, S>(self, arguments: I) -> Self
Set OS-native ordered command arguments that contribute to the content key.
Sourcepub fn with_environment(self, environment: &[(&str, &str)]) -> Self
pub fn with_environment(self, environment: &[(&str, &str)]) -> Self
Set environment values that contribute to the content key.
Sourcepub fn with_environment_os<I, K, V>(self, environment: I) -> Self
pub fn with_environment_os<I, K, V>(self, environment: I) -> Self
Set OS-native environment values that contribute to the content key.
Sourcepub fn with_unset_environment(self, names: &[&str]) -> Self
pub fn with_unset_environment(self, names: &[&str]) -> Self
Record environment variables whose unset state contributes to the content key.
Sourcepub fn with_unset_environment_os<I, S>(self, names: I) -> Self
pub fn with_unset_environment_os<I, S>(self, names: I) -> Self
Record OS-native environment names whose unset state contributes to the content key.
Sourcepub fn with_identity_bytes(self, label: &str, value: &[u8]) -> Self
pub fn with_identity_bytes(self, label: &str, value: &[u8]) -> Self
Add opaque non-secret identity bytes under a stable logical label.
Sourcepub fn with_cargo_build_inputs(
self,
label: &str,
build_spec: &WasmBuildSpec,
resolved: &ResolvedCargoBuildInputs,
) -> Self
pub fn with_cargo_build_inputs( self, label: &str, build_spec: &WasmBuildSpec, resolved: &ResolvedCargoBuildInputs, ) -> Self
Add one exact Cargo input snapshot as transactional cache identity and guard.
The resolved fingerprint keys toolchain, arguments, environment and the dependency closure. Its Cargo-aware source/configuration paths and exclusions are rehashed automatically during preparation, cache-hit materialization and transaction commit.
Sourcepub fn with_output(self, name: &str, destination: &Path) -> Self
pub fn with_output(self, name: &str, destination: &Path) -> Self
Declare one nonempty regular-file output and its nonoverlapping public destination.
Sourcepub fn with_output_validation(
self,
name: &str,
destination: &Path,
validation: ArtifactOutputValidation,
) -> Self
pub fn with_output_validation( self, name: &str, destination: &Path, validation: ArtifactOutputValidation, ) -> Self
Declare one output, nonoverlapping public destination, and validation policy.
Sourcepub const fn with_prune_policy(self, policy: ArtifactCachePrunePolicy) -> Self
pub const fn with_prune_policy(self, policy: ArtifactCachePrunePolicy) -> Self
Apply best-effort retention while protecting the acquired entry.
Sourcepub const fn with_prune_policy_at_most_every(
self,
policy: ArtifactCachePrunePolicy,
minimum_interval: Duration,
) -> Self
pub const fn with_prune_policy_at_most_every( self, policy: ArtifactCachePrunePolicy, minimum_interval: Duration, ) -> Self
Apply retention at most once per minimum_interval for this namespace.
The small due-marker check still occurs under the namespace lock.
Successful acquisitions skip the directory scan until the interval has
elapsed. The interval applies to attempted maintenance, including a
nonfatal failed attempt. A zero interval is equivalent to
Self::with_prune_policy.
Sourcepub fn cache_root(&self) -> &Path
pub fn cache_root(&self) -> &Path
Caller-selected root containing cache data and coordination locks.
Trait Implementations§
Source§impl Clone for ArtifactCacheSpec
impl Clone for ArtifactCacheSpec
Source§fn clone(&self) -> ArtifactCacheSpec
fn clone(&self) -> ArtifactCacheSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArtifactCacheSpec
impl Debug for ArtifactCacheSpec
impl Eq for ArtifactCacheSpec
Source§impl PartialEq for ArtifactCacheSpec
impl PartialEq for ArtifactCacheSpec
impl StructuralPartialEq for ArtifactCacheSpec
Auto Trait Implementations§
impl Freeze for ArtifactCacheSpec
impl RefUnwindSafe for ArtifactCacheSpec
impl Send for ArtifactCacheSpec
impl Sync for ArtifactCacheSpec
impl Unpin for ArtifactCacheSpec
impl UnsafeUnpin for ArtifactCacheSpec
impl UnwindSafe for ArtifactCacheSpec
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.