Skip to main content

Loader

Trait Loader 

Source
pub trait Loader<K: Send + Sync + Hash + Eq + Clone + 'static, V: Send + Sync + Clone + 'static>:
    Send
    + Sync
    + 'static {
    type Error: Send + Clone + 'static;

    // Required method
    fn load(
        &self,
        keys: &[K],
    ) -> impl Future<Output = Result<HashMap<K, V>, Self::Error>> + Send;
}
Expand description

Trait for batch loading.

Required Associated Types§

Source

type Error: Send + Clone + 'static

Type of error.

Required Methods§

Source

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

Load the data set specified by the keys.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§