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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use crate::fsops::SyncOutcome;
use crate::sync::Stats;
#[doc(hidden)]
pub enum ProgressMessage {
DoneSyncing(SyncOutcome),
StartSync(String),
Todo {
num_files: u64,
total_size: usize,
},
Syncing {
description: String,
size: usize,
done: usize,
},
SyncError {
entry: String,
details: String,
},
}
pub struct Progress {
pub current_file: String,
pub file_done: usize,
pub file_size: usize,
pub total_done: usize,
pub total_size: usize,
pub index: usize,
pub num_files: usize,
pub eta: usize,
}
pub trait ProgressInfo {
#[allow(unused_variables)]
fn start(&mut self, source: &str, destination: &str) {}
#[allow(unused_variables)]
fn new_file(&mut self, name: &str) {}
#[allow(unused_variables)]
fn done_syncing(&mut self) {}
#[allow(unused_variables)]
fn progress(&mut self, progress: &Progress) {}
#[allow(unused_variables)]
fn end(&mut self, stats: &Stats) {}
#[allow(unused_variables)]
fn error(&mut self, entry: &str, details: &str) {}
}