pub trait CallbackHandler:
Send
+ Sync
+ 'static {
// Provided methods
fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_run_success<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_run_error<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_run_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
chunk: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn on_run_cancel<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
Base trait for all callback handlers
Provided Methods§
Sourcefn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when a run starts
Sourcefn on_run_success<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_success<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when a run completes successfully
Sourcefn on_run_error<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_error<'life0, 'life1, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when a run fails
Sourcefn on_run_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
chunk: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_run_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_info: &'life1 RunInfo,
chunk: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called when a run produces streaming output