Skip to main content

CacheStrategy

Trait CacheStrategy 

Source
pub trait CacheStrategy:
    Send
    + Sync
    + 'static {
    // Required method
    fn check(
        &self,
        task_id: &TaskId,
        ctx: &DagContext,
    ) -> Option<Box<dyn Any + Send>>;
}
Expand description

Trait for determining whether a task can be skipped.

Implementors check external state (nix store, file system, etc.) and return the cached output if available.

Required Methods§

Source

fn check( &self, task_id: &TaskId, ctx: &DagContext, ) -> Option<Box<dyn Any + Send>>

Check if the task’s output already exists. Returns Some(output) if cached (task will be skipped), None if the task must execute.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§