pub struct RunStatusChangedEvent {
pub run_id: Uuid,
pub workflow_name: String,
pub from: RunStatus,
pub to: RunStatus,
pub error: Option<String>,
pub cost_usd: Decimal,
pub duration_ms: u64,
pub labels: HashMap<String, String>,
pub at: DateTime<Utc>,
}Expand description
Payload of the Event::RunStatusChanged event.
§Examples
use std::collections::HashMap;
use chrono::Utc;
use ironflow_engine::notify::RunStatusChangedEvent;
use ironflow_store::models::RunStatus;
use rust_decimal::Decimal;
use uuid::Uuid;
let payload = RunStatusChangedEvent {
run_id: Uuid::now_v7(),
workflow_name: "deploy".to_string(),
from: RunStatus::Running,
to: RunStatus::Completed,
error: None,
cost_usd: Decimal::ZERO,
duration_ms: 5000,
labels: HashMap::new(),
at: Utc::now(),
};
assert_eq!(payload.to, RunStatus::Completed);Fields§
§run_id: UuidRun identifier.
workflow_name: StringWorkflow name.
from: RunStatusPrevious status.
to: RunStatusNew status.
error: Option<String>Error message (when transitioning to Failed).
cost_usd: DecimalAggregated cost in USD at the time of transition.
duration_ms: u64Aggregated duration in milliseconds at the time of transition.
labels: HashMap<String, String>Labels of the run at the time of the transition.
at: DateTime<Utc>When the transition occurred.
Trait Implementations§
Source§impl Clone for RunStatusChangedEvent
impl Clone for RunStatusChangedEvent
Source§impl Debug for RunStatusChangedEvent
impl Debug for RunStatusChangedEvent
Source§impl<'de> Deserialize<'de> for RunStatusChangedEvent
impl<'de> Deserialize<'de> for RunStatusChangedEvent
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
Auto Trait Implementations§
impl Freeze for RunStatusChangedEvent
impl RefUnwindSafe for RunStatusChangedEvent
impl Send for RunStatusChangedEvent
impl Sync for RunStatusChangedEvent
impl Unpin for RunStatusChangedEvent
impl UnsafeUnpin for RunStatusChangedEvent
impl UnwindSafe for RunStatusChangedEvent
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