pub trait ComponentLifecycle: ComponentLogging {
// Provided methods
fn on_start(&mut self) -> Result<Handled, HandlerError>
where Self: 'static { ... }
fn on_stop(&mut self) -> Result<Handled, HandlerError>
where Self: 'static { ... }
fn on_kill(&mut self) -> Result<Handled, HandlerError>
where Self: 'static { ... }
}Expand description
A trait to customise handling of lifecycle events
This trait replaces the pre-v0.9 Provide<ControlPort> requirement.
Provided Methods§
Sourcefn on_start(&mut self) -> Result<Handled, HandlerError>where
Self: 'static,
fn on_start(&mut self) -> Result<Handled, HandlerError>where
Self: 'static,
Gets invoked every time a component receives a Start event
The default implementation simply logs something at debug level.
Sourcefn on_stop(&mut self) -> Result<Handled, HandlerError>where
Self: 'static,
fn on_stop(&mut self) -> Result<Handled, HandlerError>where
Self: 'static,
Gets invoked every time a component receives a Stop event
The default implementation simply logs something at debug level.
Sourcefn on_kill(&mut self) -> Result<Handled, HandlerError>where
Self: 'static,
fn on_kill(&mut self) -> Result<Handled, HandlerError>where
Self: 'static,
Gets invoked every time a component receives a Kill event
The default implementation simply logs something at debug level.