dataloader 0.9.1

Rust implementation of Facebook's DataLoader using futures.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use async_trait::async_trait;
use std::collections::HashMap;

#[async_trait]
pub trait BatchFn<K, V> {
    type Error;

    fn max_batch_size(&self) -> usize {
        200
    }

    async fn load(&self, keys: &[K]) -> HashMap<K, Result<V, Self::Error>>
    where
        K: 'async_trait,
        V: 'async_trait,
        Self::Error: 'async_trait;
}