RemoteCache

Struct RemoteCache 

Source
pub struct RemoteCache { /* private fields */ }
Expand description

Remote cache orchestrator.

Handles cache operations and integrates with task execution.

Implementations§

Source§

impl RemoteCache

Source

pub fn new( backend: Box<dyn RemoteCacheBackend>, config: RemoteCacheConfig, ) -> Self

Creates a new remote cache with the given backend and configuration.

Source

pub fn from_config(config: RemoteCacheConfig) -> Result<Self>

Creates a remote cache from configuration.

Automatically selects the appropriate backend based on the URL.

§Errors

Returns an error if backend creation fails.

Source

pub fn disabled() -> Self

Creates a disabled remote cache (no-op).

Source

pub fn is_enabled(&self) -> bool

Checks if remote cache is enabled.

Source

pub async fn fetch_artifact(&self, key: &CacheKey) -> Result<Option<Artifact>>

Fetches an artifact from the remote cache.

§Arguments
  • key - The cache key to fetch
§Returns

Returns Some(artifact) if found, None if not found.

§Errors

Returns an error only for unexpected failures. Cache misses return Ok(None).

Source

pub async fn upload_artifact( &self, key: &CacheKey, artifact: &Artifact, ) -> Result<()>

Uploads an artifact to the remote cache.

§Arguments
  • key - The cache key for this artifact
  • artifact - The artifact to upload
§Errors

Returns an error if upload fails. Errors are non-fatal.

Source

pub async fn has_artifact(&self, key: &CacheKey) -> Result<bool>

Checks if an artifact exists in the remote cache.

§Arguments
  • key - The cache key to check
§Returns

Returns true if the artifact exists, false otherwise.

§Errors

Returns an error only for unexpected failures.

Source

pub async fn build_cache_key( &self, package: &Package, task_name: &str, command: &str, graph: &DependencyGraph, package_path: &Path, ) -> Result<CacheKey>

Builds a cache key for a task execution.

§Arguments
  • package - The package being executed
  • task_name - The task name
  • command - The command string
  • graph - The dependency graph
  • package_path - Path to the package directory
§Errors

Returns an error if cache key construction fails.

Source

pub fn config(&self) -> &RemoteCacheConfig

Returns the configuration.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more