Browse Source

initial commit

Peter Cai 1 year ago
commit
1dd44bbefa
Signed by: Peter Cai <[email protected]> GPG Key ID: 71F5FB4E4F3FD54F
6 changed files with 1033 additions and 0 deletions
  1. 2
    0
      .gitignore
  2. 890
    0
      Cargo.lock
  3. 11
    0
      Cargo.toml
  4. 30
    0
      src/main.rs
  5. 32
    0
      src/manager.rs
  6. 68
    0
      src/util.rs

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
1
+/target
2
+**/*.rs.bk

+ 890
- 0
Cargo.lock View File

@@ -0,0 +1,890 @@
1
+[[package]]
2
+name = "arrayvec"
3
+version = "0.4.7"
4
+source = "registry+https://github.com/rust-lang/crates.io-index"
5
+dependencies = [
6
+ "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
7
+]
8
+
9
+[[package]]
10
+name = "backtrace"
11
+version = "0.3.9"
12
+source = "registry+https://github.com/rust-lang/crates.io-index"
13
+dependencies = [
14
+ "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
15
+ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
16
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
17
+ "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
18
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
19
+]
20
+
21
+[[package]]
22
+name = "backtrace-sys"
23
+version = "0.1.24"
24
+source = "registry+https://github.com/rust-lang/crates.io-index"
25
+dependencies = [
26
+ "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
27
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
28
+]
29
+
30
+[[package]]
31
+name = "base64"
32
+version = "0.9.2"
33
+source = "registry+https://github.com/rust-lang/crates.io-index"
34
+dependencies = [
35
+ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
36
+ "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
37
+]
38
+
39
+[[package]]
40
+name = "bitflags"
41
+version = "1.0.4"
42
+source = "registry+https://github.com/rust-lang/crates.io-index"
43
+
44
+[[package]]
45
+name = "byteorder"
46
+version = "1.2.6"
47
+source = "registry+https://github.com/rust-lang/crates.io-index"
48
+
49
+[[package]]
50
+name = "bytes"
51
+version = "0.4.10"
52
+source = "registry+https://github.com/rust-lang/crates.io-index"
53
+dependencies = [
54
+ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
55
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
56
+]
57
+
58
+[[package]]
59
+name = "cc"
60
+version = "1.0.23"
61
+source = "registry+https://github.com/rust-lang/crates.io-index"
62
+
63
+[[package]]
64
+name = "cfg-if"
65
+version = "0.1.5"
66
+source = "registry+https://github.com/rust-lang/crates.io-index"
67
+
68
+[[package]]
69
+name = "cloudabi"
70
+version = "0.0.3"
71
+source = "registry+https://github.com/rust-lang/crates.io-index"
72
+dependencies = [
73
+ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
74
+]
75
+
76
+[[package]]
77
+name = "crossbeam-deque"
78
+version = "0.6.1"
79
+source = "registry+https://github.com/rust-lang/crates.io-index"
80
+dependencies = [
81
+ "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
82
+ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
83
+]
84
+
85
+[[package]]
86
+name = "crossbeam-epoch"
87
+version = "0.5.2"
88
+source = "registry+https://github.com/rust-lang/crates.io-index"
89
+dependencies = [
90
+ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
91
+ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
92
+ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
93
+ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
94
+ "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
95
+ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
96
+]
97
+
98
+[[package]]
99
+name = "crossbeam-utils"
100
+version = "0.5.0"
101
+source = "registry+https://github.com/rust-lang/crates.io-index"
102
+
103
+[[package]]
104
+name = "ct-logs"
105
+version = "0.4.0"
106
+source = "registry+https://github.com/rust-lang/crates.io-index"
107
+dependencies = [
108
+ "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
109
+]
110
+
111
+[[package]]
112
+name = "error-chain"
113
+version = "0.12.0"
114
+source = "registry+https://github.com/rust-lang/crates.io-index"
115
+dependencies = [
116
+ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
117
+]
118
+
119
+[[package]]
120
+name = "fnv"
121
+version = "1.0.6"
122
+source = "registry+https://github.com/rust-lang/crates.io-index"
123
+
124
+[[package]]
125
+name = "fuchsia-zircon"
126
+version = "0.3.3"
127
+source = "registry+https://github.com/rust-lang/crates.io-index"
128
+dependencies = [
129
+ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
130
+ "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
131
+]
132
+
133
+[[package]]
134
+name = "fuchsia-zircon-sys"
135
+version = "0.3.3"
136
+source = "registry+https://github.com/rust-lang/crates.io-index"
137
+
138
+[[package]]
139
+name = "futures"
140
+version = "0.1.24"
141
+source = "registry+https://github.com/rust-lang/crates.io-index"
142
+
143
+[[package]]
144
+name = "futures-cpupool"
145
+version = "0.1.8"
146
+source = "registry+https://github.com/rust-lang/crates.io-index"
147
+dependencies = [
148
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
149
+ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
150
+]
151
+
152
+[[package]]
153
+name = "h2"
154
+version = "0.1.12"
155
+source = "registry+https://github.com/rust-lang/crates.io-index"
156
+dependencies = [
157
+ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
158
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
159
+ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
160
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
161
+ "http 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
162
+ "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
163
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
164
+ "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
165
+ "string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
166
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
167
+]
168
+
169
+[[package]]
170
+name = "http"
171
+version = "0.1.11"
172
+source = "registry+https://github.com/rust-lang/crates.io-index"
173
+dependencies = [
174
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
175
+ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
176
+ "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
177
+]
178
+
179
+[[package]]
180
+name = "httparse"
181
+version = "1.3.2"
182
+source = "registry+https://github.com/rust-lang/crates.io-index"
183
+
184
+[[package]]
185
+name = "hyper"
186
+version = "0.12.9"
187
+source = "registry+https://github.com/rust-lang/crates.io-index"
188
+dependencies = [
189
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
190
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
191
+ "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
192
+ "h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
193
+ "http 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
194
+ "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
195
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
196
+ "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
197
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
198
+ "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
199
+ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
200
+ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
201
+ "tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
202
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
203
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
204
+ "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
205
+ "tokio-tcp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
206
+ "tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
207
+ "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
208
+]
209
+
210
+[[package]]
211
+name = "hyper-rustls"
212
+version = "0.14.0"
213
+source = "registry+https://github.com/rust-lang/crates.io-index"
214
+dependencies = [
215
+ "ct-logs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
216
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
217
+ "http 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
218
+ "hyper 0.12.9 (registry+https://github.com/rust-lang/crates.io-index)",
219
+ "rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
220
+ "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
221
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
222
+ "tokio-rustls 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
223
+ "tokio-tcp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
224
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
225
+ "webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
226
+]
227
+
228
+[[package]]
229
+name = "indexmap"
230
+version = "1.0.1"
231
+source = "registry+https://github.com/rust-lang/crates.io-index"
232
+
233
+[[package]]
234
+name = "iovec"
235
+version = "0.1.2"
236
+source = "registry+https://github.com/rust-lang/crates.io-index"
237
+dependencies = [
238
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
239
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
240
+]
241
+
242
+[[package]]
243
+name = "itoa"
244
+version = "0.4.2"
245
+source = "registry+https://github.com/rust-lang/crates.io-index"
246
+
247
+[[package]]
248
+name = "kernel32-sys"
249
+version = "0.2.2"
250
+source = "registry+https://github.com/rust-lang/crates.io-index"
251
+dependencies = [
252
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
253
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
254
+]
255
+
256
+[[package]]
257
+name = "lazy_static"
258
+version = "1.1.0"
259
+source = "registry+https://github.com/rust-lang/crates.io-index"
260
+dependencies = [
261
+ "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
262
+]
263
+
264
+[[package]]
265
+name = "lazycell"
266
+version = "1.0.0"
267
+source = "registry+https://github.com/rust-lang/crates.io-index"
268
+
269
+[[package]]
270
+name = "libc"
271
+version = "0.2.43"
272
+source = "registry+https://github.com/rust-lang/crates.io-index"
273
+
274
+[[package]]
275
+name = "lock_api"
276
+version = "0.1.3"
277
+source = "registry+https://github.com/rust-lang/crates.io-index"
278
+dependencies = [
279
+ "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
280
+ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
281
+]
282
+
283
+[[package]]
284
+name = "log"
285
+version = "0.4.5"
286
+source = "registry+https://github.com/rust-lang/crates.io-index"
287
+dependencies = [
288
+ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
289
+]
290
+
291
+[[package]]
292
+name = "memoffset"
293
+version = "0.2.1"
294
+source = "registry+https://github.com/rust-lang/crates.io-index"
295
+
296
+[[package]]
297
+name = "mio"
298
+version = "0.6.16"
299
+source = "registry+https://github.com/rust-lang/crates.io-index"
300
+dependencies = [
301
+ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
302
+ "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
303
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
304
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
305
+ "lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
306
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
307
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
308
+ "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
309
+ "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
310
+ "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
311
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
312
+]
313
+
314
+[[package]]
315
+name = "mio-uds"
316
+version = "0.6.7"
317
+source = "registry+https://github.com/rust-lang/crates.io-index"
318
+dependencies = [
319
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
320
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
321
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
322
+]
323
+
324
+[[package]]
325
+name = "miow"
326
+version = "0.2.1"
327
+source = "registry+https://github.com/rust-lang/crates.io-index"
328
+dependencies = [
329
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
330
+ "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
331
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
332
+ "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
333
+]
334
+
335
+[[package]]
336
+name = "net2"
337
+version = "0.2.33"
338
+source = "registry+https://github.com/rust-lang/crates.io-index"
339
+dependencies = [
340
+ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
341
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
342
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
343
+]
344
+
345
+[[package]]
346
+name = "nodrop"
347
+version = "0.1.12"
348
+source = "registry+https://github.com/rust-lang/crates.io-index"
349
+
350
+[[package]]
351
+name = "num_cpus"
352
+version = "1.8.0"
353
+source = "registry+https://github.com/rust-lang/crates.io-index"
354
+dependencies = [
355
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
356
+]
357
+
358
+[[package]]
359
+name = "owning_ref"
360
+version = "0.3.3"
361
+source = "registry+https://github.com/rust-lang/crates.io-index"
362
+dependencies = [
363
+ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
364
+]
365
+
366
+[[package]]
367
+name = "parking_lot"
368
+version = "0.6.4"
369
+source = "registry+https://github.com/rust-lang/crates.io-index"
370
+dependencies = [
371
+ "lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
372
+ "parking_lot_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
373
+]
374
+
375
+[[package]]
376
+name = "parking_lot_core"
377
+version = "0.3.0"
378
+source = "registry+https://github.com/rust-lang/crates.io-index"
379
+dependencies = [
380
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
381
+ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
382
+ "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
383
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
384
+]
385
+
386
+[[package]]
387
+name = "rand"
388
+version = "0.5.5"
389
+source = "registry+https://github.com/rust-lang/crates.io-index"
390
+dependencies = [
391
+ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
392
+ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
393
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
394
+ "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
395
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
396
+]
397
+
398
+[[package]]
399
+name = "rand_core"
400
+version = "0.2.1"
401
+source = "registry+https://github.com/rust-lang/crates.io-index"
402
+
403
+[[package]]
404
+name = "redox_syscall"
405
+version = "0.1.40"
406
+source = "registry+https://github.com/rust-lang/crates.io-index"
407
+
408
+[[package]]
409
+name = "ring"
410
+version = "0.13.2"
411
+source = "registry+https://github.com/rust-lang/crates.io-index"
412
+dependencies = [
413
+ "cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
414
+ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
415
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
416
+ "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
417
+]
418
+
419
+[[package]]
420
+name = "rustc-demangle"
421
+version = "0.1.9"
422
+source = "registry+https://github.com/rust-lang/crates.io-index"
423
+
424
+[[package]]
425
+name = "rustc_version"
426
+version = "0.2.3"
427
+source = "registry+https://github.com/rust-lang/crates.io-index"
428
+dependencies = [
429
+ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
430
+]
431
+
432
+[[package]]
433
+name = "rustls"
434
+version = "0.13.1"
435
+source = "registry+https://github.com/rust-lang/crates.io-index"
436
+dependencies = [
437
+ "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
438
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
439
+ "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)",
440
+ "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
441
+ "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
442
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
443
+]
444
+
445
+[[package]]
446
+name = "safemem"
447
+version = "0.2.0"
448
+source = "registry+https://github.com/rust-lang/crates.io-index"
449
+
450
+[[package]]
451
+name = "scoped-tls"
452
+version = "0.1.2"
453
+source = "registry+https://github.com/rust-lang/crates.io-index"
454
+
455
+[[package]]
456
+name = "scopeguard"
457
+version = "0.3.3"
458
+source = "registry+https://github.com/rust-lang/crates.io-index"
459
+
460
+[[package]]
461
+name = "sct"
462
+version = "0.4.0"
463
+source = "registry+https://github.com/rust-lang/crates.io-index"
464
+dependencies = [
465
+ "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)",
466
+ "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
467
+]
468
+
469
+[[package]]
470
+name = "semver"
471
+version = "0.9.0"
472
+source = "registry+https://github.com/rust-lang/crates.io-index"
473
+dependencies = [
474
+ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
475
+]
476
+
477
+[[package]]
478
+name = "semver-parser"
479
+version = "0.7.0"
480
+source = "registry+https://github.com/rust-lang/crates.io-index"
481
+
482
+[[package]]
483
+name = "slab"
484
+version = "0.4.1"
485
+source = "registry+https://github.com/rust-lang/crates.io-index"
486
+
487
+[[package]]
488
+name = "smallvec"
489
+version = "0.6.5"
490
+source = "registry+https://github.com/rust-lang/crates.io-index"
491
+dependencies = [
492
+ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
493
+]
494
+
495
+[[package]]
496
+name = "stable_deref_trait"
497
+version = "1.1.1"
498
+source = "registry+https://github.com/rust-lang/crates.io-index"
499
+
500
+[[package]]
501
+name = "string"
502
+version = "0.1.1"
503
+source = "registry+https://github.com/rust-lang/crates.io-index"
504
+
505
+[[package]]
506
+name = "time"
507
+version = "0.1.40"
508
+source = "registry+https://github.com/rust-lang/crates.io-index"
509
+dependencies = [
510
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
511
+ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
512
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
513
+]
514
+
515
+[[package]]
516
+name = "tokio"
517
+version = "0.1.8"
518
+source = "registry+https://github.com/rust-lang/crates.io-index"
519
+dependencies = [
520
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
521
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
522
+ "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
523
+ "tokio-current-thread 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
524
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
525
+ "tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
526
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
527
+ "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
528
+ "tokio-tcp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
529
+ "tokio-threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
530
+ "tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
531
+ "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
532
+ "tokio-uds 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
533
+]
534
+
535
+[[package]]
536
+name = "tokio-codec"
537
+version = "0.1.0"
538
+source = "registry+https://github.com/rust-lang/crates.io-index"
539
+dependencies = [
540
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
541
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
542
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
543
+]
544
+
545
+[[package]]
546
+name = "tokio-core"
547
+version = "0.1.17"
548
+source = "registry+https://github.com/rust-lang/crates.io-index"
549
+dependencies = [
550
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
551
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
552
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
553
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
554
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
555
+ "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
556
+ "tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
557
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
558
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
559
+ "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
560
+ "tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
561
+]
562
+
563
+[[package]]
564
+name = "tokio-current-thread"
565
+version = "0.1.1"
566
+source = "registry+https://github.com/rust-lang/crates.io-index"
567
+dependencies = [
568
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
569
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
570
+]
571
+
572
+[[package]]
573
+name = "tokio-executor"
574
+version = "0.1.4"
575
+source = "registry+https://github.com/rust-lang/crates.io-index"
576
+dependencies = [
577
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
578
+]
579
+
580
+[[package]]
581
+name = "tokio-fs"
582
+version = "0.1.3"
583
+source = "registry+https://github.com/rust-lang/crates.io-index"
584
+dependencies = [
585
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
586
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
587
+ "tokio-threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
588
+]
589
+
590
+[[package]]
591
+name = "tokio-io"
592
+version = "0.1.8"
593
+source = "registry+https://github.com/rust-lang/crates.io-index"
594
+dependencies = [
595
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
596
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
597
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
598
+]
599
+
600
+[[package]]
601
+name = "tokio-reactor"
602
+version = "0.1.5"
603
+source = "registry+https://github.com/rust-lang/crates.io-index"
604
+dependencies = [
605
+ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
606
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
607
+ "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
608
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
609
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
610
+ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
611
+ "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
612
+ "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
613
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
614
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
615
+]
616
+
617
+[[package]]
618
+name = "tokio-rustls"
619
+version = "0.7.2"
620
+source = "registry+https://github.com/rust-lang/crates.io-index"
621
+dependencies = [
622
+ "rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
623
+ "tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
624
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
625
+]
626
+
627
+[[package]]
628
+name = "tokio-tcp"
629
+version = "0.1.1"
630
+source = "registry+https://github.com/rust-lang/crates.io-index"
631
+dependencies = [
632
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
633
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
634
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
635
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
636
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
637
+ "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
638
+]
639
+
640
+[[package]]
641
+name = "tokio-threadpool"
642
+version = "0.1.6"
643
+source = "registry+https://github.com/rust-lang/crates.io-index"
644
+dependencies = [
645
+ "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
646
+ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
647
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
648
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
649
+ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
650
+ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
651
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
652
+]
653
+
654
+[[package]]
655
+name = "tokio-timer"
656
+version = "0.2.6"
657
+source = "registry+https://github.com/rust-lang/crates.io-index"
658
+dependencies = [
659
+ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
660
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
661
+ "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
662
+ "tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
663
+]
664
+
665
+[[package]]
666
+name = "tokio-udp"
667
+version = "0.1.2"
668
+source = "registry+https://github.com/rust-lang/crates.io-index"
669
+dependencies = [
670
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
671
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
672
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
673
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
674
+ "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
675
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
676
+ "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
677
+]
678
+
679
+[[package]]
680
+name = "tokio-uds"
681
+version = "0.2.1"
682
+source = "registry+https://github.com/rust-lang/crates.io-index"
683
+dependencies = [
684
+ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
685
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
686
+ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
687
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
688
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
689
+ "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
690
+ "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
691
+ "tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
692
+ "tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
693
+]
694
+
695
+[[package]]
696
+name = "try-lock"
697
+version = "0.2.2"
698
+source = "registry+https://github.com/rust-lang/crates.io-index"
699
+
700
+[[package]]
701
+name = "unreachable"
702
+version = "1.0.0"
703
+source = "registry+https://github.com/rust-lang/crates.io-index"
704
+dependencies = [
705
+ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
706
+]
707
+
708
+[[package]]
709
+name = "untrusted"
710
+version = "0.6.2"
711
+source = "registry+https://github.com/rust-lang/crates.io-index"
712
+
713
+[[package]]
714
+name = "version_check"
715
+version = "0.1.4"
716
+source = "registry+https://github.com/rust-lang/crates.io-index"
717
+
718
+[[package]]
719
+name = "void"
720
+version = "1.0.2"
721
+source = "registry+https://github.com/rust-lang/crates.io-index"
722
+
723
+[[package]]
724
+name = "want"
725
+version = "0.0.6"
726
+source = "registry+https://github.com/rust-lang/crates.io-index"
727
+dependencies = [
728
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
729
+ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
730
+ "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
731
+]
732
+
733
+[[package]]
734
+name = "webpki"
735
+version = "0.18.1"
736
+source = "registry+https://github.com/rust-lang/crates.io-index"
737
+dependencies = [
738
+ "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)",
739
+ "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
740
+]
741
+
742
+[[package]]
743
+name = "webpki-roots"
744
+version = "0.15.0"
745
+source = "registry+https://github.com/rust-lang/crates.io-index"
746
+dependencies = [
747
+ "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
748
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
749
+]
750
+
751
+[[package]]
752
+name = "winapi"
753
+version = "0.2.8"
754
+source = "registry+https://github.com/rust-lang/crates.io-index"
755
+
756
+[[package]]
757
+name = "winapi"
758
+version = "0.3.5"
759
+source = "registry+https://github.com/rust-lang/crates.io-index"
760
+dependencies = [
761
+ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
762
+ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
763
+]
764
+
765
+[[package]]
766
+name = "winapi-build"
767
+version = "0.1.1"
768
+source = "registry+https://github.com/rust-lang/crates.io-index"
769
+
770
+[[package]]
771
+name = "winapi-i686-pc-windows-gnu"
772
+version = "0.4.0"
773
+source = "registry+https://github.com/rust-lang/crates.io-index"
774
+
775
+[[package]]
776
+name = "winapi-x86_64-pc-windows-gnu"
777
+version = "0.4.0"
778
+source = "registry+https://github.com/rust-lang/crates.io-index"
779
+
780
+[[package]]
781
+name = "ws2_32-sys"
782
+version = "0.2.1"
783
+source = "registry+https://github.com/rust-lang/crates.io-index"
784
+dependencies = [
785
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
786
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
787
+]
788
+
789
+[[package]]
790
+name = "yad"
791
+version = "0.1.0"
792
+dependencies = [
793
+ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
794
+ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
795
+ "hyper 0.12.9 (registry+https://github.com/rust-lang/crates.io-index)",
796
+ "hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
797
+ "tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
798
+]
799
+
800
+[metadata]
801
+"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
802
+"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
803
+"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
804
+"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9"
805
+"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
806
+"checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781"
807
+"checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62"
808
+"checksum cc 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "c37f0efaa4b9b001fa6f02d4b644dee4af97d3414df07c51e3e4f015f3a3e131"
809
+"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
810
+"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
811
+"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1"
812
+"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9"
813
+"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015"
814
+"checksum ct-logs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95a4bf5107667e12bf6ce31a3a5066d67acc88942b6742117a41198734aaccaa"
815
+"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
816
+"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
817
+"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
818
+"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
819
+"checksum futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "0c84b40c7e2de99ffd70602db314a7a8c26b2b3d830e6f7f7a142a8860ab3ca4"
820
+"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
821
+"checksum h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "a27e7ed946e8335bdf9a191bc1b9b14a03ba822d013d2f58437f4fabcbd7fc2c"
822
+"checksum http 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "7fd7d757dfc163d8e00b084f8961a14e15489b494b553bd1738348829a5a26f9"
823
+"checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540"
824
+"checksum hyper 0.12.9 (registry+https://github.com/rust-lang/crates.io-index)" = "081289d17dce471c8cbc0e69a3dd073b627e08338561d1167ab620b754d9fe90"
825
+"checksum hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68f2aa6b1681795bf4da8063f718cd23145aa0c9a5143d9787b345aa60d38ee4"
826
+"checksum indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08173ba1e906efb6538785a8844dd496f5d34f0a2d88038e95195172fc667220"
827
+"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
828
+"checksum itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5adb58558dcd1d786b5f0bd15f3226ee23486e24b7b58304b60f64dc68e62606"
829
+"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
830
+"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
831
+"checksum lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50"
832
+"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
833
+"checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
834
+"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f"
835
+"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
836
+"checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432"
837
+"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125"
838
+"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
839
+"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
840
+"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
841
+"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30"
842
+"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
843
+"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
844
+"checksum parking_lot_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06a2b6aae052309c2fd2161ef58f5067bc17bb758377a0de9d4b279d603fdd8a"
845
+"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
846
+"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
847
+"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
848
+"checksum ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe642b9dd1ba0038d78c4a3999d1ee56178b4d415c1e1fbaba83b06dce012f0"
849
+"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395"
850
+"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
851
+"checksum rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "942b71057b31981152970d57399c25f72e27a6ee0d207a669d8304cabf44705b"
852
+"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
853
+"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
854
+"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
855
+"checksum sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb8f61f9e6eadd062a71c380043d28036304a4706b3c4dd001ff3387ed00745a"
856
+"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
857
+"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
858
+"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d"
859
+"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d"
860
+"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
861
+"checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970"
862
+"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
863
+"checksum tokio 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fbb6a6e9db2702097bfdfddcb09841211ad423b86c75b5ddaca1d62842ac492c"
864
+"checksum tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "881e9645b81c2ce95fcb799ded2c29ffb9f25ef5bef909089a420e5961dd8ccb"
865
+"checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71"
866
+"checksum tokio-current-thread 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fdfb899688ac16f618076bd09215edbfda0fd5dfecb375b6942636cb31fa8a7"
867
+"checksum tokio-executor 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "84823b932d566bc3c6aa644df4ca36cb38593c50b7db06011fd4e12e31e4047e"
868
+"checksum tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5cbe4ca6e71cb0b62a66e4e6f53a8c06a6eefe46cc5f665ad6f274c9906f135"
869
+"checksum tokio-io 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6cc2de7725863c86ac71b0b9068476fec50834f055a243558ef1655bbd34cb"
870
+"checksum tokio-reactor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4bfbaf9f260635649ec26b6fb4aded03887295ffcd999f6e43fd2c4758f758ea"
871
+"checksum tokio-rustls 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "208d62fa3e015426e3c64039d9d20adf054a3c9b4d9445560f1c41c75bef3eab"
872
+"checksum tokio-tcp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4c329b47f071eb8a746040465fa751bd95e4716e98daef6a9b4e434c17d565"
873
+"checksum tokio-threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a5758cecb6e0633cea5d563ac07c975e04961690b946b04fd84e7d6445a8f6af"
874
+"checksum tokio-timer 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d03fa701f9578a01b7014f106b47f0a363b4727a7f3f75d666e312ab7acbbf1c"
875
+"checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c"
876
+"checksum tokio-uds 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "424c1ed15a0132251813ccea50640b224c809d6ceafb88154c1a8775873a0e89"
877
+"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382"
878
+"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
879
+"checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f"
880
+"checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051"
881
+"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
882
+"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3"
883
+"checksum webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "17d7967316d8411ca3b01821ee6c332bde138ba4363becdb492f12e514daa17f"
884
+"checksum webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85d1f408918fd590908a70d36b7ac388db2edc221470333e4d6e5b598e44cabf"
885
+"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
886
+"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
887
+"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
888
+"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
889
+"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
890
+"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"

+ 11
- 0
Cargo.toml View File

@@ -0,0 +1,11 @@
1
+[package]
2
+name = "yad"
3
+version = "0.1.0"
4
+authors = ["Peter Cai <[email protected]>"]
5
+
6
+[dependencies]
7
+error-chain = "0.12"
8
+futures = "0.1"
9
+hyper = "0.12"
10
+hyper-rustls = "0.14"
11
+tokio = "0.1"

+ 30
- 0
src/main.rs View File

@@ -0,0 +1,30 @@
1
+#[macro_use]
2
+extern crate error_chain;
3
+extern crate futures;
4
+extern crate hyper;
5
+extern crate hyper_rustls;
6
+extern crate tokio;
7
+
8
+mod errors {
9
+    error_chain! {
10
+        foreign_links {
11
+            HyperError(::hyper::Error);
12
+            ToStrError(::hyper::header::ToStrError);
13
+        }
14
+    }
15
+}
16
+
17
+mod util;
18
+mod manager;
19
+
20
+use futures::Future;
21
+
22
+fn main() {
23
+    tokio::run(manager::DownloadManager::new(
24
+        std::env::args().skip(1).take(1).last().unwrap().parse().unwrap())
25
+            .and_then(|m| {
26
+                println!("{}", m.file_len);
27
+                Ok(())
28
+            })
29
+            .map_err(|_| ()))
30
+}

+ 32
- 0
src/manager.rs View File

@@ -0,0 +1,32 @@
1
+use errors::*;
2
+use futures::Future;
3
+use hyper::{Body, Request, Uri};
4
+use hyper::header;
5
+use util::*;
6
+
7
+#[derive(Debug)]
8
+pub struct DownloadManager {
9
+    url: Uri,
10
+    pub file_len: usize,
11
+}
12
+
13
+impl DownloadManager {
14
+    pub fn new(url: Uri) -> impl Future<Item = DownloadManager, Error = Error> {
15
+        hyper_client().request(Request::head(url.clone()).body(Body::empty()).unwrap())
16
+            .chain_err(|| "aaa")
17
+            .and_then(|r| {
18
+                r.headers().get(header::CONTENT_LENGTH)
19
+                    .ok_or("Failed to request for content length".into())
20
+                    .and_then(|l| l.to_str()
21
+                        .chain_err(|| "Failed to get content length"))
22
+                    .and_then(|l| l.parse()
23
+                        .chain_err(|| "Failed to parse content length"))
24
+            })
25
+            .map(|len| {
26
+                DownloadManager {
27
+                    url: url,
28
+                    file_len: len
29
+                }
30
+            })
31
+    }
32
+}

+ 68
- 0
src/util.rs View File

@@ -0,0 +1,68 @@
1
+use errors::*;
2
+use futures::{Future, Poll};
3
+use hyper::{client, Client};
4
+use hyper::body::Payload;
5
+use hyper_rustls::HttpsConnector;
6
+use std::error;
7
+
8
+pub fn hyper_client<B: Payload>() -> Client<HttpsConnector<client::HttpConnector>, B> {
9
+    client::Builder::default()
10
+        .build(HttpsConnector::new(4))
11
+}
12
+
13
+
14
+// Glue code to make error-chain work with futures
15
+// Source: <https://github.com/alexcrichton/sccache/blob/master/src/errors.rs>
16
+// Modified to avoid static lifetimes and heap allocation
17
+pub trait FutureChainErr<'a, F: Future, T>
18
+    where F: Future + 'a,
19
+          F::Error: error::Error + Send + 'static {
20
+    fn chain_err<CB, E>(self, callback: CB) -> ChainErr<F, CB, E>
21
+        where CB: FnOnce() -> E + Clone + 'a,
22
+              E: Into<ErrorKind>;
23
+}
24
+
25
+impl<'a, F> FutureChainErr<'a, F, F::Item> for F
26
+    where F: Future + 'a,
27
+          F::Error: error::Error + Send + 'static,
28
+{
29
+    fn chain_err<C, E>(self, callback: C) -> ChainErr<F, C, E>
30
+        where C: FnOnce() -> E + Clone + 'a,
31
+              E: Into<ErrorKind>,
32
+    {
33
+        ChainErr::new(self, callback)
34
+    }
35
+}
36
+
37
+pub struct ChainErr<F: Future, CB, EK: Into<ErrorKind>>
38
+    where F::Error: error::Error + Send + 'static,
39
+          CB: FnOnce() -> EK + Clone {
40
+    future: F,
41
+    callback: CB
42
+}
43
+
44
+impl<F: Future, CB, EK: Into<ErrorKind>> ChainErr<F, CB, EK>
45
+    where F::Error: error::Error + Send + 'static,
46
+          CB: FnOnce() -> EK + Clone {
47
+
48
+    fn new(future: F, callback: CB) -> ChainErr<F, CB, EK> {
49
+        ChainErr {
50
+            future,
51
+            callback: callback
52
+        }
53
+    }
54
+
55
+}
56
+
57
+impl<F: Future, CB, EK: Into<ErrorKind>> Future for ChainErr<F, CB, EK>
58
+    where F::Error: error::Error + Send + 'static,
59
+          CB: FnOnce() -> EK + Clone {
60
+    type Error = Error;
61
+    type Item = F::Item;
62
+
63
+    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
64
+        let p = self.future.poll();
65
+        p.chain_err(self.callback.clone())
66
+    }
67
+}
68
+

Loading…
Cancel
Save