#[non_exhaustive]pub enum OutputEvent {
Chunk(OutputChunk),
RunStarted {
generation: u64,
attempt: u32,
started_at: SystemTime,
},
RunFinished {
generation: u64,
attempt: u32,
exit_code: Option<i32>,
finished_at: SystemTime,
},
Lagged {
skipped: u64,
},
}Expand description
Event in a task live-output stream.
Run markers are the best effort. They are not ordering barriers for chunks.
§JSON Shape
{"type":"chunk","generation":2,"attempt":1,"stream":"stdout","seq":0,"ts":1700,"line":"aGVsbG8="}
{"type":"runStarted","generation":2,"attempt":1,"startedAt":1700}
{"type":"runFinished","generation":2,"attempt":1,"exitCode":0,"finishedAt":1701}
{"type":"lagged","skipped":42}§Example
use bytes::Bytes;
use solti_model::{OutputChunk, OutputEvent, StreamKind};
use std::time::SystemTime;
let event = OutputEvent::Chunk(OutputChunk {
generation: 2,
attempt: 1,
stream: StreamKind::Stdout,
seq: 0,
ts: SystemTime::UNIX_EPOCH,
line: Bytes::from_static(b"hello"),
});
let json = serde_json::to_string(&event).unwrap();
assert!(json.contains(r#""type":"chunk""#));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.
Chunk(OutputChunk)
Carries stdout or stderr bytes from one run.
RunStarted
Reports that a run attempt started.
This marker is not an ordering barrier for chunks.
Use each chunk’s generation, attempt, stream, and seq fields for grouping and ordering.
Fields
§
started_at: SystemTimeWall-clock start time (unix milliseconds on the wire).
RunFinished
Reports that a run attempt finished.
This marker is not an ordering barrier: chunks for the same generation and attempt may still be observed after it.
Fields
§
finished_at: SystemTimeWall-clock finish time (unix milliseconds on the wire).
Lagged
Reports events lost before the next delivered event.
Trait Implementations§
Source§impl Clone for OutputEvent
impl Clone for OutputEvent
Source§fn clone(&self) -> OutputEvent
fn clone(&self) -> OutputEvent
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 moreSource§impl Debug for OutputEvent
impl Debug for OutputEvent
Source§impl<'de> Deserialize<'de> for OutputEvent
impl<'de> Deserialize<'de> for OutputEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OutputEvent
Source§impl JsonSchema for OutputEvent
impl JsonSchema for OutputEvent
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 PartialEq for OutputEvent
impl PartialEq for OutputEvent
Source§impl Serialize for OutputEvent
impl Serialize for OutputEvent
impl StructuralPartialEq for OutputEvent
Auto Trait Implementations§
impl !Freeze for OutputEvent
impl RefUnwindSafe for OutputEvent
impl Send for OutputEvent
impl Sync for OutputEvent
impl Unpin for OutputEvent
impl UnsafeUnpin for OutputEvent
impl UnwindSafe for OutputEvent
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