pub trait Lifecycle:
Sized
+ Send
+ 'static {
type Config: DeserializeOwned + Default + Send + 'static;
type Error: Error + Send + Sync + 'static;
type Context: Context;
// Required methods
fn prepare(
config: Self::Config,
setup: &mut Setup<Self>,
) -> impl Future<Output = Result<Self, Self::Error>> + Send;
fn initialize(
&mut self,
context: &Self::Context,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn stop(
&mut self,
context: &Self::Context,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn cleanup(
&mut self,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
}Required Associated Types§
type Config: DeserializeOwned + Default + Send + 'static
type Error: Error + Send + Sync + 'static
type Context: Context
Required Methods§
fn prepare( config: Self::Config, setup: &mut Setup<Self>, ) -> impl Future<Output = Result<Self, Self::Error>> + Send
fn initialize( &mut self, context: &Self::Context, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn stop( &mut self, context: &Self::Context, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn cleanup(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".