iced_graphics::cache

Trait Cached

Source
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.

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§

Source§

impl Cached for ()

Available on debug-assertions enabled only.
Source§

type Cache = ()

Source§

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

Source§

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

Implementors§