pub struct StreamMessage {
pub stream_type: StreamType,
pub timestamp: String,
pub job_id: String,
pub data: Value,
pub seq: Option<i64>,
pub step: Option<i64>,
pub phase: Option<String>,
pub event_type: Option<String>,
pub level: Option<String>,
}Expand description
A message from a job stream.
Fields§
§stream_type: StreamTypeType of stream this message came from.
timestamp: StringISO 8601 timestamp.
job_id: StringJob ID this message belongs to.
data: ValueMessage payload.
seq: Option<i64>Sequence number (for events).
step: Option<i64>Step/iteration number (for metrics).
phase: Option<String>Phase name (for timeline).
event_type: Option<String>Event type string (for events).
level: Option<String>Log level (for events).
Implementations§
Source§impl StreamMessage
impl StreamMessage
Sourcepub fn new(
stream_type: StreamType,
job_id: impl Into<String>,
data: Value,
) -> StreamMessage
pub fn new( stream_type: StreamType, job_id: impl Into<String>, data: Value, ) -> StreamMessage
Create a new stream message.
Sourcepub fn status(job_id: impl Into<String>, data: Value) -> StreamMessage
pub fn status(job_id: impl Into<String>, data: Value) -> StreamMessage
Create a status message.
Sourcepub fn event(job_id: impl Into<String>, data: Value, seq: i64) -> StreamMessage
pub fn event(job_id: impl Into<String>, data: Value, seq: i64) -> StreamMessage
Create an event message.
Sourcepub fn metrics(
job_id: impl Into<String>,
data: Value,
step: i64,
) -> StreamMessage
pub fn metrics( job_id: impl Into<String>, data: Value, step: i64, ) -> StreamMessage
Create a metrics message.
Sourcepub fn timeline(
job_id: impl Into<String>,
phase: impl Into<String>,
data: Value,
) -> StreamMessage
pub fn timeline( job_id: impl Into<String>, phase: impl Into<String>, data: Value, ) -> StreamMessage
Create a timeline message.
Sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
Check if this is a warning event.
Trait Implementations§
Source§impl Clone for StreamMessage
impl Clone for StreamMessage
Source§fn clone(&self) -> StreamMessage
fn clone(&self) -> StreamMessage
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 StreamMessage
impl Debug for StreamMessage
Source§impl Default for StreamMessage
impl Default for StreamMessage
Source§fn default() -> StreamMessage
fn default() -> StreamMessage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StreamMessage
impl<'de> Deserialize<'de> for StreamMessage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StreamMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StreamMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for StreamMessage
impl Serialize for StreamMessage
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 StreamMessage
impl RefUnwindSafe for StreamMessage
impl Send for StreamMessage
impl Sync for StreamMessage
impl Unpin 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
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 moreSource§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