#[non_exhaustive]pub enum StreamChunk<O> {
Value(O),
Update {
node: String,
value: O,
},
Message(StreamDelta),
Debug(DebugEvent),
Event(RunnableEvent),
}Expand description
One chunk of a streaming Runnable invocation.
Generic over the runnable’s output type O. Chunks not relevant to a
chosen mode are simply not emitted; the variant the caller observes is
determined by the requested StreamMode.
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.
Value(O)
Full snapshot — emitted in StreamMode::Values.
Update
Per-node update — emitted in StreamMode::Updates.
Fields
§
value: OState (or output) the node produced this step.
Message(StreamDelta)
Token-level delta — emitted in StreamMode::Messages.
Debug(DebugEvent)
Lifecycle marker — emitted in StreamMode::Debug.
Event(RunnableEvent)
Runtime event — emitted in StreamMode::Events.
Implementations§
Source§impl<O> StreamChunk<O>
impl<O> StreamChunk<O>
Trait Implementations§
Source§impl<O: Clone> Clone for StreamChunk<O>
impl<O: Clone> Clone for StreamChunk<O>
Source§fn clone(&self) -> StreamChunk<O>
fn clone(&self) -> StreamChunk<O>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<O> Freeze for StreamChunk<O>where
O: Freeze,
impl<O> RefUnwindSafe for StreamChunk<O>where
O: RefUnwindSafe,
impl<O> Send for StreamChunk<O>where
O: Send,
impl<O> Sync for StreamChunk<O>where
O: Sync,
impl<O> Unpin for StreamChunk<O>where
O: Unpin,
impl<O> UnsafeUnpin for StreamChunk<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for StreamChunk<O>where
O: UnwindSafe,
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