async_graphql::dataloader

Trait Loader

source
pub trait Loader<K: Send + Sync + Hash + Eq + Clone + 'static>:
    Send
    + Sync
    + 'static {
    type Value: Send + Sync + Clone + 'static;
    type Error: Send + Clone + 'static;

    // Required method
    fn load(
        &self,
        keys: &[K],
    ) -> impl Future<Output = Result<HashMap<K, Self::Value>, Self::Error>> + Send;
}
Available on crate feature dataloader only.
Expand description

Trait for batch loading.

Required Associated Types§

source

type Value: Send + Sync + Clone + 'static

type of value.

source

type Error: Send + Clone + 'static

Type of error.

Required Methods§

source

fn load( &self, keys: &[K], ) -> impl Future<Output = Result<HashMap<K, Self::Value>, Self::Error>> + Send

Load the data set specified by the keys.

Object Safety§

This trait is not object safe.

Implementors§