AsyncInitializable

Trait AsyncInitializable 

Source
pub trait AsyncInitializable: Send + Sync {
    // Required method
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn is_initialized(&self) -> bool { ... }
}
Expand description

Trait for services that need async initialization

Required Methods§

Source

fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize the service asynchronously

Provided Methods§

Source

fn is_initialized(&self) -> bool

Check if the service is initialized

Implementors§