pub fn cache_pipeline<E, T, R, const KEY_SIZE: usize>(
index: &str,
keys: &[&dyn CacheKey; KEY_SIZE],
restore_pipeline: impl Fn(Option<Vec<u8>>) -> Result<R, E>,
fetch_pipeline_state: impl Fn(&R) -> Result<T, E>,
bypass_cache: bool,
) -> Result<R, E>where
T: Cacheable,
Expand description
Cache a pipeline state object.
Keys are not used to create the object and are only used to uniquely identify the pipeline state.
restore_pipeline
tries to restore the pipeline with either a cached binary pipeline state cache, or create a new pipeline if no cached value is available.fetch_pipeline_state
fetches the new pipeline state cache after the pipeline was created.