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
//! Task module
//!
//! Shared types for the top-level tasks: encrypt, decrypt, transfer.
/// Task execution mode
#[derive(Debug, Default, Copy, Clone)]
pub enum Mode {
/// Check the task input without running the full task.
///
/// The check should be quick to perform and should not modify any data.
Check,
/// Run the task but stop on any errors or warnings.
#[default]
Run,
/// Run the task and ignore any warnings, but stop on errors.
Force,
}
/// Task success status
#[derive(Clone, Debug)]
pub enum Status {
/// Successfully checked task input without running the full task.
Checked {
/// Destination for the current task.
destination: String,
/// Size of the source file(s) or package for the current task.
source_size: u64,
},
/// Task successfully completed.
Completed {
/// Destination for the current task.
destination: String,
/// Size of the source file(s) or package for the current task.
source_size: u64,
/// Size of the destination package for the current task.
destination_size: u64,
/// Package metadata.
metadata: crate::package::Metadata,
},
}