Trait AppProvider

Source
pub trait AppProvider {
    // Required method
    fn get_app_for<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        instance_domain: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<RegisteredApp, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for application providers. An application provider is expected to be able to register an app at an instance, and then store and re-use it. Once an application has been registered at an instance, any further requests for that instance should result in the same RegisteredApp.

For an example implementation, look at FileCachedAppProvider.

Required Methods§

Source

fn get_app_for<'life0, 'life1, 'async_trait>( &'life0 mut self, instance_domain: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<RegisteredApp, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

If we don’t yet have an app registered at that instance, register it and return the RegisteredApp. Otherwise, return the already existing RegisteredApp.

Implementors§