1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#[derive(Clone, Debug)]
pub enum InstallationUpdate {
Library(Progress),
Asset(Progress),
LogConfig(Progress),
Client(Progress),
Cancel,
Success,
}
impl InstallationUpdate {
pub fn resource_type(&self) -> String {
match self {
InstallationUpdate::Library(_) => "Library".to_string(),
InstallationUpdate::Asset(_) => "Asset".to_string(),
InstallationUpdate::LogConfig(_) => "LogConfig".to_string(),
InstallationUpdate::Client(_) => "Client".to_string(),
_ => "Other".to_string(),
}
}
}
#[derive(Clone, Debug, Default)]
pub struct Progress {
pub total_files: usize,
pub current_file: usize,
pub current_file_url: String,
pub current_file_size: Option<usize>,
}