pub enum EventPayload {
Created {
capability: String,
title: String,
input: Value,
},
Queued {
ahead: usize,
},
Started,
Progress(ProgressView),
StepStarted {
name: String,
title: String,
},
StepCompleted {
name: String,
ok: bool,
detail: Option<String>,
},
Log {
stream: LogStream,
message: String,
},
Diagnostic(ExecutionDiagnostic),
Cancelling {
by: String,
},
Cancelled,
Completed {
output: Value,
},
Failed {
error: ExecutionError,
},
}Expand description
What happened, as a closed set.
The tag is type and the body is data, so every event on the wire has the same two
members whatever it says, and a client switches on one string.
Variants§
Created
The execution was accepted and exists. Carries what it will run and with what, redacted, so a client that joins at the first event needs nothing else to render a heading.
Fields
Queued
It is waiting for a worker.
Started
A worker picked it up and is about to enter the handler.
Progress(ProgressView)
How far along it is.
StepStarted
A named phase was entered.
StepCompleted
A named phase finished.
Fields
Log
A line of output.
Fields
Diagnostic(ExecutionDiagnostic)
A structured finding, distinct from the outcome.
Cancelling
Cancellation was asked for; the handler has not stopped yet.
Cancelled
It stopped because it was asked to.
Completed
It finished, and the handler returned an output.
The output is on this event and not on one of its own, because a client must never be able to read “succeeded” and find no result: the state and the value it produced are one fact and travel together.
Failed
It finished, and it did not.
Fields
error: ExecutionErrorWhy.
Implementations§
Source§impl EventPayload
impl EventPayload
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
The discriminator on the wire.
use majordomus_cli::execution::EventPayload;
assert_eq!(EventPayload::Started.type_name(), "execution.started");
assert_eq!(EventPayload::Cancelled.type_name(), "execution.cancelled");Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Is this the last event of its execution? A subscriber that has read one may stop.
use majordomus_cli::execution::EventPayload;
assert!(EventPayload::Cancelled.is_terminal());
assert!(!EventPayload::Started.is_terminal());Sourcepub fn implies_state(&self) -> Option<ExecutionState>
pub fn implies_state(&self) -> Option<ExecutionState>
The state this event puts the execution into, when it decides one.
Trait Implementations§
Source§impl Clone for EventPayload
impl Clone for EventPayload
Source§fn clone(&self) -> EventPayload
fn clone(&self) -> EventPayload
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 EventPayload
impl Debug for EventPayload
Source§impl<'de> Deserialize<'de> for EventPayload
impl<'de> Deserialize<'de> for EventPayload
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>,
impl Eq for EventPayload
Source§impl JsonSchema for EventPayload
impl JsonSchema for EventPayload
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 PartialEq for EventPayload
impl PartialEq for EventPayload
Source§fn eq(&self, other: &EventPayload) -> bool
fn eq(&self, other: &EventPayload) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for EventPayload
impl Serialize for EventPayload
impl StructuralPartialEq for EventPayload
Auto Trait Implementations§
impl Freeze for EventPayload
impl RefUnwindSafe for EventPayload
impl Send for EventPayload
impl Sync for EventPayload
impl Unpin for EventPayload
impl UnsafeUnpin for EventPayload
impl UnwindSafe for EventPayload
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.