Skip to main content

rskit_chain/
types.rs

1use serde::{Deserialize, Serialize};
2
3/// Status of a single step in a chain.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5#[serde(rename_all = "lowercase")]
6#[non_exhaustive]
7pub enum StepStatus {
8    /// Step is currently executing.
9    Running,
10    /// Step finished successfully.
11    Completed,
12}
13
14/// Progress update for a single step.
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct StepProgress {
17    /// Zero-based index of this step in the chain.
18    pub step_index: usize,
19    /// Unique identifier of the step.
20    pub step_id: String,
21    /// Current status of the step.
22    pub status: StepStatus,
23    /// Completion percentage, clamped to 0..=100.
24    pub progress_percent: u8,
25    /// Optional human-readable progress message.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub message: Option<String>,
28}