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
70
71
72
73
74
75
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use serde_with::{serde_as, skip_serializing_none, DisplayFromStr};
#[serde_as]
#[skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(rename_all = "kebab-case")]
pub struct TaskOptions {
pub header: Option<Vec<String>>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub split: Option<i32>,
pub all_proxy: Option<String>,
pub dir: Option<String>,
pub out: Option<String>,
pub gid: Option<String>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub r#continue: Option<bool>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub auto_file_renaming: Option<bool>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub check_integrity: Option<bool>,
pub lowest_speed_limit: Option<String>,
pub max_download_limit: Option<String>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub max_connection_per_server: Option<i32>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub max_tries: Option<i32>,
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(default)]
pub timeout: Option<i32>,
#[serde(flatten)]
pub extra_options: Map<String, Value>,
}