Skip to main content

CacheAccess

Trait CacheAccess 

Source
pub trait CacheAccess {
    type Backend;
    type ConcurrencyManager;
    type Offload;

    // Required methods
    fn backend(&self) -> Arc<Self::Backend>;
    fn policy(&self) -> Arc<PolicyConfig>;
    fn concurrency_manager(&self) -> Self::ConcurrencyManager;
    fn offload(&self) -> Self::Offload;
}
Expand description

Trait for accessing cache internals.

This enables the generated #[cached] code to work with different cache ownership patterns: &Cache, Arc<Cache>, etc.

Required Associated Types§

Source

type Backend

The cache backend type.

Source

type ConcurrencyManager

The concurrency manager type.

Source

type Offload

The offload manager type.

Required Methods§

Source

fn backend(&self) -> Arc<Self::Backend>

Get a shared reference to the backend.

Source

fn policy(&self) -> Arc<PolicyConfig>

Get a shared reference to the policy.

Source

fn concurrency_manager(&self) -> Self::ConcurrencyManager

Get the concurrency manager.

Source

fn offload(&self) -> Self::Offload

Get the offload manager.

Implementations on Foreign Types§

Source§

impl<T: CacheAccess> CacheAccess for &T

Source§

impl<T: CacheAccess> CacheAccess for Arc<T>

Implementors§

Source§

impl<B, CM: Clone, O: Clone> CacheAccess for Cache<B, CM, O>