Trait FileLoad

Source
pub trait FileLoad:
    Sized
    + Send
    + Sync
    + 'static {
    // Required method
    fn load<'life0, 'async_trait>(
        path: &'life0 Path,
        file: File,
        metadata: Metadata,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Load a file-backed data structure.

Required Methods§

Source

fn load<'life0, 'async_trait>( path: &'life0 Path, file: File, metadata: Metadata, ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Load this state from the given file.

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§

Source§

impl<'en, T> FileLoad for T
where T: FromStream<Context = ()> + Send + Sync + 'static,