pub struct Command {
pub update: Option<HashMap<String, Value>>,
pub goto: Option<Vec<String>>,
pub resume: Option<Value>,
}Expand description
A command that can be returned from a node to control execution flow.
Commands provide a way for nodes to influence graph execution beyond just updating state. They can update state, change routing, or control interrupts.
§Example
use rust_langgraph::types::Command;
use serde_json::json;
// Update state and go to specific nodes
let cmd = Command::new()
.with_update("key", json!("value"))
.with_goto(vec!["node1", "node2"]);Fields§
§update: Option<HashMap<String, Value>>State updates to apply
goto: Option<Vec<String>>Specific nodes to route to (overrides normal routing)
resume: Option<Value>Value to resume with after interrupt
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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