pub enum PlexusStreamItem {
Data {
metadata: StreamMetadata,
content_type: String,
content: Value,
},
Progress {
metadata: StreamMetadata,
message: String,
percentage: Option<f32>,
},
Error {
metadata: StreamMetadata,
message: String,
code: Option<String>,
recoverable: bool,
},
Request {
request_id: String,
request_data: Value,
timeout_ms: u64,
},
Done {
metadata: StreamMetadata,
},
}Expand description
Universal stream item - all activations emit this type
The caller (DynamicHub routing layer) wraps activation responses with metadata. This is the only type that crosses the wire.
Variants§
Data
Data payload with caller-applied metadata
Fields
metadata: StreamMetadataMetadata from calling layer
Progress
Progress update during long-running operations
Fields
metadata: StreamMetadataMetadata from calling layer
Error
Error occurred during processing
Fields
metadata: StreamMetadataMetadata from calling layer
Request
Bidirectional request from server to client
Server can ask client for input during stream execution. Client must respond via transport-specific mechanism (MCP: _plexus_respond tool, WebSocket: plexus.respond RPC).
Fields
Done
Stream completed successfully
Fields
metadata: StreamMetadataMetadata from calling layer
Implementations§
Source§impl PlexusStreamItem
impl PlexusStreamItem
Sourcepub fn data(
metadata: StreamMetadata,
content_type: String,
content: Value,
) -> PlexusStreamItem
pub fn data( metadata: StreamMetadata, content_type: String, content: Value, ) -> PlexusStreamItem
Create a Data item
Sourcepub fn progress(
metadata: StreamMetadata,
message: String,
percentage: Option<f32>,
) -> PlexusStreamItem
pub fn progress( metadata: StreamMetadata, message: String, percentage: Option<f32>, ) -> PlexusStreamItem
Create a Progress item
Sourcepub fn error(
metadata: StreamMetadata,
message: String,
code: Option<String>,
recoverable: bool,
) -> PlexusStreamItem
pub fn error( metadata: StreamMetadata, message: String, code: Option<String>, recoverable: bool, ) -> PlexusStreamItem
Create an Error item
Sourcepub fn request(
request_id: String,
request_data: Value,
timeout_ms: u64,
) -> PlexusStreamItem
pub fn request( request_id: String, request_data: Value, timeout_ms: u64, ) -> PlexusStreamItem
Create a Request item
Sourcepub fn done(metadata: StreamMetadata) -> PlexusStreamItem
pub fn done(metadata: StreamMetadata) -> PlexusStreamItem
Create a Done item
Sourcepub fn metadata(&self) -> Option<&StreamMetadata>
pub fn metadata(&self) -> Option<&StreamMetadata>
Get the metadata from any stream item variant (if available)
Note: Request items don’t have metadata as they’re server-initiated
Trait Implementations§
Source§impl Clone for PlexusStreamItem
impl Clone for PlexusStreamItem
Source§fn clone(&self) -> PlexusStreamItem
fn clone(&self) -> PlexusStreamItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlexusStreamItem
impl Debug for PlexusStreamItem
Source§impl<'de> Deserialize<'de> for PlexusStreamItem
impl<'de> Deserialize<'de> for PlexusStreamItem
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PlexusStreamItem, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PlexusStreamItem, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PlexusStreamItem
impl JsonSchema for PlexusStreamItem
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for PlexusStreamItem
impl Serialize for PlexusStreamItem
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for PlexusStreamItem
impl RefUnwindSafe for PlexusStreamItem
impl Send for PlexusStreamItem
impl Sync for PlexusStreamItem
impl Unpin for PlexusStreamItem
impl UnsafeUnpin for PlexusStreamItem
impl UnwindSafe for PlexusStreamItem
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,
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> 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