Skip to main content

Loadable

Trait Loadable 

Source
pub trait Loadable<S>:
    Sized
    + Send
    + Sync {
    // Required method
    fn load<'life0, 'life1, 'async_trait>(
        storage: &'life0 dyn StorageRead,
        scope: &'life1 S,
    ) -> Pin<Box<dyn Future<Output = StorageResult<Self>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for types that can be loaded from storage.

This trait abstracts the loading logic for any type that can be loaded from storage.

Required Methods§

Source

fn load<'life0, 'life1, 'async_trait>( storage: &'life0 dyn StorageRead, scope: &'life1 S, ) -> Pin<Box<dyn Future<Output = StorageResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load an instance from storage for the given scope.

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§