pub trait Global:
Send
+ Sync
+ 'static {
type Config: ConfigParser + Send + 'static;
// Required method
fn init(
config: Self::Config,
) -> impl Future<Output = Result<Arc<Self>>> + Send;
// Provided methods
fn tokio_runtime() -> Runtime { ... }
fn pre_init() -> Result<()> { ... }
fn on_services_start(
self: &Arc<Self>,
) -> impl Future<Output = Result<()>> + Send { ... }
fn on_exit(
self: &Arc<Self>,
result: Result<()>,
) -> impl Future<Output = Result<()>> + Send { ... }
fn on_service_exit(
self: &Arc<Self>,
name: &'static str,
result: Result<()>,
) -> impl Future<Output = Result<()>> + Send { ... }
}Required Associated Types§
type Config: ConfigParser + Send + 'static
Required Methods§
Provided Methods§
Sourcefn tokio_runtime() -> Runtime
fn tokio_runtime() -> Runtime
Builds the tokio runtime for the application.
Sourcefn on_services_start(
self: &Arc<Self>,
) -> impl Future<Output = Result<()>> + Send
fn on_services_start( self: &Arc<Self>, ) -> impl Future<Output = Result<()>> + Send
Called when all services have been started.
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.