azure_functions/durable/
history.rs1use chrono::{DateTime, Utc};
2use serde::Deserialize;
3use serde_json::Value;
4use serde_repr::Deserialize_repr;
5
6#[derive(Debug, Clone, Deserialize, PartialEq)]
7#[serde(rename_all = "PascalCase")]
8pub struct HistoryEvent {
9 pub event_type: EventType,
10
11 pub event_id: i32,
12
13 pub is_played: bool,
14
15 pub timestamp: DateTime<Utc>,
16
17 #[serde(skip)]
18 pub is_processed: bool,
19
20 pub name: Option<String>,
22
23 pub input: Option<Value>,
25
26 pub result: Option<String>,
28
29 pub task_scheduled_id: Option<i32>,
31
32 pub instance_id: Option<String>,
34
35 pub reason: Option<String>,
37
38 pub details: Option<String>,
40
41 pub fire_at: Option<DateTime<Utc>>,
43
44 pub timer_id: Option<i32>,
46}
47
48#[derive(Debug, Copy, Clone, Deserialize_repr, PartialEq)]
49#[repr(u8)]
50pub enum EventType {
51 ExecutionStarted = 0,
52 ExecutionCompleted = 1,
53 ExecutionFailed = 2,
54 ExecutionTerminated = 3,
55 TaskScheduled = 4,
56 TaskCompleted = 5,
57 TaskFailed = 6,
58 SubOrchestrationInstanceCreated = 7,
59 SubOrchestrationInstanceCompleted = 8,
60 SubOrchestrationInstanceFailed = 9,
61 TimerCreated = 10,
62 TimerFired = 11,
63 OrchestratorStarted = 12,
64 OrchestratorCompleted = 13,
65 EventSent = 14,
66 EventRaised = 15,
67 ContinueAsNew = 16,
68 GenericEvent = 17,
69 HistoryState = 18,
70}