pub struct NodeOutput {
pub updates: HashMap<String, Value>,
pub interrupt: Option<Interrupt>,
pub events: Vec<StreamEvent>,
}Expand description
Output from a node execution
Fields§
§updates: HashMap<String, Value>State updates to apply
interrupt: Option<Interrupt>Optional interrupt request
events: Vec<StreamEvent>Custom stream events
Implementations§
Source§impl NodeOutput
impl NodeOutput
Sourcepub fn with_update(self, key: &str, value: impl Into<Value>) -> Self
pub fn with_update(self, key: &str, value: impl Into<Value>) -> Self
Add a state update
Sourcepub fn with_updates(self, updates: HashMap<String, Value>) -> Self
pub fn with_updates(self, updates: HashMap<String, Value>) -> Self
Add multiple state updates
Sourcepub fn with_interrupt(self, interrupt: Interrupt) -> Self
pub fn with_interrupt(self, interrupt: Interrupt) -> Self
Set an interrupt
Sourcepub fn with_event(self, event: StreamEvent) -> Self
pub fn with_event(self, event: StreamEvent) -> Self
Add a custom stream event
Sourcepub fn interrupt_with_data(message: &str, data: Value) -> Self
pub fn interrupt_with_data(message: &str, data: Value) -> Self
Create output that triggers a dynamic interrupt with data
Trait Implementations§
Source§impl Default for NodeOutput
impl Default for NodeOutput
Source§fn default() -> NodeOutput
fn default() -> NodeOutput
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NodeOutput
impl RefUnwindSafe for NodeOutput
impl Send for NodeOutput
impl Sync for NodeOutput
impl Unpin 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