#[non_exhaustive]pub enum StreamMessage {
StreamBegin {
stream_id: String,
plan_id: PlanId,
total_chunks: Option<usize>,
plan: Box<SerializedPlan>,
},
ChunkData {
stream_id: String,
chunk_index: usize,
value: Value,
},
StreamEnd {
stream_id: String,
},
ChunkResult {
stream_id: String,
chunk_index: usize,
value: Value,
},
StreamComplete {
stream_id: String,
result: PlanResult,
},
}Expand description
Streaming protocol: chunked data transfer over WebSocket Binary frames.
Wire format: msgpack-encoded StreamMessage (efficient binary, no JSON overhead). Client sends StreamBegin + N × ChunkData + StreamEnd. Worker responds with ChunkResult per chunk — except while a Barrier-mode node is accumulating, which yields nothing until the flush — and StreamComplete at the end.
The worker drives each session with the runtime’s StreamRun, the
same stream executor a local Graph.stream() uses, so chunk caching
and StreamMode semantics do not fork between local and remote.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StreamBegin
Begin a streaming session.
Fields
plan: Box<SerializedPlan>The plan to execute — input comes via chunks, not inline.
ChunkData
A single chunk of input data.
Fields
chunk_index: usizePosition in the stream, echoed back in the matching
StreamMessage::ChunkResult.
value: ValueThe chunk itself.
StreamEnd
All chunks have been sent.
ChunkResult
Result for a processed chunk (streamed back to client).
Fields
value: ValueThe processed chunk.
StreamComplete
Final result after all chunks processed.
Fields
result: PlanResultThe flush output on success — where Barrier-mode results arrive — or the failure that ended the run.
Trait Implementations§
Source§impl Clone for StreamMessage
impl Clone for StreamMessage
Source§fn clone(&self) -> StreamMessage
fn clone(&self) -> StreamMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamMessage
impl Debug for StreamMessage
Source§impl<'de> Deserialize<'de> for StreamMessage
impl<'de> Deserialize<'de> for StreamMessage
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>,
Auto Trait Implementations§
impl Freeze for StreamMessage
impl RefUnwindSafe for StreamMessage
impl Send for StreamMessage
impl Sync for StreamMessage
impl Unpin for StreamMessage
impl UnsafeUnpin for StreamMessage
impl UnwindSafe for StreamMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more