[][src]Trait async_graphql::dataloader::Loader

pub trait Loader: Send + Sync + 'static {
    type Key: Send + Hash + Eq + Clone + 'static;
    type Value: Send + Clone + 'static;
    type Error: Send + Clone + 'static;
#[must_use]    pub fn load<'life0, 'async_trait>(
        &'life0 self,
        keys: HashSet<Self::Key>
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<Self::Key, Self::Value>, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
This is supported on crate feature dataloader only.

Trait for batch loading.

Associated Types

type Key: Send + Hash + Eq + Clone + 'static[src]

Type of key.

type Value: Send + Clone + 'static[src]

type of value.

type Error: Send + Clone + 'static[src]

Type of error.

Loading content...

Required methods

#[must_use]pub fn load<'life0, 'async_trait>(
    &'life0 self,
    keys: HashSet<Self::Key>
) -> Pin<Box<dyn Future<Output = Result<HashMap<Self::Key, Self::Value>, Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Load the data set specified by the keys.

Loading content...

Implementors

impl<C, T> Loader for CachedLoader<C, T> where
    C: CacheStorage<Key = T::Key, Value = T::Value>,
    T: Loader
[src]

type Key = T::Key

type Value = T::Value

type Error = T::Error

Loading content...