pub struct RunnableCallable { /* private fields */ }Expand description
Wraps a function as a Runnable.
This is the Rust equivalent of Python’s RunnableCallable.
Functions always receive (JsonValue, RunnableConfig) — the caller
is responsible for marshalling state into JsonValue.
Implementations§
Trait Implementations§
Source§impl Runnable for RunnableCallable
impl Runnable for RunnableCallable
Source§fn invoke(
&self,
input: &JsonValue,
config: &RunnableConfig,
) -> Result<JsonValue, RunnableError>
fn invoke( &self, input: &JsonValue, config: &RunnableConfig, ) -> Result<JsonValue, RunnableError>
Execute synchronously.
Source§fn ainvoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 JsonValue,
config: &'life2 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, RunnableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn ainvoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 JsonValue,
config: &'life2 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, RunnableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute asynchronously.
Auto Trait Implementations§
impl !RefUnwindSafe for RunnableCallable
impl !UnwindSafe for RunnableCallable
impl Freeze for RunnableCallable
impl Send for RunnableCallable
impl Sync for RunnableCallable
impl Unpin for RunnableCallable
impl UnsafeUnpin for RunnableCallable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more