pub trait IntoNodeFunction {
// Required method
fn into_runnable(self, name: &str) -> Arc<dyn Runnable> ⓘ;
}Expand description
Trait for converting closures into node Runnables.
This enables add_node and add_conditional_edges to accept both
async and sync closures with a uniform API.
Implemented for:
- Async closures:
Fn(JsonValue, RunnableConfig) -> impl Future<...> - Via
SyncNodeFnwrapper: sync closures Arc<dyn Runnable>: pre-built runnables
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoNodeFunction for Arc<dyn Runnable>
Implement IntoNodeFunction for pre-built runnables.
impl IntoNodeFunction for Arc<dyn Runnable>
Implement IntoNodeFunction for pre-built runnables.