#[non_exhaustive]pub enum Command {
Resume {
human_input: HumanInput,
},
Goto {
node: String,
},
Update {
update: Value,
},
}Expand description
A command sent to a graph to control execution after an interrupt.
§Variants
Resume– provide human input and continue from the interrupted nodeGoto– jump to a specific node (skip the normal edge traversal)Update– apply a raw JSON update to state before resuming
§Example
ⓘ
let cmd = Command::resume(HumanInput {
approved: true,
feedback: Some("Looks good".into()),
data: None,
});
let outcome = graph.resume_with("thread-1", cmd, config).await?;Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Resume
Resume from the interrupted node with human input.
Fields
§
human_input: HumanInputThe human’s response to the interrupt prompt.
Goto
Jump to a specific node, bypassing normal edge traversal.
Update
Apply a raw JSON update to state before resuming.
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