pub struct NodeOutput {
pub updates: HashMap<String, Value>,
pub interrupt: Option<Interrupt>,
pub events: Vec<StreamEvent>,
}Available on crate feature
graph only.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 new() -> NodeOutput
pub fn new() -> NodeOutput
Create a new empty output
Sourcepub fn with_update(self, key: &str, value: impl Into<Value>) -> NodeOutput
pub fn with_update(self, key: &str, value: impl Into<Value>) -> NodeOutput
Add a state update
Sourcepub fn with_updates(self, updates: HashMap<String, Value>) -> NodeOutput
pub fn with_updates(self, updates: HashMap<String, Value>) -> NodeOutput
Add multiple state updates
Sourcepub fn with_interrupt(self, interrupt: Interrupt) -> NodeOutput
pub fn with_interrupt(self, interrupt: Interrupt) -> NodeOutput
Set an interrupt
Sourcepub fn with_event(self, event: StreamEvent) -> NodeOutput
pub fn with_event(self, event: StreamEvent) -> NodeOutput
Add a custom stream event
Sourcepub fn interrupt(message: &str) -> NodeOutput
pub fn interrupt(message: &str) -> NodeOutput
Create output that triggers a dynamic interrupt
Sourcepub fn interrupt_with_data(message: &str, data: Value) -> NodeOutput
pub fn interrupt_with_data(message: &str, data: Value) -> NodeOutput
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request