Skip to main content

UnsizedCacheKey

Trait UnsizedCacheKey 

Source
pub trait UnsizedCacheKey {
    type ValueType: 'static + ?Sized;

    // Required methods
    fn key(&self) -> Cow<'_, str>;
    fn type_name() -> &'static str;
}
Expand description

Like CacheKey but for unsized value types (e.g. dyn Trait).

The cache wraps values in an extra Arc layer internally; callers pass and receive Arc<T> where T: ?Sized.

Unsized cache entries are always in-memory only (no serialization codec). For serializable entries, use a sized CacheKey instead.

Required Associated Types§

Source

type ValueType: 'static + ?Sized

Required Methods§

Source

fn key(&self) -> Cow<'_, str>

Source

fn type_name() -> &'static str

Short, stable string identifying this value type. See CacheKey::type_name for requirements.

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.

Implementors§