Trait Runnable
Source pub trait Runnable<I: Send + 'static, O: Send + 'static>: Send + Sync {
// Required methods
fn invoke(
&self,
input: I,
) -> Pin<Box<dyn Future<Output = Result<O, Error>> + Send>>;
fn clone_to_owned(&self) -> Box<dyn Runnable<I, O> + Send + Sync>;
// Provided methods
fn invoke_with_config(
&self,
input: I,
_config: Option<HashMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<O, Error>> + Send>> { ... }
fn batch(
&self,
inputs: Vec<I>,
) -> Pin<Box<dyn Future<Output = Vec<Result<O, Error>>> + Send>> { ... }
fn batch_with_config(
&self,
inputs: Vec<I>,
_config: Option<HashMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Vec<Result<O, Error>>> + Send>> { ... }
fn stream(
&self,
input: I,
) -> Box<dyn Stream<Item = Result<O, Error>> + Send> { ... }
fn astream(
&self,
_input: I,
) -> Pin<Box<dyn Future<Output = Box<dyn Stream<Item = Result<O, Error>> + Send>> + Send>> { ... }
}