Skip to main content

ResourceLoader

Trait ResourceLoader 

Source
pub trait ResourceLoader {
    // Provided method
    fn load<'life0, 'async_trait>(
        source: &'life0 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Sized + DeserializeOwned + Send + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Load config from local file or remote url. To use this trait, derive DeserializeOwned then implement this trait.

Provided Methods§

Source

fn load<'life0, 'async_trait>( source: &'life0 str, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + DeserializeOwned + Send + 'async_trait, 'life0: 'async_trait,

Load config from local file or remote url.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§