pub trait LifecycleHook: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn on_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 LifecycleEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A lifecycle hook — registered by plugins or core
Required Methods§
fn name(&self) -> &str
Sourcefn on_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 LifecycleEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 LifecycleEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called on any lifecycle event. Return Ok(()) to continue, Err to abort (tool-call only).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".