Trait Cache

Source
pub trait Cache {
    // Required methods
    fn get_value<T>(&self, name: &str) -> Result<T, SolverError>
       where T: Clone + 'static;
    fn save_value<T>(&mut self, name: &String, value: T)
       where T: Clone + 'static;
    fn save_value_str<T>(&mut self, name: &str, value: T)
       where T: Clone + 'static;
}
Expand description

A convenience trait to allow the storage of asset values in between tasks or graph executions.

Required Methods§

Source

fn get_value<T>(&self, name: &str) -> Result<T, SolverError>
where T: Clone + 'static,

Retrieves a value from the solver. It is required to know the name and type of the asset. Cast error will return SolveError::AssetWrongType

Source

fn save_value<T>(&mut self, name: &String, value: T)
where T: Clone + 'static,

Saves a value to be available during execution. This routine can be used to feed initial values for Assets. i.e. unbond assets Assets not generated by any Task.

Source

fn save_value_str<T>(&mut self, name: &str, value: T)
where T: Clone + 'static,

Saves a value to be available during execution. This routine can be used to feed initial values for Assets. i.e. unbond assets Assets not generated by any Task.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Cache for ValuesCache

Source§

impl<'a, 'b> Cache for GraphSolver<'a, 'b>