pub trait Runnable<Input, Output>:
Send
+ Sync
+ 'static{
// Required method
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn invoke_simple<'life0, 'async_trait>(
&'life0 self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output>> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn input_schema(&self) -> Option<Value> { ... }
fn output_schema(&self) -> Option<Value> { ... }
fn config_schema(&self) -> Option<Value> { ... }
}
Expand description
The core Runnable trait that all FerricLink components implement
Required Methods§
Provided Methods§
Sourcefn invoke_simple<'life0, 'async_trait>(
&'life0 self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke_simple<'life0, 'async_trait>(
&'life0 self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoke the runnable with a single input (convenience method with default config)
Sourcefn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Batch invoke the runnable with multiple inputs
Sourcefn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream the output of the runnable
Sourcefn input_schema(&self) -> Option<Value>
fn input_schema(&self) -> Option<Value>
Get the input schema for this runnable
Sourcefn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
Get the output schema for this runnable
Sourcefn config_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
Get the configuration schema for this runnable