arcbox_migration/
progress.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum MigrationStage {
6 Prepare,
8 StopSourceContainers,
10 ImportImages,
12 ImportVolumes,
14 RecreateNetworks,
16 RecreateContainers,
18 Cleanup,
20 Complete,
22}
23
24impl MigrationStage {
25 #[must_use]
27 pub const fn as_str(self) -> &'static str {
28 match self {
29 Self::Prepare => "prepare",
30 Self::StopSourceContainers => "stop-source-containers",
31 Self::ImportImages => "import-images",
32 Self::ImportVolumes => "import-volumes",
33 Self::RecreateNetworks => "recreate-networks",
34 Self::RecreateContainers => "recreate-containers",
35 Self::Cleanup => "cleanup",
36 Self::Complete => "complete",
37 }
38 }
39}
40
41#[derive(Debug, Clone, PartialEq, Eq)]
43pub struct MigrationProgress {
44 pub stage: MigrationStage,
46 pub detail: String,
48 pub resource_type: Option<String>,
50 pub resource_name: Option<String>,
52 pub current: Option<u32>,
54 pub total: Option<u32>,
56}