Trait CallbackHandler

Source
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§

Source

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

Source

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

Source

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

Source

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

Source

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,

Called when a run is cancelled

Implementors§