use std::future::Future;
use std::pin::Pin;
pub type StartupHook<T> =
Box<dyn FnOnce(T) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn std::error::Error + Send + Sync>>> + Send>> + Send>;
pub type ShutdownHook =
Box<dyn FnOnce() -> Pin<Box<dyn Future<Output = ()> + Send>> + Send>;
pub trait LifecycleController<T: Clone + Send + Sync + 'static> {
fn on_start(
_state: &T,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn std::error::Error + Send + Sync>>> + Send + '_>> {
Box::pin(async { Ok(()) })
}
fn on_stop() -> Pin<Box<dyn Future<Output = ()> + Send>> {
Box::pin(async {})
}
}