pub trait Cached: Sized {
    type Cache: Clone;

    // Required methods
    fn load(cache: &Self::Cache) -> Self;
    fn cache(self, group: Group, previous: Option<Self::Cache>) -> Self::Cache;
}
Expand description

A piece of data that can be cached.

Required Associated Types§

source

type Cache: Clone

The type of cache produced.

Required Methods§

source

fn load(cache: &Self::Cache) -> Self

Loads the Cache into a proper instance.

source

fn cache(self, group: Group, previous: Option<Self::Cache>) -> Self::Cache

Caches this value, producing its corresponding Cache.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Cached for ()

Available on debug-assertions enabled only.
§

type Cache = ()

source§

fn load(_cache: &Self::Cache) -> Self

source§

fn cache(self, _group: Group, _previous: Option<Self::Cache>) -> Self::Cache

Implementors§