Skip to main content

CacheTierBuilder

Trait CacheTierBuilder 

Source
pub trait CacheTierBuilder<K, V>: Sealed { }
Expand description

A builder that can produce a cache tier.

This trait is sealed and cannot be implemented outside this crate. It’s implemented by CacheBuilder and FallbackBuilder to enable type-safe cache hierarchy construction.

§Examples

use cachet::Cache;
use tick::Clock;

let clock = Clock::new_tokio();
let cache = Cache::builder::<String, i32>(clock).memory().build();

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, V, CT> CacheTierBuilder<K, V> for CacheBuilder<K, V, CT>
where K: Clone + Hash + Eq + Send + Sync + 'static, V: Clone + Send + Sync + 'static, CT: CacheTier<K, V> + Send + Sync + 'static,

Source§

impl<K, V, KT, VT, Pre, Post> CacheTierBuilder<K, V> for TransformBuilder<K, V, KT, VT, Pre, Post>
where K: Clone + Hash + Eq + Send + Sync + 'static, V: Clone + Send + Sync + 'static, KT: Clone + Hash + Eq + Send + Sync + 'static, VT: Clone + Send + Sync + 'static,

Source§

impl<K, V, PB, FB> CacheTierBuilder<K, V> for FallbackBuilder<K, V, PB, FB>
where K: Clone + Hash + Eq + Send + Sync + 'static, V: Clone + Send + Sync + 'static, PB: CacheTierBuilder<K, V>, FB: CacheTierBuilder<K, V>,