pub trait LoopHook: Send + Sync {
// Provided methods
fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: RunStart<'life1>,
) -> Pin<Box<dyn Future<Output = RunStartAction> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_completion_call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: CallEvent<'life1>,
) -> Pin<Box<dyn Future<Output = CallAction> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_model_turn_finished<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Turn<'life1>,
) -> Pin<Box<dyn Future<Output = TurnAction> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Dispatch<'life1>,
) -> Pin<Box<dyn Future<Output = DispatchAction> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Outcome<'life1>,
) -> Pin<Box<dyn Future<Output = OutcomeAction> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_run_settled<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Settled<'life1>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
One place to intervene in the loop. Every method has a “carry on” default, so implement only what you need.
Provided Methods§
fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: RunStart<'life1>,
) -> Pin<Box<dyn Future<Output = RunStartAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_completion_call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: CallEvent<'life1>,
) -> Pin<Box<dyn Future<Output = CallAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_model_turn_finished<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Turn<'life1>,
) -> Pin<Box<dyn Future<Output = TurnAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Dispatch<'life1>,
) -> Pin<Box<dyn Future<Output = DispatchAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Outcome<'life1>,
) -> Pin<Box<dyn Future<Output = OutcomeAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_settled<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Settled<'life1>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".