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,
},
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
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 done(metadata: StreamMetadata) -> PlexusStreamItem
pub fn done(metadata: StreamMetadata) -> PlexusStreamItem
Create a Done item
Sourcepub fn metadata(&self) -> &StreamMetadata
pub fn metadata(&self) -> &StreamMetadata
Get the metadata from any stream item variant
Trait Implementations§
Source§impl Clone for PlexusStreamItem
impl Clone for PlexusStreamItem
Source§fn clone(&self) -> PlexusStreamItem
fn clone(&self) -> PlexusStreamItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for PlexusStreamItem
impl JsonSchema for PlexusStreamItem
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PlexusStreamItem
impl RefUnwindSafe for PlexusStreamItem
impl Send for PlexusStreamItem
impl Sync for PlexusStreamItem
impl Unpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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