pub enum NodeOutput {
Update(Value),
Command(Command),
None,
}Expand description
The output from a node execution.
Nodes can return either a simple state update or a command that includes routing information.
Variants§
Update(Value)
A partial state update to be merged into the current state.
Command(Command)
A command that includes both state update and routing.
None
No output - the state remains unchanged.
Implementations§
Source§impl NodeOutput
impl NodeOutput
Sourcepub fn update_from<T: Serialize>(value: &T) -> Result<Self>
pub fn update_from<T: Serialize>(value: &T) -> Result<Self>
Create an update output, serializing the given value.
Sourcepub fn has_update(&self) -> bool
pub fn has_update(&self) -> bool
Check if this output has state updates.
Sourcepub fn get_update(&self) -> Option<&Value>
pub fn get_update(&self) -> Option<&Value>
Get the state update, if any.
Sourcepub fn get_goto(&self) -> Option<&CommandGoto>
pub fn get_goto(&self) -> Option<&CommandGoto>
Get routing from a command, if any.
Trait Implementations§
Source§impl Clone for NodeOutput
impl Clone for NodeOutput
Auto Trait Implementations§
impl Freeze for NodeOutput
impl RefUnwindSafe for NodeOutput
impl Send for NodeOutput
impl Sync for NodeOutput
impl Unpin for NodeOutput
impl UnsafeUnpin for NodeOutput
impl UnwindSafe for NodeOutput
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