Subsystem

Trait Subsystem 

Source
pub trait Subsystem:
    Send
    + Sync
    + 'static {
    // Required methods
    fn run(
        &self,
        shutdown: ShutdownHandle,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>;
    fn name(&self) -> &str;

    // Provided methods
    fn health_check(&self) -> Option<Box<dyn Fn() -> bool + Send + Sync>> { ... }
    fn restart_policy(&self) -> RestartPolicy { ... }
}
Expand description

Trait for subsystems that can be managed by the daemon.

Required Methods§

Source

fn run( &self, shutdown: ShutdownHandle, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>

Run the subsystem with the provided shutdown handle.

Source

fn name(&self) -> &str

Get the name of this subsystem.

Provided Methods§

Source

fn health_check(&self) -> Option<Box<dyn Fn() -> bool + Send + Sync>>

Get optional health check for this subsystem.

Source

fn restart_policy(&self) -> RestartPolicy

Get the restart policy for this subsystem.

Implementors§