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§
Provided Methods§
Sourcefn health_check(&self) -> Option<Box<dyn Fn() -> bool + Send + Sync>>
fn health_check(&self) -> Option<Box<dyn Fn() -> bool + Send + Sync>>
Get optional health check for this subsystem.
Sourcefn restart_policy(&self) -> RestartPolicy
fn restart_policy(&self) -> RestartPolicy
Get the restart policy for this subsystem.