Initializable

Trait Initializable 

Source
pub trait Initializable {
    type Config;
    type Error: Error + Send + Sync + 'static;

    // Required methods
    async fn initialize(
        &mut self,
        config: Self::Config,
    ) -> Result<(), Self::Error>;
    fn is_initialized(&self) -> bool;
}
Expand description

Trait for components that require initialization

Required Associated Types§

Source

type Config

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

async fn initialize(&mut self, config: Self::Config) -> Result<(), Self::Error>

Initialize the component with given configuration

Source

fn is_initialized(&self) -> bool

Check if the component is initialized

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§