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§
Required Methods§
Sourceasync fn initialize(&mut self, config: Self::Config) -> Result<(), Self::Error>
async fn initialize(&mut self, config: Self::Config) -> Result<(), Self::Error>
Initialize the component with given configuration
Sourcefn is_initialized(&self) -> bool
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.