pub struct NodeFn1<F>(pub F);Expand description
Wrapper for single-argument sync node functions that ignore config.
ⓘ
use langgraph::prelude::*;
graph.add_node("doubler", NodeFn1(|input| {
let n = input.get("value").and_then(|v| v.as_i64()).unwrap_or(0);
Ok(json!({"value": n * 2}))
}));Tuple Fields§
§0: FTrait Implementations§
Auto Trait Implementations§
impl<F> Freeze for NodeFn1<F>where
F: Freeze,
impl<F> RefUnwindSafe for NodeFn1<F>where
F: RefUnwindSafe,
impl<F> Send for NodeFn1<F>where
F: Send,
impl<F> Sync for NodeFn1<F>where
F: Sync,
impl<F> Unpin for NodeFn1<F>where
F: Unpin,
impl<F> UnsafeUnpin for NodeFn1<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for NodeFn1<F>where
F: UnwindSafe,
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