1use std::fmt;
2
3use serde::Serialize;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
7#[serde(rename_all = "snake_case")]
8pub enum VmStatus {
9 Created,
11 Running,
13 Stopped,
15 Destroyed,
17}
18
19impl fmt::Display for VmStatus {
20 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21 match self {
22 Self::Created => f.write_str("created"),
23 Self::Running => f.write_str("running"),
24 Self::Stopped => f.write_str("stopped"),
25 Self::Destroyed => f.write_str("destroyed"),
26 }
27 }
28}
29
30#[derive(Debug, Clone, Serialize)]
32pub struct VmView {
33 pub vm_id: String,
35 pub status: VmStatus,
37 pub snapshots: Vec<String>,
39}