async_graphql::dataloader

Trait CacheFactory

Source
pub trait CacheFactory:
    Send
    + Sync
    + 'static {
    // Required method
    fn create<K, V>(&self) -> Box<dyn CacheStorage<Key = K, Value = V>>
       where K: Send + Sync + Clone + Eq + Hash + 'static,
             V: Send + Sync + Clone + 'static;
}
Available on crate feature dataloader only.
Expand description

Factory for creating cache storage.

Required Methods§

Source

fn create<K, V>(&self) -> Box<dyn CacheStorage<Key = K, Value = V>>
where K: Send + Sync + Clone + Eq + Hash + 'static, V: Send + Sync + Clone + 'static,

Create a cache storage.

TODO: When GAT is stable, this memory allocation can be optimized away.

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§