pub struct Command {
pub update: Option<Value>,
pub goto: Option<CommandGoto>,
pub resume: Option<Value>,
}Expand description
A command that combines state update with explicit routing.
Commands allow nodes to control which node(s) execute next, overriding the graph’s edge definitions.
Fields§
§update: Option<Value>State update to apply.
goto: Option<CommandGoto>Explicit next node(s) to execute.
resume: Option<Value>Value to resume with (for interrupt handling).
Implementations§
Source§impl Command
impl Command
Sourcepub fn with_update(update: Value) -> Self
pub fn with_update(update: Value) -> Self
Create a command with a state update.
Sourcepub fn with_goto(goto: impl Into<CommandGoto>) -> Self
pub fn with_goto(goto: impl Into<CommandGoto>) -> Self
Create a command with a goto target.
Sourcepub fn goto(self, target: impl Into<CommandGoto>) -> Self
pub fn goto(self, target: impl Into<CommandGoto>) -> Self
Add a goto target to this command.
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