scuffle_bootstrap::global

Trait GlobalWithoutConfig

Source
pub trait GlobalWithoutConfig:
    Send
    + Sync
    + 'static {
    // Required method
    fn init() -> impl Future<Output = Result<Arc<Self>>> + Send;

    // Provided methods
    fn tokio_runtime() -> Runtime { ... }
    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 Methods§

Source

fn init() -> impl Future<Output = Result<Arc<Self>>> + Send

Initialize the global.

Provided Methods§

Source

fn tokio_runtime() -> Runtime

Source

fn on_services_start( self: &Arc<Self>, ) -> impl Future<Output = Result<()>> + Send

Called when all services have been started.

Source

fn on_exit( self: &Arc<Self>, result: Result<()>, ) -> impl Future<Output = Result<()>> + Send

Called when the shutdown process is complete, right before exiting the process.

Source

fn on_service_exit( self: &Arc<Self>, name: &'static str, result: Result<()>, ) -> impl Future<Output = Result<()>> + Send

Called when a service exits.

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§