Trait LoadFromDirectory

Source
pub trait LoadFromDirectory: Sized {
    type Error;

    // Required method
    fn load_from_directory<'async_trait>(
        dir: impl AsRef<Path> + Send + 'async_trait,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Trait for loading objects from a directory asynchronously.

Required Associated Types§

Required Methods§

Source

fn load_from_directory<'async_trait>( dir: impl AsRef<Path> + Send + 'async_trait, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

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<T> LoadFromDirectory for T
where T: LoadFromFile + Send, <T as LoadFromFile>::Error: Display + From<SaveLoadError> + From<Error> + Send + 'static,

Blanket implementation of LoadFromDirectory for any type implementing LoadFromFile where the error can be converted from SaveLoadError.