RunnableWithFallbacksExt

Trait RunnableWithFallbacksExt 

Source
pub trait RunnableWithFallbacksExt: Runnable {
    // Provided method
    fn with_fallbacks(
        self,
        fallbacks: Vec<DynRunnable<Self::Input, Self::Output>>,
    ) -> RunnableWithFallbacks<Self::Input, Self::Output>
       where Self: Sized + Send + Sync + 'static { ... }
}
Expand description

Extension trait to add with_fallbacks method to any Runnable.

Provided Methods§

Source

fn with_fallbacks( self, fallbacks: Vec<DynRunnable<Self::Input, Self::Output>>, ) -> RunnableWithFallbacks<Self::Input, Self::Output>
where Self: Sized + Send + Sync + 'static,

Create a new Runnable that tries this runnable first, then falls back to others.

§Arguments
  • fallbacks - A list of fallback runnables to try if this one fails
§Returns

A new RunnableWithFallbacks instance

Implementors§