Skip to main content

NativeDaemonHooks

Trait NativeDaemonHooks 

Source
pub trait NativeDaemonHooks: Send + 'static {
    // Provided methods
    fn configure_builder(
        &mut self,
        builder: ProcessorBuilder,
    ) -> Result<ProcessorBuilder> { ... }
    fn configure_provider<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _provider: &'life1 Arc<Provider>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Extension hooks allowing external service binaries to attach custom DHT registrations, Provider protocols or onion Kleisli backends, and cooperative shutdown steps onto the standard native node daemon lifecycle.

Provided Methods§

Source

fn configure_builder( &mut self, builder: ProcessorBuilder, ) -> Result<ProcessorBuilder>

Customize ProcessorBuilder (e.g. via ProcessorBuilder::register_task) before the Processor is constructed.

Source

fn configure_provider<'life0, 'life1, 'async_trait>( &'life0 mut self, _provider: &'life1 Arc<Provider>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Install protocols, custom local RPC methods, or onion Kleisli backends on provider before its application inbox is claimed and the listener starts.

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run service-specific cleanup after the foreground node listener and Processor::close have completed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NativeDaemonHooks for ()

Implementors§