Trait Cached

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§

type Cache: Clone

The type of cache produced.

Required Methods§

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

Loads the Cache into a proper instance.

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

Caches this value, producing its corresponding Cache.

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.

Implementations on Foreign Types§

§

impl Cached for ()

§

type Cache = ()

§

fn load(_cache: &<() as Cached>::Cache)

§

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

§

impl Cached for Geometry

§

type Cache = Cache

§

fn load(cache: &Cache) -> Geometry

§

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

Implementors§