├── 01-ignore-the-error ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── 02-terminate-the-program ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── 03-use-a-fallback-value ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── 04-bubble-up-the-error ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── 05-bubble-up-multiple-errors ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── 06-match-boxed-errors ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── 07-create-custom-errors ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ ├── error.rs │ └── main.rs ├── 08-bubble-up-custom-errors ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ ├── error.rs │ └── main.rs └── readme.md /01-ignore-the-error/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /01-ignore-the-error/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "rust-error-handling-examples" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /01-ignore-the-error/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | -------------------------------------------------------------------------------- /01-ignore-the-error/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn main() { 4 | // Try changing the file name 5 | let content = fs::read_to_string("./Cargo.toml").unwrap(); 6 | println!("{}", content) 7 | } 8 | -------------------------------------------------------------------------------- /02-terminate-the-program/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /02-terminate-the-program/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "rust-error-handling-examples" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /02-terminate-the-program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | -------------------------------------------------------------------------------- /02-terminate-the-program/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | fn main() { 4 | // Try changing the file name 5 | let content = fs::read_to_string("./Cargo.toml").expect("Can't read Cargo.toml"); 6 | println!("{}", content) 7 | } 8 | -------------------------------------------------------------------------------- /03-use-a-fallback-value/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /03-use-a-fallback-value/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "rust-error-handling-examples" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /03-use-a-fallback-value/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | -------------------------------------------------------------------------------- /03-use-a-fallback-value/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | // Try running with a different env var - `PORT=4000 cargo run` 5 | let port = env::var("PORT").unwrap_or("3000".to_string()); 6 | println!("{}", port); 7 | } 8 | -------------------------------------------------------------------------------- /04-bubble-up-the-error/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /04-bubble-up-the-error/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "1.0.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 8 | 9 | [[package]] 10 | name = "base64" 11 | version = "0.12.3" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 14 | 15 | [[package]] 16 | name = "bitflags" 17 | version = "1.2.1" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 20 | 21 | [[package]] 22 | name = "bumpalo" 23 | version = "3.4.0" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 26 | 27 | [[package]] 28 | name = "bytes" 29 | version = "0.5.6" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 32 | 33 | [[package]] 34 | name = "cc" 35 | version = "1.0.58" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" 38 | 39 | [[package]] 40 | name = "cfg-if" 41 | version = "0.1.10" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 44 | 45 | [[package]] 46 | name = "core-foundation" 47 | version = "0.7.0" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 50 | dependencies = [ 51 | "core-foundation-sys", 52 | "libc", 53 | ] 54 | 55 | [[package]] 56 | name = "core-foundation-sys" 57 | version = "0.7.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 60 | 61 | [[package]] 62 | name = "dtoa" 63 | version = "0.4.6" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" 66 | 67 | [[package]] 68 | name = "encoding_rs" 69 | version = "0.8.23" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" 72 | dependencies = [ 73 | "cfg-if", 74 | ] 75 | 76 | [[package]] 77 | name = "fnv" 78 | version = "1.0.7" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 81 | 82 | [[package]] 83 | name = "foreign-types" 84 | version = "0.3.2" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 87 | dependencies = [ 88 | "foreign-types-shared", 89 | ] 90 | 91 | [[package]] 92 | name = "foreign-types-shared" 93 | version = "0.1.1" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 96 | 97 | [[package]] 98 | name = "fuchsia-zircon" 99 | version = "0.3.3" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 102 | dependencies = [ 103 | "bitflags", 104 | "fuchsia-zircon-sys", 105 | ] 106 | 107 | [[package]] 108 | name = "fuchsia-zircon-sys" 109 | version = "0.3.3" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 112 | 113 | [[package]] 114 | name = "futures-channel" 115 | version = "0.3.5" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 118 | dependencies = [ 119 | "futures-core", 120 | ] 121 | 122 | [[package]] 123 | name = "futures-core" 124 | version = "0.3.5" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 127 | 128 | [[package]] 129 | name = "futures-io" 130 | version = "0.3.5" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 133 | 134 | [[package]] 135 | name = "futures-sink" 136 | version = "0.3.5" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 139 | 140 | [[package]] 141 | name = "futures-task" 142 | version = "0.3.5" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 145 | dependencies = [ 146 | "once_cell", 147 | ] 148 | 149 | [[package]] 150 | name = "futures-util" 151 | version = "0.3.5" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 154 | dependencies = [ 155 | "futures-core", 156 | "futures-io", 157 | "futures-task", 158 | "memchr", 159 | "pin-project", 160 | "pin-utils", 161 | "slab", 162 | ] 163 | 164 | [[package]] 165 | name = "getrandom" 166 | version = "0.1.14" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 169 | dependencies = [ 170 | "cfg-if", 171 | "libc", 172 | "wasi", 173 | ] 174 | 175 | [[package]] 176 | name = "h2" 177 | version = "0.2.6" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" 180 | dependencies = [ 181 | "bytes", 182 | "fnv", 183 | "futures-core", 184 | "futures-sink", 185 | "futures-util", 186 | "http", 187 | "indexmap", 188 | "slab", 189 | "tokio", 190 | "tokio-util", 191 | "tracing", 192 | ] 193 | 194 | [[package]] 195 | name = "hashbrown" 196 | version = "0.8.1" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" 199 | dependencies = [ 200 | "autocfg", 201 | ] 202 | 203 | [[package]] 204 | name = "hermit-abi" 205 | version = "0.1.15" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 208 | dependencies = [ 209 | "libc", 210 | ] 211 | 212 | [[package]] 213 | name = "http" 214 | version = "0.2.1" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 217 | dependencies = [ 218 | "bytes", 219 | "fnv", 220 | "itoa", 221 | ] 222 | 223 | [[package]] 224 | name = "http-body" 225 | version = "0.3.1" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 228 | dependencies = [ 229 | "bytes", 230 | "http", 231 | ] 232 | 233 | [[package]] 234 | name = "httparse" 235 | version = "1.3.4" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 238 | 239 | [[package]] 240 | name = "hyper" 241 | version = "0.13.7" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" 244 | dependencies = [ 245 | "bytes", 246 | "futures-channel", 247 | "futures-core", 248 | "futures-util", 249 | "h2", 250 | "http", 251 | "http-body", 252 | "httparse", 253 | "itoa", 254 | "pin-project", 255 | "socket2", 256 | "time", 257 | "tokio", 258 | "tower-service", 259 | "tracing", 260 | "want", 261 | ] 262 | 263 | [[package]] 264 | name = "hyper-tls" 265 | version = "0.4.3" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" 268 | dependencies = [ 269 | "bytes", 270 | "hyper", 271 | "native-tls", 272 | "tokio", 273 | "tokio-tls", 274 | ] 275 | 276 | [[package]] 277 | name = "idna" 278 | version = "0.2.0" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 281 | dependencies = [ 282 | "matches", 283 | "unicode-bidi", 284 | "unicode-normalization", 285 | ] 286 | 287 | [[package]] 288 | name = "indexmap" 289 | version = "1.5.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" 292 | dependencies = [ 293 | "autocfg", 294 | "hashbrown", 295 | ] 296 | 297 | [[package]] 298 | name = "iovec" 299 | version = "0.1.4" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 302 | dependencies = [ 303 | "libc", 304 | ] 305 | 306 | [[package]] 307 | name = "ipnet" 308 | version = "2.3.0" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 311 | 312 | [[package]] 313 | name = "itoa" 314 | version = "0.4.6" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 317 | 318 | [[package]] 319 | name = "js-sys" 320 | version = "0.3.44" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" 323 | dependencies = [ 324 | "wasm-bindgen", 325 | ] 326 | 327 | [[package]] 328 | name = "kernel32-sys" 329 | version = "0.2.2" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 332 | dependencies = [ 333 | "winapi 0.2.8", 334 | "winapi-build", 335 | ] 336 | 337 | [[package]] 338 | name = "lazy_static" 339 | version = "1.4.0" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 342 | 343 | [[package]] 344 | name = "libc" 345 | version = "0.2.74" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 348 | 349 | [[package]] 350 | name = "log" 351 | version = "0.4.11" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 354 | dependencies = [ 355 | "cfg-if", 356 | ] 357 | 358 | [[package]] 359 | name = "matches" 360 | version = "0.1.8" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 363 | 364 | [[package]] 365 | name = "memchr" 366 | version = "2.3.3" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 369 | 370 | [[package]] 371 | name = "mime" 372 | version = "0.3.16" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 375 | 376 | [[package]] 377 | name = "mime_guess" 378 | version = "2.0.3" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 381 | dependencies = [ 382 | "mime", 383 | "unicase", 384 | ] 385 | 386 | [[package]] 387 | name = "mio" 388 | version = "0.6.22" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 391 | dependencies = [ 392 | "cfg-if", 393 | "fuchsia-zircon", 394 | "fuchsia-zircon-sys", 395 | "iovec", 396 | "kernel32-sys", 397 | "libc", 398 | "log", 399 | "miow", 400 | "net2", 401 | "slab", 402 | "winapi 0.2.8", 403 | ] 404 | 405 | [[package]] 406 | name = "miow" 407 | version = "0.2.1" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 410 | dependencies = [ 411 | "kernel32-sys", 412 | "net2", 413 | "winapi 0.2.8", 414 | "ws2_32-sys", 415 | ] 416 | 417 | [[package]] 418 | name = "native-tls" 419 | version = "0.2.4" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 422 | dependencies = [ 423 | "lazy_static", 424 | "libc", 425 | "log", 426 | "openssl", 427 | "openssl-probe", 428 | "openssl-sys", 429 | "schannel", 430 | "security-framework", 431 | "security-framework-sys", 432 | "tempfile", 433 | ] 434 | 435 | [[package]] 436 | name = "net2" 437 | version = "0.2.34" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 440 | dependencies = [ 441 | "cfg-if", 442 | "libc", 443 | "winapi 0.3.9", 444 | ] 445 | 446 | [[package]] 447 | name = "num_cpus" 448 | version = "1.13.0" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 451 | dependencies = [ 452 | "hermit-abi", 453 | "libc", 454 | ] 455 | 456 | [[package]] 457 | name = "once_cell" 458 | version = "1.4.0" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 461 | 462 | [[package]] 463 | name = "openssl" 464 | version = "0.10.30" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 467 | dependencies = [ 468 | "bitflags", 469 | "cfg-if", 470 | "foreign-types", 471 | "lazy_static", 472 | "libc", 473 | "openssl-sys", 474 | ] 475 | 476 | [[package]] 477 | name = "openssl-probe" 478 | version = "0.1.2" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 481 | 482 | [[package]] 483 | name = "openssl-sys" 484 | version = "0.9.58" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 487 | dependencies = [ 488 | "autocfg", 489 | "cc", 490 | "libc", 491 | "pkg-config", 492 | "vcpkg", 493 | ] 494 | 495 | [[package]] 496 | name = "percent-encoding" 497 | version = "2.1.0" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 500 | 501 | [[package]] 502 | name = "pin-project" 503 | version = "0.4.23" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" 506 | dependencies = [ 507 | "pin-project-internal", 508 | ] 509 | 510 | [[package]] 511 | name = "pin-project-internal" 512 | version = "0.4.23" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" 515 | dependencies = [ 516 | "proc-macro2", 517 | "quote", 518 | "syn", 519 | ] 520 | 521 | [[package]] 522 | name = "pin-project-lite" 523 | version = "0.1.7" 524 | source = "registry+https://github.com/rust-lang/crates.io-index" 525 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 526 | 527 | [[package]] 528 | name = "pin-utils" 529 | version = "0.1.0" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 532 | 533 | [[package]] 534 | name = "pkg-config" 535 | version = "0.3.18" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" 538 | 539 | [[package]] 540 | name = "ppv-lite86" 541 | version = "0.2.8" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 544 | 545 | [[package]] 546 | name = "proc-macro2" 547 | version = "1.0.19" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 550 | dependencies = [ 551 | "unicode-xid", 552 | ] 553 | 554 | [[package]] 555 | name = "quote" 556 | version = "1.0.7" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 559 | dependencies = [ 560 | "proc-macro2", 561 | ] 562 | 563 | [[package]] 564 | name = "rand" 565 | version = "0.7.3" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 568 | dependencies = [ 569 | "getrandom", 570 | "libc", 571 | "rand_chacha", 572 | "rand_core", 573 | "rand_hc", 574 | ] 575 | 576 | [[package]] 577 | name = "rand_chacha" 578 | version = "0.2.2" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 581 | dependencies = [ 582 | "ppv-lite86", 583 | "rand_core", 584 | ] 585 | 586 | [[package]] 587 | name = "rand_core" 588 | version = "0.5.1" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 591 | dependencies = [ 592 | "getrandom", 593 | ] 594 | 595 | [[package]] 596 | name = "rand_hc" 597 | version = "0.2.0" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 600 | dependencies = [ 601 | "rand_core", 602 | ] 603 | 604 | [[package]] 605 | name = "redox_syscall" 606 | version = "0.1.57" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 609 | 610 | [[package]] 611 | name = "remove_dir_all" 612 | version = "0.5.3" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 615 | dependencies = [ 616 | "winapi 0.3.9", 617 | ] 618 | 619 | [[package]] 620 | name = "reqwest" 621 | version = "0.10.7" 622 | source = "registry+https://github.com/rust-lang/crates.io-index" 623 | checksum = "12427a5577082c24419c9c417db35cfeb65962efc7675bb6b0d5f1f9d315bfe6" 624 | dependencies = [ 625 | "base64", 626 | "bytes", 627 | "encoding_rs", 628 | "futures-core", 629 | "futures-util", 630 | "http", 631 | "http-body", 632 | "hyper", 633 | "hyper-tls", 634 | "ipnet", 635 | "js-sys", 636 | "lazy_static", 637 | "log", 638 | "mime", 639 | "mime_guess", 640 | "native-tls", 641 | "percent-encoding", 642 | "pin-project-lite", 643 | "serde", 644 | "serde_json", 645 | "serde_urlencoded", 646 | "tokio", 647 | "tokio-tls", 648 | "url", 649 | "wasm-bindgen", 650 | "wasm-bindgen-futures", 651 | "web-sys", 652 | "winreg", 653 | ] 654 | 655 | [[package]] 656 | name = "rust-error-handling-examples" 657 | version = "0.1.0" 658 | dependencies = [ 659 | "reqwest", 660 | ] 661 | 662 | [[package]] 663 | name = "ryu" 664 | version = "1.0.5" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 667 | 668 | [[package]] 669 | name = "schannel" 670 | version = "0.1.19" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 673 | dependencies = [ 674 | "lazy_static", 675 | "winapi 0.3.9", 676 | ] 677 | 678 | [[package]] 679 | name = "security-framework" 680 | version = "0.4.4" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 683 | dependencies = [ 684 | "bitflags", 685 | "core-foundation", 686 | "core-foundation-sys", 687 | "libc", 688 | "security-framework-sys", 689 | ] 690 | 691 | [[package]] 692 | name = "security-framework-sys" 693 | version = "0.4.3" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 696 | dependencies = [ 697 | "core-foundation-sys", 698 | "libc", 699 | ] 700 | 701 | [[package]] 702 | name = "serde" 703 | version = "1.0.114" 704 | source = "registry+https://github.com/rust-lang/crates.io-index" 705 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 706 | 707 | [[package]] 708 | name = "serde_json" 709 | version = "1.0.57" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" 712 | dependencies = [ 713 | "itoa", 714 | "ryu", 715 | "serde", 716 | ] 717 | 718 | [[package]] 719 | name = "serde_urlencoded" 720 | version = "0.6.1" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 723 | dependencies = [ 724 | "dtoa", 725 | "itoa", 726 | "serde", 727 | "url", 728 | ] 729 | 730 | [[package]] 731 | name = "slab" 732 | version = "0.4.2" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 735 | 736 | [[package]] 737 | name = "socket2" 738 | version = "0.3.12" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 741 | dependencies = [ 742 | "cfg-if", 743 | "libc", 744 | "redox_syscall", 745 | "winapi 0.3.9", 746 | ] 747 | 748 | [[package]] 749 | name = "syn" 750 | version = "1.0.36" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 753 | dependencies = [ 754 | "proc-macro2", 755 | "quote", 756 | "unicode-xid", 757 | ] 758 | 759 | [[package]] 760 | name = "tempfile" 761 | version = "3.1.0" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 764 | dependencies = [ 765 | "cfg-if", 766 | "libc", 767 | "rand", 768 | "redox_syscall", 769 | "remove_dir_all", 770 | "winapi 0.3.9", 771 | ] 772 | 773 | [[package]] 774 | name = "time" 775 | version = "0.1.43" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 778 | dependencies = [ 779 | "libc", 780 | "winapi 0.3.9", 781 | ] 782 | 783 | [[package]] 784 | name = "tinyvec" 785 | version = "0.3.3" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 788 | 789 | [[package]] 790 | name = "tokio" 791 | version = "0.2.22" 792 | source = "registry+https://github.com/rust-lang/crates.io-index" 793 | checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" 794 | dependencies = [ 795 | "bytes", 796 | "fnv", 797 | "futures-core", 798 | "iovec", 799 | "lazy_static", 800 | "memchr", 801 | "mio", 802 | "num_cpus", 803 | "pin-project-lite", 804 | "slab", 805 | ] 806 | 807 | [[package]] 808 | name = "tokio-tls" 809 | version = "0.3.1" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" 812 | dependencies = [ 813 | "native-tls", 814 | "tokio", 815 | ] 816 | 817 | [[package]] 818 | name = "tokio-util" 819 | version = "0.3.1" 820 | source = "registry+https://github.com/rust-lang/crates.io-index" 821 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 822 | dependencies = [ 823 | "bytes", 824 | "futures-core", 825 | "futures-sink", 826 | "log", 827 | "pin-project-lite", 828 | "tokio", 829 | ] 830 | 831 | [[package]] 832 | name = "tower-service" 833 | version = "0.3.0" 834 | source = "registry+https://github.com/rust-lang/crates.io-index" 835 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 836 | 837 | [[package]] 838 | name = "tracing" 839 | version = "0.1.18" 840 | source = "registry+https://github.com/rust-lang/crates.io-index" 841 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" 842 | dependencies = [ 843 | "cfg-if", 844 | "log", 845 | "tracing-core", 846 | ] 847 | 848 | [[package]] 849 | name = "tracing-core" 850 | version = "0.1.12" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 853 | dependencies = [ 854 | "lazy_static", 855 | ] 856 | 857 | [[package]] 858 | name = "try-lock" 859 | version = "0.2.3" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 862 | 863 | [[package]] 864 | name = "unicase" 865 | version = "2.6.0" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 868 | dependencies = [ 869 | "version_check", 870 | ] 871 | 872 | [[package]] 873 | name = "unicode-bidi" 874 | version = "0.3.4" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 877 | dependencies = [ 878 | "matches", 879 | ] 880 | 881 | [[package]] 882 | name = "unicode-normalization" 883 | version = "0.1.13" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 886 | dependencies = [ 887 | "tinyvec", 888 | ] 889 | 890 | [[package]] 891 | name = "unicode-xid" 892 | version = "0.2.1" 893 | source = "registry+https://github.com/rust-lang/crates.io-index" 894 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 895 | 896 | [[package]] 897 | name = "url" 898 | version = "2.1.1" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 901 | dependencies = [ 902 | "idna", 903 | "matches", 904 | "percent-encoding", 905 | ] 906 | 907 | [[package]] 908 | name = "vcpkg" 909 | version = "0.2.10" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 912 | 913 | [[package]] 914 | name = "version_check" 915 | version = "0.9.2" 916 | source = "registry+https://github.com/rust-lang/crates.io-index" 917 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 918 | 919 | [[package]] 920 | name = "want" 921 | version = "0.3.0" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 924 | dependencies = [ 925 | "log", 926 | "try-lock", 927 | ] 928 | 929 | [[package]] 930 | name = "wasi" 931 | version = "0.9.0+wasi-snapshot-preview1" 932 | source = "registry+https://github.com/rust-lang/crates.io-index" 933 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 934 | 935 | [[package]] 936 | name = "wasm-bindgen" 937 | version = "0.2.67" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 940 | dependencies = [ 941 | "cfg-if", 942 | "serde", 943 | "serde_json", 944 | "wasm-bindgen-macro", 945 | ] 946 | 947 | [[package]] 948 | name = "wasm-bindgen-backend" 949 | version = "0.2.67" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 952 | dependencies = [ 953 | "bumpalo", 954 | "lazy_static", 955 | "log", 956 | "proc-macro2", 957 | "quote", 958 | "syn", 959 | "wasm-bindgen-shared", 960 | ] 961 | 962 | [[package]] 963 | name = "wasm-bindgen-futures" 964 | version = "0.4.17" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699" 967 | dependencies = [ 968 | "cfg-if", 969 | "js-sys", 970 | "wasm-bindgen", 971 | "web-sys", 972 | ] 973 | 974 | [[package]] 975 | name = "wasm-bindgen-macro" 976 | version = "0.2.67" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 979 | dependencies = [ 980 | "quote", 981 | "wasm-bindgen-macro-support", 982 | ] 983 | 984 | [[package]] 985 | name = "wasm-bindgen-macro-support" 986 | version = "0.2.67" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 989 | dependencies = [ 990 | "proc-macro2", 991 | "quote", 992 | "syn", 993 | "wasm-bindgen-backend", 994 | "wasm-bindgen-shared", 995 | ] 996 | 997 | [[package]] 998 | name = "wasm-bindgen-shared" 999 | version = "0.2.67" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 1002 | 1003 | [[package]] 1004 | name = "web-sys" 1005 | version = "0.3.44" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" 1008 | dependencies = [ 1009 | "js-sys", 1010 | "wasm-bindgen", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "winapi" 1015 | version = "0.2.8" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1018 | 1019 | [[package]] 1020 | name = "winapi" 1021 | version = "0.3.9" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1024 | dependencies = [ 1025 | "winapi-i686-pc-windows-gnu", 1026 | "winapi-x86_64-pc-windows-gnu", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "winapi-build" 1031 | version = "0.1.1" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1034 | 1035 | [[package]] 1036 | name = "winapi-i686-pc-windows-gnu" 1037 | version = "0.4.0" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1040 | 1041 | [[package]] 1042 | name = "winapi-x86_64-pc-windows-gnu" 1043 | version = "0.4.0" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1046 | 1047 | [[package]] 1048 | name = "winreg" 1049 | version = "0.7.0" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1052 | dependencies = [ 1053 | "winapi 0.3.9", 1054 | ] 1055 | 1056 | [[package]] 1057 | name = "ws2_32-sys" 1058 | version = "0.2.1" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1061 | dependencies = [ 1062 | "winapi 0.2.8", 1063 | "winapi-build", 1064 | ] 1065 | -------------------------------------------------------------------------------- /04-bubble-up-the-error/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | reqwest = { version = "0.10", features = ["blocking", "json"] } 9 | -------------------------------------------------------------------------------- /04-bubble-up-the-error/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | fn main() { 4 | match get_current_date() { 5 | Ok(date) => println!("We've time travelled to {}!!", date), 6 | Err(e) => eprintln!("Oh noes, we don't know which era we're in! :( \n {}", e), 7 | } 8 | } 9 | 10 | fn get_current_date() -> Result { 11 | // Try changing the url to "https://postman-echo.com/time/objectzzzz" 12 | let url = "https://postman-echo.com/time/object"; 13 | let result = reqwest::blocking::get(url); 14 | 15 | // Update this to use `?` operator 16 | let response = match result { 17 | Ok(res) => res, 18 | Err(err) => return Err(err), 19 | }; 20 | 21 | let body = response.json::>(); 22 | 23 | // Update this to use `?` operator 24 | let json = match body { 25 | Ok(json) => json, 26 | Err(err) => return Err(err), 27 | }; 28 | 29 | let date = json["years"].to_string(); 30 | 31 | Ok(date) 32 | } 33 | -------------------------------------------------------------------------------- /05-bubble-up-multiple-errors/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /05-bubble-up-multiple-errors/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "1.0.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 8 | 9 | [[package]] 10 | name = "base64" 11 | version = "0.12.3" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 14 | 15 | [[package]] 16 | name = "bitflags" 17 | version = "1.2.1" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 20 | 21 | [[package]] 22 | name = "bumpalo" 23 | version = "3.4.0" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 26 | 27 | [[package]] 28 | name = "bytes" 29 | version = "0.5.6" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 32 | 33 | [[package]] 34 | name = "cc" 35 | version = "1.0.58" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" 38 | 39 | [[package]] 40 | name = "cfg-if" 41 | version = "0.1.10" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 44 | 45 | [[package]] 46 | name = "chrono" 47 | version = "0.4.13" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" 50 | dependencies = [ 51 | "num-integer", 52 | "num-traits", 53 | "time", 54 | ] 55 | 56 | [[package]] 57 | name = "core-foundation" 58 | version = "0.7.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 61 | dependencies = [ 62 | "core-foundation-sys", 63 | "libc", 64 | ] 65 | 66 | [[package]] 67 | name = "core-foundation-sys" 68 | version = "0.7.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 71 | 72 | [[package]] 73 | name = "dtoa" 74 | version = "0.4.6" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" 77 | 78 | [[package]] 79 | name = "encoding_rs" 80 | version = "0.8.23" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" 83 | dependencies = [ 84 | "cfg-if", 85 | ] 86 | 87 | [[package]] 88 | name = "fnv" 89 | version = "1.0.7" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 92 | 93 | [[package]] 94 | name = "foreign-types" 95 | version = "0.3.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 98 | dependencies = [ 99 | "foreign-types-shared", 100 | ] 101 | 102 | [[package]] 103 | name = "foreign-types-shared" 104 | version = "0.1.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 107 | 108 | [[package]] 109 | name = "fuchsia-zircon" 110 | version = "0.3.3" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 113 | dependencies = [ 114 | "bitflags", 115 | "fuchsia-zircon-sys", 116 | ] 117 | 118 | [[package]] 119 | name = "fuchsia-zircon-sys" 120 | version = "0.3.3" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 123 | 124 | [[package]] 125 | name = "futures-channel" 126 | version = "0.3.5" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 129 | dependencies = [ 130 | "futures-core", 131 | ] 132 | 133 | [[package]] 134 | name = "futures-core" 135 | version = "0.3.5" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 138 | 139 | [[package]] 140 | name = "futures-io" 141 | version = "0.3.5" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 144 | 145 | [[package]] 146 | name = "futures-sink" 147 | version = "0.3.5" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 150 | 151 | [[package]] 152 | name = "futures-task" 153 | version = "0.3.5" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 156 | dependencies = [ 157 | "once_cell", 158 | ] 159 | 160 | [[package]] 161 | name = "futures-util" 162 | version = "0.3.5" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 165 | dependencies = [ 166 | "futures-core", 167 | "futures-io", 168 | "futures-task", 169 | "memchr", 170 | "pin-project", 171 | "pin-utils", 172 | "slab", 173 | ] 174 | 175 | [[package]] 176 | name = "getrandom" 177 | version = "0.1.14" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 180 | dependencies = [ 181 | "cfg-if", 182 | "libc", 183 | "wasi", 184 | ] 185 | 186 | [[package]] 187 | name = "h2" 188 | version = "0.2.6" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" 191 | dependencies = [ 192 | "bytes", 193 | "fnv", 194 | "futures-core", 195 | "futures-sink", 196 | "futures-util", 197 | "http", 198 | "indexmap", 199 | "slab", 200 | "tokio", 201 | "tokio-util", 202 | "tracing", 203 | ] 204 | 205 | [[package]] 206 | name = "hashbrown" 207 | version = "0.8.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" 210 | dependencies = [ 211 | "autocfg", 212 | ] 213 | 214 | [[package]] 215 | name = "hermit-abi" 216 | version = "0.1.15" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 219 | dependencies = [ 220 | "libc", 221 | ] 222 | 223 | [[package]] 224 | name = "http" 225 | version = "0.2.1" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 228 | dependencies = [ 229 | "bytes", 230 | "fnv", 231 | "itoa", 232 | ] 233 | 234 | [[package]] 235 | name = "http-body" 236 | version = "0.3.1" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 239 | dependencies = [ 240 | "bytes", 241 | "http", 242 | ] 243 | 244 | [[package]] 245 | name = "httparse" 246 | version = "1.3.4" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 249 | 250 | [[package]] 251 | name = "hyper" 252 | version = "0.13.7" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" 255 | dependencies = [ 256 | "bytes", 257 | "futures-channel", 258 | "futures-core", 259 | "futures-util", 260 | "h2", 261 | "http", 262 | "http-body", 263 | "httparse", 264 | "itoa", 265 | "pin-project", 266 | "socket2", 267 | "time", 268 | "tokio", 269 | "tower-service", 270 | "tracing", 271 | "want", 272 | ] 273 | 274 | [[package]] 275 | name = "hyper-tls" 276 | version = "0.4.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" 279 | dependencies = [ 280 | "bytes", 281 | "hyper", 282 | "native-tls", 283 | "tokio", 284 | "tokio-tls", 285 | ] 286 | 287 | [[package]] 288 | name = "idna" 289 | version = "0.2.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 292 | dependencies = [ 293 | "matches", 294 | "unicode-bidi", 295 | "unicode-normalization", 296 | ] 297 | 298 | [[package]] 299 | name = "indexmap" 300 | version = "1.5.0" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" 303 | dependencies = [ 304 | "autocfg", 305 | "hashbrown", 306 | ] 307 | 308 | [[package]] 309 | name = "iovec" 310 | version = "0.1.4" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 313 | dependencies = [ 314 | "libc", 315 | ] 316 | 317 | [[package]] 318 | name = "ipnet" 319 | version = "2.3.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 322 | 323 | [[package]] 324 | name = "itoa" 325 | version = "0.4.6" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 328 | 329 | [[package]] 330 | name = "js-sys" 331 | version = "0.3.44" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" 334 | dependencies = [ 335 | "wasm-bindgen", 336 | ] 337 | 338 | [[package]] 339 | name = "kernel32-sys" 340 | version = "0.2.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 343 | dependencies = [ 344 | "winapi 0.2.8", 345 | "winapi-build", 346 | ] 347 | 348 | [[package]] 349 | name = "lazy_static" 350 | version = "1.4.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 353 | 354 | [[package]] 355 | name = "libc" 356 | version = "0.2.74" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 359 | 360 | [[package]] 361 | name = "log" 362 | version = "0.4.11" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 365 | dependencies = [ 366 | "cfg-if", 367 | ] 368 | 369 | [[package]] 370 | name = "matches" 371 | version = "0.1.8" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 374 | 375 | [[package]] 376 | name = "memchr" 377 | version = "2.3.3" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 380 | 381 | [[package]] 382 | name = "mime" 383 | version = "0.3.16" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 386 | 387 | [[package]] 388 | name = "mime_guess" 389 | version = "2.0.3" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 392 | dependencies = [ 393 | "mime", 394 | "unicase", 395 | ] 396 | 397 | [[package]] 398 | name = "mio" 399 | version = "0.6.22" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 402 | dependencies = [ 403 | "cfg-if", 404 | "fuchsia-zircon", 405 | "fuchsia-zircon-sys", 406 | "iovec", 407 | "kernel32-sys", 408 | "libc", 409 | "log", 410 | "miow", 411 | "net2", 412 | "slab", 413 | "winapi 0.2.8", 414 | ] 415 | 416 | [[package]] 417 | name = "miow" 418 | version = "0.2.1" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 421 | dependencies = [ 422 | "kernel32-sys", 423 | "net2", 424 | "winapi 0.2.8", 425 | "ws2_32-sys", 426 | ] 427 | 428 | [[package]] 429 | name = "native-tls" 430 | version = "0.2.4" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 433 | dependencies = [ 434 | "lazy_static", 435 | "libc", 436 | "log", 437 | "openssl", 438 | "openssl-probe", 439 | "openssl-sys", 440 | "schannel", 441 | "security-framework", 442 | "security-framework-sys", 443 | "tempfile", 444 | ] 445 | 446 | [[package]] 447 | name = "net2" 448 | version = "0.2.34" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 451 | dependencies = [ 452 | "cfg-if", 453 | "libc", 454 | "winapi 0.3.9", 455 | ] 456 | 457 | [[package]] 458 | name = "num-integer" 459 | version = "0.1.43" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 462 | dependencies = [ 463 | "autocfg", 464 | "num-traits", 465 | ] 466 | 467 | [[package]] 468 | name = "num-traits" 469 | version = "0.2.12" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 472 | dependencies = [ 473 | "autocfg", 474 | ] 475 | 476 | [[package]] 477 | name = "num_cpus" 478 | version = "1.13.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 481 | dependencies = [ 482 | "hermit-abi", 483 | "libc", 484 | ] 485 | 486 | [[package]] 487 | name = "once_cell" 488 | version = "1.4.0" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 491 | 492 | [[package]] 493 | name = "openssl" 494 | version = "0.10.30" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 497 | dependencies = [ 498 | "bitflags", 499 | "cfg-if", 500 | "foreign-types", 501 | "lazy_static", 502 | "libc", 503 | "openssl-sys", 504 | ] 505 | 506 | [[package]] 507 | name = "openssl-probe" 508 | version = "0.1.2" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 511 | 512 | [[package]] 513 | name = "openssl-sys" 514 | version = "0.9.58" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 517 | dependencies = [ 518 | "autocfg", 519 | "cc", 520 | "libc", 521 | "pkg-config", 522 | "vcpkg", 523 | ] 524 | 525 | [[package]] 526 | name = "percent-encoding" 527 | version = "2.1.0" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 530 | 531 | [[package]] 532 | name = "pin-project" 533 | version = "0.4.23" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" 536 | dependencies = [ 537 | "pin-project-internal", 538 | ] 539 | 540 | [[package]] 541 | name = "pin-project-internal" 542 | version = "0.4.23" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" 545 | dependencies = [ 546 | "proc-macro2", 547 | "quote", 548 | "syn", 549 | ] 550 | 551 | [[package]] 552 | name = "pin-project-lite" 553 | version = "0.1.7" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 556 | 557 | [[package]] 558 | name = "pin-utils" 559 | version = "0.1.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 562 | 563 | [[package]] 564 | name = "pkg-config" 565 | version = "0.3.18" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" 568 | 569 | [[package]] 570 | name = "ppv-lite86" 571 | version = "0.2.8" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 574 | 575 | [[package]] 576 | name = "proc-macro2" 577 | version = "1.0.19" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 580 | dependencies = [ 581 | "unicode-xid", 582 | ] 583 | 584 | [[package]] 585 | name = "quote" 586 | version = "1.0.7" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 589 | dependencies = [ 590 | "proc-macro2", 591 | ] 592 | 593 | [[package]] 594 | name = "rand" 595 | version = "0.7.3" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 598 | dependencies = [ 599 | "getrandom", 600 | "libc", 601 | "rand_chacha", 602 | "rand_core", 603 | "rand_hc", 604 | ] 605 | 606 | [[package]] 607 | name = "rand_chacha" 608 | version = "0.2.2" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 611 | dependencies = [ 612 | "ppv-lite86", 613 | "rand_core", 614 | ] 615 | 616 | [[package]] 617 | name = "rand_core" 618 | version = "0.5.1" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 621 | dependencies = [ 622 | "getrandom", 623 | ] 624 | 625 | [[package]] 626 | name = "rand_hc" 627 | version = "0.2.0" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 630 | dependencies = [ 631 | "rand_core", 632 | ] 633 | 634 | [[package]] 635 | name = "redox_syscall" 636 | version = "0.1.57" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 639 | 640 | [[package]] 641 | name = "remove_dir_all" 642 | version = "0.5.3" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 645 | dependencies = [ 646 | "winapi 0.3.9", 647 | ] 648 | 649 | [[package]] 650 | name = "reqwest" 651 | version = "0.10.7" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "12427a5577082c24419c9c417db35cfeb65962efc7675bb6b0d5f1f9d315bfe6" 654 | dependencies = [ 655 | "base64", 656 | "bytes", 657 | "encoding_rs", 658 | "futures-core", 659 | "futures-util", 660 | "http", 661 | "http-body", 662 | "hyper", 663 | "hyper-tls", 664 | "ipnet", 665 | "js-sys", 666 | "lazy_static", 667 | "log", 668 | "mime", 669 | "mime_guess", 670 | "native-tls", 671 | "percent-encoding", 672 | "pin-project-lite", 673 | "serde", 674 | "serde_json", 675 | "serde_urlencoded", 676 | "tokio", 677 | "tokio-tls", 678 | "url", 679 | "wasm-bindgen", 680 | "wasm-bindgen-futures", 681 | "web-sys", 682 | "winreg", 683 | ] 684 | 685 | [[package]] 686 | name = "rust-error-handling-examples" 687 | version = "0.1.0" 688 | dependencies = [ 689 | "chrono", 690 | "reqwest", 691 | ] 692 | 693 | [[package]] 694 | name = "ryu" 695 | version = "1.0.5" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 698 | 699 | [[package]] 700 | name = "schannel" 701 | version = "0.1.19" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 704 | dependencies = [ 705 | "lazy_static", 706 | "winapi 0.3.9", 707 | ] 708 | 709 | [[package]] 710 | name = "security-framework" 711 | version = "0.4.4" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 714 | dependencies = [ 715 | "bitflags", 716 | "core-foundation", 717 | "core-foundation-sys", 718 | "libc", 719 | "security-framework-sys", 720 | ] 721 | 722 | [[package]] 723 | name = "security-framework-sys" 724 | version = "0.4.3" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 727 | dependencies = [ 728 | "core-foundation-sys", 729 | "libc", 730 | ] 731 | 732 | [[package]] 733 | name = "serde" 734 | version = "1.0.114" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 737 | 738 | [[package]] 739 | name = "serde_json" 740 | version = "1.0.57" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" 743 | dependencies = [ 744 | "itoa", 745 | "ryu", 746 | "serde", 747 | ] 748 | 749 | [[package]] 750 | name = "serde_urlencoded" 751 | version = "0.6.1" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 754 | dependencies = [ 755 | "dtoa", 756 | "itoa", 757 | "serde", 758 | "url", 759 | ] 760 | 761 | [[package]] 762 | name = "slab" 763 | version = "0.4.2" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 766 | 767 | [[package]] 768 | name = "socket2" 769 | version = "0.3.12" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 772 | dependencies = [ 773 | "cfg-if", 774 | "libc", 775 | "redox_syscall", 776 | "winapi 0.3.9", 777 | ] 778 | 779 | [[package]] 780 | name = "syn" 781 | version = "1.0.36" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 784 | dependencies = [ 785 | "proc-macro2", 786 | "quote", 787 | "unicode-xid", 788 | ] 789 | 790 | [[package]] 791 | name = "tempfile" 792 | version = "3.1.0" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 795 | dependencies = [ 796 | "cfg-if", 797 | "libc", 798 | "rand", 799 | "redox_syscall", 800 | "remove_dir_all", 801 | "winapi 0.3.9", 802 | ] 803 | 804 | [[package]] 805 | name = "time" 806 | version = "0.1.43" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 809 | dependencies = [ 810 | "libc", 811 | "winapi 0.3.9", 812 | ] 813 | 814 | [[package]] 815 | name = "tinyvec" 816 | version = "0.3.3" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 819 | 820 | [[package]] 821 | name = "tokio" 822 | version = "0.2.22" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" 825 | dependencies = [ 826 | "bytes", 827 | "fnv", 828 | "futures-core", 829 | "iovec", 830 | "lazy_static", 831 | "memchr", 832 | "mio", 833 | "num_cpus", 834 | "pin-project-lite", 835 | "slab", 836 | ] 837 | 838 | [[package]] 839 | name = "tokio-tls" 840 | version = "0.3.1" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" 843 | dependencies = [ 844 | "native-tls", 845 | "tokio", 846 | ] 847 | 848 | [[package]] 849 | name = "tokio-util" 850 | version = "0.3.1" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 853 | dependencies = [ 854 | "bytes", 855 | "futures-core", 856 | "futures-sink", 857 | "log", 858 | "pin-project-lite", 859 | "tokio", 860 | ] 861 | 862 | [[package]] 863 | name = "tower-service" 864 | version = "0.3.0" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 867 | 868 | [[package]] 869 | name = "tracing" 870 | version = "0.1.18" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" 873 | dependencies = [ 874 | "cfg-if", 875 | "log", 876 | "tracing-core", 877 | ] 878 | 879 | [[package]] 880 | name = "tracing-core" 881 | version = "0.1.12" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 884 | dependencies = [ 885 | "lazy_static", 886 | ] 887 | 888 | [[package]] 889 | name = "try-lock" 890 | version = "0.2.3" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 893 | 894 | [[package]] 895 | name = "unicase" 896 | version = "2.6.0" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 899 | dependencies = [ 900 | "version_check", 901 | ] 902 | 903 | [[package]] 904 | name = "unicode-bidi" 905 | version = "0.3.4" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 908 | dependencies = [ 909 | "matches", 910 | ] 911 | 912 | [[package]] 913 | name = "unicode-normalization" 914 | version = "0.1.13" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 917 | dependencies = [ 918 | "tinyvec", 919 | ] 920 | 921 | [[package]] 922 | name = "unicode-xid" 923 | version = "0.2.1" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 926 | 927 | [[package]] 928 | name = "url" 929 | version = "2.1.1" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 932 | dependencies = [ 933 | "idna", 934 | "matches", 935 | "percent-encoding", 936 | ] 937 | 938 | [[package]] 939 | name = "vcpkg" 940 | version = "0.2.10" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 943 | 944 | [[package]] 945 | name = "version_check" 946 | version = "0.9.2" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 949 | 950 | [[package]] 951 | name = "want" 952 | version = "0.3.0" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 955 | dependencies = [ 956 | "log", 957 | "try-lock", 958 | ] 959 | 960 | [[package]] 961 | name = "wasi" 962 | version = "0.9.0+wasi-snapshot-preview1" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 965 | 966 | [[package]] 967 | name = "wasm-bindgen" 968 | version = "0.2.67" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 971 | dependencies = [ 972 | "cfg-if", 973 | "serde", 974 | "serde_json", 975 | "wasm-bindgen-macro", 976 | ] 977 | 978 | [[package]] 979 | name = "wasm-bindgen-backend" 980 | version = "0.2.67" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 983 | dependencies = [ 984 | "bumpalo", 985 | "lazy_static", 986 | "log", 987 | "proc-macro2", 988 | "quote", 989 | "syn", 990 | "wasm-bindgen-shared", 991 | ] 992 | 993 | [[package]] 994 | name = "wasm-bindgen-futures" 995 | version = "0.4.17" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699" 998 | dependencies = [ 999 | "cfg-if", 1000 | "js-sys", 1001 | "wasm-bindgen", 1002 | "web-sys", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "wasm-bindgen-macro" 1007 | version = "0.2.67" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 1010 | dependencies = [ 1011 | "quote", 1012 | "wasm-bindgen-macro-support", 1013 | ] 1014 | 1015 | [[package]] 1016 | name = "wasm-bindgen-macro-support" 1017 | version = "0.2.67" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 1020 | dependencies = [ 1021 | "proc-macro2", 1022 | "quote", 1023 | "syn", 1024 | "wasm-bindgen-backend", 1025 | "wasm-bindgen-shared", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "wasm-bindgen-shared" 1030 | version = "0.2.67" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 1033 | 1034 | [[package]] 1035 | name = "web-sys" 1036 | version = "0.3.44" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" 1039 | dependencies = [ 1040 | "js-sys", 1041 | "wasm-bindgen", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "winapi" 1046 | version = "0.2.8" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1049 | 1050 | [[package]] 1051 | name = "winapi" 1052 | version = "0.3.9" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1055 | dependencies = [ 1056 | "winapi-i686-pc-windows-gnu", 1057 | "winapi-x86_64-pc-windows-gnu", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "winapi-build" 1062 | version = "0.1.1" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1065 | 1066 | [[package]] 1067 | name = "winapi-i686-pc-windows-gnu" 1068 | version = "0.4.0" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1071 | 1072 | [[package]] 1073 | name = "winapi-x86_64-pc-windows-gnu" 1074 | version = "0.4.0" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1077 | 1078 | [[package]] 1079 | name = "winreg" 1080 | version = "0.7.0" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1083 | dependencies = [ 1084 | "winapi 0.3.9", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "ws2_32-sys" 1089 | version = "0.2.1" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1092 | dependencies = [ 1093 | "winapi 0.2.8", 1094 | "winapi-build", 1095 | ] 1096 | -------------------------------------------------------------------------------- /05-bubble-up-multiple-errors/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | reqwest = { version = "0.10", features = ["blocking", "json"] } 9 | chrono = "0.4" -------------------------------------------------------------------------------- /05-bubble-up-multiple-errors/src/main.rs: -------------------------------------------------------------------------------- 1 | use chrono::NaiveDate; 2 | use std::collections::HashMap; 3 | 4 | fn main() { 5 | match get_current_date() { 6 | Ok(date) => println!("We've time travelled to {}!!", date), 7 | Err(e) => eprintln!("Oh noes, we don't know which era we're in! :( \n {}", e), 8 | } 9 | } 10 | 11 | fn get_current_date() -> Result> { 12 | // Try changing the url to "https://postman-echo.com/time/objectzzzz" 13 | let url = "https://postman-echo.com/time/object"; 14 | let res = reqwest::blocking::get(url)?.json::>()?; 15 | 16 | // Try changing the format to "{}-{}-{}z" 17 | let formatted_date = format!("{}-{}-{}", res["years"], res["months"] + 1, res["date"]); 18 | let parsed_date = NaiveDate::parse_from_str(formatted_date.as_str(), "%Y-%m-%d")?; 19 | let date = parsed_date.format("%Y %B %d").to_string(); 20 | 21 | Ok(date) 22 | } 23 | -------------------------------------------------------------------------------- /06-match-boxed-errors/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /06-match-boxed-errors/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "1.0.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 8 | 9 | [[package]] 10 | name = "base64" 11 | version = "0.12.3" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 14 | 15 | [[package]] 16 | name = "bitflags" 17 | version = "1.2.1" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 20 | 21 | [[package]] 22 | name = "bumpalo" 23 | version = "3.4.0" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 26 | 27 | [[package]] 28 | name = "bytes" 29 | version = "0.5.6" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 32 | 33 | [[package]] 34 | name = "cc" 35 | version = "1.0.58" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" 38 | 39 | [[package]] 40 | name = "cfg-if" 41 | version = "0.1.10" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 44 | 45 | [[package]] 46 | name = "chrono" 47 | version = "0.4.13" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" 50 | dependencies = [ 51 | "num-integer", 52 | "num-traits", 53 | "time", 54 | ] 55 | 56 | [[package]] 57 | name = "core-foundation" 58 | version = "0.7.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 61 | dependencies = [ 62 | "core-foundation-sys", 63 | "libc", 64 | ] 65 | 66 | [[package]] 67 | name = "core-foundation-sys" 68 | version = "0.7.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 71 | 72 | [[package]] 73 | name = "dtoa" 74 | version = "0.4.6" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" 77 | 78 | [[package]] 79 | name = "encoding_rs" 80 | version = "0.8.23" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" 83 | dependencies = [ 84 | "cfg-if", 85 | ] 86 | 87 | [[package]] 88 | name = "fnv" 89 | version = "1.0.7" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 92 | 93 | [[package]] 94 | name = "foreign-types" 95 | version = "0.3.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 98 | dependencies = [ 99 | "foreign-types-shared", 100 | ] 101 | 102 | [[package]] 103 | name = "foreign-types-shared" 104 | version = "0.1.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 107 | 108 | [[package]] 109 | name = "fuchsia-zircon" 110 | version = "0.3.3" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 113 | dependencies = [ 114 | "bitflags", 115 | "fuchsia-zircon-sys", 116 | ] 117 | 118 | [[package]] 119 | name = "fuchsia-zircon-sys" 120 | version = "0.3.3" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 123 | 124 | [[package]] 125 | name = "futures-channel" 126 | version = "0.3.5" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 129 | dependencies = [ 130 | "futures-core", 131 | ] 132 | 133 | [[package]] 134 | name = "futures-core" 135 | version = "0.3.5" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 138 | 139 | [[package]] 140 | name = "futures-io" 141 | version = "0.3.5" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 144 | 145 | [[package]] 146 | name = "futures-sink" 147 | version = "0.3.5" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 150 | 151 | [[package]] 152 | name = "futures-task" 153 | version = "0.3.5" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 156 | dependencies = [ 157 | "once_cell", 158 | ] 159 | 160 | [[package]] 161 | name = "futures-util" 162 | version = "0.3.5" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 165 | dependencies = [ 166 | "futures-core", 167 | "futures-io", 168 | "futures-task", 169 | "memchr", 170 | "pin-project", 171 | "pin-utils", 172 | "slab", 173 | ] 174 | 175 | [[package]] 176 | name = "getrandom" 177 | version = "0.1.14" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 180 | dependencies = [ 181 | "cfg-if", 182 | "libc", 183 | "wasi", 184 | ] 185 | 186 | [[package]] 187 | name = "h2" 188 | version = "0.2.6" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" 191 | dependencies = [ 192 | "bytes", 193 | "fnv", 194 | "futures-core", 195 | "futures-sink", 196 | "futures-util", 197 | "http", 198 | "indexmap", 199 | "slab", 200 | "tokio", 201 | "tokio-util", 202 | "tracing", 203 | ] 204 | 205 | [[package]] 206 | name = "hashbrown" 207 | version = "0.8.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" 210 | dependencies = [ 211 | "autocfg", 212 | ] 213 | 214 | [[package]] 215 | name = "hermit-abi" 216 | version = "0.1.15" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 219 | dependencies = [ 220 | "libc", 221 | ] 222 | 223 | [[package]] 224 | name = "http" 225 | version = "0.2.1" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 228 | dependencies = [ 229 | "bytes", 230 | "fnv", 231 | "itoa", 232 | ] 233 | 234 | [[package]] 235 | name = "http-body" 236 | version = "0.3.1" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 239 | dependencies = [ 240 | "bytes", 241 | "http", 242 | ] 243 | 244 | [[package]] 245 | name = "httparse" 246 | version = "1.3.4" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 249 | 250 | [[package]] 251 | name = "hyper" 252 | version = "0.13.7" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" 255 | dependencies = [ 256 | "bytes", 257 | "futures-channel", 258 | "futures-core", 259 | "futures-util", 260 | "h2", 261 | "http", 262 | "http-body", 263 | "httparse", 264 | "itoa", 265 | "pin-project", 266 | "socket2", 267 | "time", 268 | "tokio", 269 | "tower-service", 270 | "tracing", 271 | "want", 272 | ] 273 | 274 | [[package]] 275 | name = "hyper-tls" 276 | version = "0.4.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" 279 | dependencies = [ 280 | "bytes", 281 | "hyper", 282 | "native-tls", 283 | "tokio", 284 | "tokio-tls", 285 | ] 286 | 287 | [[package]] 288 | name = "idna" 289 | version = "0.2.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 292 | dependencies = [ 293 | "matches", 294 | "unicode-bidi", 295 | "unicode-normalization", 296 | ] 297 | 298 | [[package]] 299 | name = "indexmap" 300 | version = "1.5.0" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" 303 | dependencies = [ 304 | "autocfg", 305 | "hashbrown", 306 | ] 307 | 308 | [[package]] 309 | name = "iovec" 310 | version = "0.1.4" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 313 | dependencies = [ 314 | "libc", 315 | ] 316 | 317 | [[package]] 318 | name = "ipnet" 319 | version = "2.3.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 322 | 323 | [[package]] 324 | name = "itoa" 325 | version = "0.4.6" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 328 | 329 | [[package]] 330 | name = "js-sys" 331 | version = "0.3.44" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" 334 | dependencies = [ 335 | "wasm-bindgen", 336 | ] 337 | 338 | [[package]] 339 | name = "kernel32-sys" 340 | version = "0.2.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 343 | dependencies = [ 344 | "winapi 0.2.8", 345 | "winapi-build", 346 | ] 347 | 348 | [[package]] 349 | name = "lazy_static" 350 | version = "1.4.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 353 | 354 | [[package]] 355 | name = "libc" 356 | version = "0.2.74" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 359 | 360 | [[package]] 361 | name = "log" 362 | version = "0.4.11" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 365 | dependencies = [ 366 | "cfg-if", 367 | ] 368 | 369 | [[package]] 370 | name = "matches" 371 | version = "0.1.8" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 374 | 375 | [[package]] 376 | name = "memchr" 377 | version = "2.3.3" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 380 | 381 | [[package]] 382 | name = "mime" 383 | version = "0.3.16" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 386 | 387 | [[package]] 388 | name = "mime_guess" 389 | version = "2.0.3" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 392 | dependencies = [ 393 | "mime", 394 | "unicase", 395 | ] 396 | 397 | [[package]] 398 | name = "mio" 399 | version = "0.6.22" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 402 | dependencies = [ 403 | "cfg-if", 404 | "fuchsia-zircon", 405 | "fuchsia-zircon-sys", 406 | "iovec", 407 | "kernel32-sys", 408 | "libc", 409 | "log", 410 | "miow", 411 | "net2", 412 | "slab", 413 | "winapi 0.2.8", 414 | ] 415 | 416 | [[package]] 417 | name = "miow" 418 | version = "0.2.1" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 421 | dependencies = [ 422 | "kernel32-sys", 423 | "net2", 424 | "winapi 0.2.8", 425 | "ws2_32-sys", 426 | ] 427 | 428 | [[package]] 429 | name = "native-tls" 430 | version = "0.2.4" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 433 | dependencies = [ 434 | "lazy_static", 435 | "libc", 436 | "log", 437 | "openssl", 438 | "openssl-probe", 439 | "openssl-sys", 440 | "schannel", 441 | "security-framework", 442 | "security-framework-sys", 443 | "tempfile", 444 | ] 445 | 446 | [[package]] 447 | name = "net2" 448 | version = "0.2.34" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 451 | dependencies = [ 452 | "cfg-if", 453 | "libc", 454 | "winapi 0.3.9", 455 | ] 456 | 457 | [[package]] 458 | name = "num-integer" 459 | version = "0.1.43" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 462 | dependencies = [ 463 | "autocfg", 464 | "num-traits", 465 | ] 466 | 467 | [[package]] 468 | name = "num-traits" 469 | version = "0.2.12" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 472 | dependencies = [ 473 | "autocfg", 474 | ] 475 | 476 | [[package]] 477 | name = "num_cpus" 478 | version = "1.13.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 481 | dependencies = [ 482 | "hermit-abi", 483 | "libc", 484 | ] 485 | 486 | [[package]] 487 | name = "once_cell" 488 | version = "1.4.0" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 491 | 492 | [[package]] 493 | name = "openssl" 494 | version = "0.10.30" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 497 | dependencies = [ 498 | "bitflags", 499 | "cfg-if", 500 | "foreign-types", 501 | "lazy_static", 502 | "libc", 503 | "openssl-sys", 504 | ] 505 | 506 | [[package]] 507 | name = "openssl-probe" 508 | version = "0.1.2" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 511 | 512 | [[package]] 513 | name = "openssl-sys" 514 | version = "0.9.58" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 517 | dependencies = [ 518 | "autocfg", 519 | "cc", 520 | "libc", 521 | "pkg-config", 522 | "vcpkg", 523 | ] 524 | 525 | [[package]] 526 | name = "percent-encoding" 527 | version = "2.1.0" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 530 | 531 | [[package]] 532 | name = "pin-project" 533 | version = "0.4.23" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" 536 | dependencies = [ 537 | "pin-project-internal", 538 | ] 539 | 540 | [[package]] 541 | name = "pin-project-internal" 542 | version = "0.4.23" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" 545 | dependencies = [ 546 | "proc-macro2", 547 | "quote", 548 | "syn", 549 | ] 550 | 551 | [[package]] 552 | name = "pin-project-lite" 553 | version = "0.1.7" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 556 | 557 | [[package]] 558 | name = "pin-utils" 559 | version = "0.1.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 562 | 563 | [[package]] 564 | name = "pkg-config" 565 | version = "0.3.18" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" 568 | 569 | [[package]] 570 | name = "ppv-lite86" 571 | version = "0.2.8" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 574 | 575 | [[package]] 576 | name = "proc-macro2" 577 | version = "1.0.19" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 580 | dependencies = [ 581 | "unicode-xid", 582 | ] 583 | 584 | [[package]] 585 | name = "quote" 586 | version = "1.0.7" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 589 | dependencies = [ 590 | "proc-macro2", 591 | ] 592 | 593 | [[package]] 594 | name = "rand" 595 | version = "0.7.3" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 598 | dependencies = [ 599 | "getrandom", 600 | "libc", 601 | "rand_chacha", 602 | "rand_core", 603 | "rand_hc", 604 | ] 605 | 606 | [[package]] 607 | name = "rand_chacha" 608 | version = "0.2.2" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 611 | dependencies = [ 612 | "ppv-lite86", 613 | "rand_core", 614 | ] 615 | 616 | [[package]] 617 | name = "rand_core" 618 | version = "0.5.1" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 621 | dependencies = [ 622 | "getrandom", 623 | ] 624 | 625 | [[package]] 626 | name = "rand_hc" 627 | version = "0.2.0" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 630 | dependencies = [ 631 | "rand_core", 632 | ] 633 | 634 | [[package]] 635 | name = "redox_syscall" 636 | version = "0.1.57" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 639 | 640 | [[package]] 641 | name = "remove_dir_all" 642 | version = "0.5.3" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 645 | dependencies = [ 646 | "winapi 0.3.9", 647 | ] 648 | 649 | [[package]] 650 | name = "reqwest" 651 | version = "0.10.7" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "12427a5577082c24419c9c417db35cfeb65962efc7675bb6b0d5f1f9d315bfe6" 654 | dependencies = [ 655 | "base64", 656 | "bytes", 657 | "encoding_rs", 658 | "futures-core", 659 | "futures-util", 660 | "http", 661 | "http-body", 662 | "hyper", 663 | "hyper-tls", 664 | "ipnet", 665 | "js-sys", 666 | "lazy_static", 667 | "log", 668 | "mime", 669 | "mime_guess", 670 | "native-tls", 671 | "percent-encoding", 672 | "pin-project-lite", 673 | "serde", 674 | "serde_json", 675 | "serde_urlencoded", 676 | "tokio", 677 | "tokio-tls", 678 | "url", 679 | "wasm-bindgen", 680 | "wasm-bindgen-futures", 681 | "web-sys", 682 | "winreg", 683 | ] 684 | 685 | [[package]] 686 | name = "rust-error-handling-examples" 687 | version = "0.1.0" 688 | dependencies = [ 689 | "chrono", 690 | "reqwest", 691 | ] 692 | 693 | [[package]] 694 | name = "ryu" 695 | version = "1.0.5" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 698 | 699 | [[package]] 700 | name = "schannel" 701 | version = "0.1.19" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 704 | dependencies = [ 705 | "lazy_static", 706 | "winapi 0.3.9", 707 | ] 708 | 709 | [[package]] 710 | name = "security-framework" 711 | version = "0.4.4" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 714 | dependencies = [ 715 | "bitflags", 716 | "core-foundation", 717 | "core-foundation-sys", 718 | "libc", 719 | "security-framework-sys", 720 | ] 721 | 722 | [[package]] 723 | name = "security-framework-sys" 724 | version = "0.4.3" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 727 | dependencies = [ 728 | "core-foundation-sys", 729 | "libc", 730 | ] 731 | 732 | [[package]] 733 | name = "serde" 734 | version = "1.0.114" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 737 | 738 | [[package]] 739 | name = "serde_json" 740 | version = "1.0.57" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" 743 | dependencies = [ 744 | "itoa", 745 | "ryu", 746 | "serde", 747 | ] 748 | 749 | [[package]] 750 | name = "serde_urlencoded" 751 | version = "0.6.1" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 754 | dependencies = [ 755 | "dtoa", 756 | "itoa", 757 | "serde", 758 | "url", 759 | ] 760 | 761 | [[package]] 762 | name = "slab" 763 | version = "0.4.2" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 766 | 767 | [[package]] 768 | name = "socket2" 769 | version = "0.3.12" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 772 | dependencies = [ 773 | "cfg-if", 774 | "libc", 775 | "redox_syscall", 776 | "winapi 0.3.9", 777 | ] 778 | 779 | [[package]] 780 | name = "syn" 781 | version = "1.0.36" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 784 | dependencies = [ 785 | "proc-macro2", 786 | "quote", 787 | "unicode-xid", 788 | ] 789 | 790 | [[package]] 791 | name = "tempfile" 792 | version = "3.1.0" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 795 | dependencies = [ 796 | "cfg-if", 797 | "libc", 798 | "rand", 799 | "redox_syscall", 800 | "remove_dir_all", 801 | "winapi 0.3.9", 802 | ] 803 | 804 | [[package]] 805 | name = "time" 806 | version = "0.1.43" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 809 | dependencies = [ 810 | "libc", 811 | "winapi 0.3.9", 812 | ] 813 | 814 | [[package]] 815 | name = "tinyvec" 816 | version = "0.3.3" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 819 | 820 | [[package]] 821 | name = "tokio" 822 | version = "0.2.22" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" 825 | dependencies = [ 826 | "bytes", 827 | "fnv", 828 | "futures-core", 829 | "iovec", 830 | "lazy_static", 831 | "memchr", 832 | "mio", 833 | "num_cpus", 834 | "pin-project-lite", 835 | "slab", 836 | ] 837 | 838 | [[package]] 839 | name = "tokio-tls" 840 | version = "0.3.1" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" 843 | dependencies = [ 844 | "native-tls", 845 | "tokio", 846 | ] 847 | 848 | [[package]] 849 | name = "tokio-util" 850 | version = "0.3.1" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 853 | dependencies = [ 854 | "bytes", 855 | "futures-core", 856 | "futures-sink", 857 | "log", 858 | "pin-project-lite", 859 | "tokio", 860 | ] 861 | 862 | [[package]] 863 | name = "tower-service" 864 | version = "0.3.0" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 867 | 868 | [[package]] 869 | name = "tracing" 870 | version = "0.1.18" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" 873 | dependencies = [ 874 | "cfg-if", 875 | "log", 876 | "tracing-core", 877 | ] 878 | 879 | [[package]] 880 | name = "tracing-core" 881 | version = "0.1.12" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 884 | dependencies = [ 885 | "lazy_static", 886 | ] 887 | 888 | [[package]] 889 | name = "try-lock" 890 | version = "0.2.3" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 893 | 894 | [[package]] 895 | name = "unicase" 896 | version = "2.6.0" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 899 | dependencies = [ 900 | "version_check", 901 | ] 902 | 903 | [[package]] 904 | name = "unicode-bidi" 905 | version = "0.3.4" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 908 | dependencies = [ 909 | "matches", 910 | ] 911 | 912 | [[package]] 913 | name = "unicode-normalization" 914 | version = "0.1.13" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 917 | dependencies = [ 918 | "tinyvec", 919 | ] 920 | 921 | [[package]] 922 | name = "unicode-xid" 923 | version = "0.2.1" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 926 | 927 | [[package]] 928 | name = "url" 929 | version = "2.1.1" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 932 | dependencies = [ 933 | "idna", 934 | "matches", 935 | "percent-encoding", 936 | ] 937 | 938 | [[package]] 939 | name = "vcpkg" 940 | version = "0.2.10" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 943 | 944 | [[package]] 945 | name = "version_check" 946 | version = "0.9.2" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 949 | 950 | [[package]] 951 | name = "want" 952 | version = "0.3.0" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 955 | dependencies = [ 956 | "log", 957 | "try-lock", 958 | ] 959 | 960 | [[package]] 961 | name = "wasi" 962 | version = "0.9.0+wasi-snapshot-preview1" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 965 | 966 | [[package]] 967 | name = "wasm-bindgen" 968 | version = "0.2.67" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 971 | dependencies = [ 972 | "cfg-if", 973 | "serde", 974 | "serde_json", 975 | "wasm-bindgen-macro", 976 | ] 977 | 978 | [[package]] 979 | name = "wasm-bindgen-backend" 980 | version = "0.2.67" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 983 | dependencies = [ 984 | "bumpalo", 985 | "lazy_static", 986 | "log", 987 | "proc-macro2", 988 | "quote", 989 | "syn", 990 | "wasm-bindgen-shared", 991 | ] 992 | 993 | [[package]] 994 | name = "wasm-bindgen-futures" 995 | version = "0.4.17" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699" 998 | dependencies = [ 999 | "cfg-if", 1000 | "js-sys", 1001 | "wasm-bindgen", 1002 | "web-sys", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "wasm-bindgen-macro" 1007 | version = "0.2.67" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 1010 | dependencies = [ 1011 | "quote", 1012 | "wasm-bindgen-macro-support", 1013 | ] 1014 | 1015 | [[package]] 1016 | name = "wasm-bindgen-macro-support" 1017 | version = "0.2.67" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 1020 | dependencies = [ 1021 | "proc-macro2", 1022 | "quote", 1023 | "syn", 1024 | "wasm-bindgen-backend", 1025 | "wasm-bindgen-shared", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "wasm-bindgen-shared" 1030 | version = "0.2.67" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 1033 | 1034 | [[package]] 1035 | name = "web-sys" 1036 | version = "0.3.44" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" 1039 | dependencies = [ 1040 | "js-sys", 1041 | "wasm-bindgen", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "winapi" 1046 | version = "0.2.8" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1049 | 1050 | [[package]] 1051 | name = "winapi" 1052 | version = "0.3.9" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1055 | dependencies = [ 1056 | "winapi-i686-pc-windows-gnu", 1057 | "winapi-x86_64-pc-windows-gnu", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "winapi-build" 1062 | version = "0.1.1" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1065 | 1066 | [[package]] 1067 | name = "winapi-i686-pc-windows-gnu" 1068 | version = "0.4.0" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1071 | 1072 | [[package]] 1073 | name = "winapi-x86_64-pc-windows-gnu" 1074 | version = "0.4.0" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1077 | 1078 | [[package]] 1079 | name = "winreg" 1080 | version = "0.7.0" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1083 | dependencies = [ 1084 | "winapi 0.3.9", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "ws2_32-sys" 1089 | version = "0.2.1" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1092 | dependencies = [ 1093 | "winapi 0.2.8", 1094 | "winapi-build", 1095 | ] 1096 | -------------------------------------------------------------------------------- /06-match-boxed-errors/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | reqwest = { version = "0.10", features = ["blocking", "json"] } 9 | chrono = "0.4" -------------------------------------------------------------------------------- /06-match-boxed-errors/src/main.rs: -------------------------------------------------------------------------------- 1 | use chrono::NaiveDate; 2 | use std::collections::HashMap; 3 | 4 | fn main() { 5 | match get_current_date() { 6 | Ok(date) => println!("We've time travelled to {}!!", date), 7 | Err(e) => { 8 | eprintln!("Oh noes, we don't know which era we're in! :("); 9 | if let Some(err) = e.downcast_ref::() { 10 | eprintln!("Request Error: {}", err) 11 | } else if let Some(err) = e.downcast_ref::() { 12 | eprintln!("Parse Error: {}", err) 13 | } 14 | } 15 | } 16 | } 17 | 18 | fn get_current_date() -> Result> { 19 | // Try changing the url to "https://postman-echo.com/time/objectzzzz" 20 | let url = "https://postman-echo.com/time/object"; 21 | let res = reqwest::blocking::get(url)?.json::>()?; 22 | 23 | // Try changing the format to "{}-{}-{}z" 24 | let formatted_date = format!("{}-{}-{}", res["years"], res["months"] + 1, res["date"]); 25 | let parsed_date = NaiveDate::parse_from_str(formatted_date.as_str(), "%Y-%m-%d")?; 26 | let date = parsed_date.format("%Y %B %d").to_string(); 27 | 28 | Ok(date) 29 | } 30 | -------------------------------------------------------------------------------- /07-create-custom-errors/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /07-create-custom-errors/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "1.0.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 8 | 9 | [[package]] 10 | name = "base64" 11 | version = "0.12.3" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 14 | 15 | [[package]] 16 | name = "bitflags" 17 | version = "1.2.1" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 20 | 21 | [[package]] 22 | name = "bumpalo" 23 | version = "3.4.0" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 26 | 27 | [[package]] 28 | name = "bytes" 29 | version = "0.5.6" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 32 | 33 | [[package]] 34 | name = "cc" 35 | version = "1.0.58" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" 38 | 39 | [[package]] 40 | name = "cfg-if" 41 | version = "0.1.10" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 44 | 45 | [[package]] 46 | name = "chrono" 47 | version = "0.4.13" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" 50 | dependencies = [ 51 | "num-integer", 52 | "num-traits", 53 | "time", 54 | ] 55 | 56 | [[package]] 57 | name = "core-foundation" 58 | version = "0.7.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 61 | dependencies = [ 62 | "core-foundation-sys", 63 | "libc", 64 | ] 65 | 66 | [[package]] 67 | name = "core-foundation-sys" 68 | version = "0.7.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 71 | 72 | [[package]] 73 | name = "dtoa" 74 | version = "0.4.6" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" 77 | 78 | [[package]] 79 | name = "encoding_rs" 80 | version = "0.8.23" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" 83 | dependencies = [ 84 | "cfg-if", 85 | ] 86 | 87 | [[package]] 88 | name = "fnv" 89 | version = "1.0.7" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 92 | 93 | [[package]] 94 | name = "foreign-types" 95 | version = "0.3.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 98 | dependencies = [ 99 | "foreign-types-shared", 100 | ] 101 | 102 | [[package]] 103 | name = "foreign-types-shared" 104 | version = "0.1.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 107 | 108 | [[package]] 109 | name = "fuchsia-zircon" 110 | version = "0.3.3" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 113 | dependencies = [ 114 | "bitflags", 115 | "fuchsia-zircon-sys", 116 | ] 117 | 118 | [[package]] 119 | name = "fuchsia-zircon-sys" 120 | version = "0.3.3" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 123 | 124 | [[package]] 125 | name = "futures-channel" 126 | version = "0.3.5" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 129 | dependencies = [ 130 | "futures-core", 131 | ] 132 | 133 | [[package]] 134 | name = "futures-core" 135 | version = "0.3.5" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 138 | 139 | [[package]] 140 | name = "futures-io" 141 | version = "0.3.5" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 144 | 145 | [[package]] 146 | name = "futures-sink" 147 | version = "0.3.5" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 150 | 151 | [[package]] 152 | name = "futures-task" 153 | version = "0.3.5" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 156 | dependencies = [ 157 | "once_cell", 158 | ] 159 | 160 | [[package]] 161 | name = "futures-util" 162 | version = "0.3.5" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 165 | dependencies = [ 166 | "futures-core", 167 | "futures-io", 168 | "futures-task", 169 | "memchr", 170 | "pin-project", 171 | "pin-utils", 172 | "slab", 173 | ] 174 | 175 | [[package]] 176 | name = "getrandom" 177 | version = "0.1.14" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 180 | dependencies = [ 181 | "cfg-if", 182 | "libc", 183 | "wasi", 184 | ] 185 | 186 | [[package]] 187 | name = "h2" 188 | version = "0.2.6" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" 191 | dependencies = [ 192 | "bytes", 193 | "fnv", 194 | "futures-core", 195 | "futures-sink", 196 | "futures-util", 197 | "http", 198 | "indexmap", 199 | "slab", 200 | "tokio", 201 | "tokio-util", 202 | "tracing", 203 | ] 204 | 205 | [[package]] 206 | name = "hashbrown" 207 | version = "0.8.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" 210 | dependencies = [ 211 | "autocfg", 212 | ] 213 | 214 | [[package]] 215 | name = "hermit-abi" 216 | version = "0.1.15" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 219 | dependencies = [ 220 | "libc", 221 | ] 222 | 223 | [[package]] 224 | name = "http" 225 | version = "0.2.1" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 228 | dependencies = [ 229 | "bytes", 230 | "fnv", 231 | "itoa", 232 | ] 233 | 234 | [[package]] 235 | name = "http-body" 236 | version = "0.3.1" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 239 | dependencies = [ 240 | "bytes", 241 | "http", 242 | ] 243 | 244 | [[package]] 245 | name = "httparse" 246 | version = "1.3.4" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 249 | 250 | [[package]] 251 | name = "hyper" 252 | version = "0.13.7" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" 255 | dependencies = [ 256 | "bytes", 257 | "futures-channel", 258 | "futures-core", 259 | "futures-util", 260 | "h2", 261 | "http", 262 | "http-body", 263 | "httparse", 264 | "itoa", 265 | "pin-project", 266 | "socket2", 267 | "time", 268 | "tokio", 269 | "tower-service", 270 | "tracing", 271 | "want", 272 | ] 273 | 274 | [[package]] 275 | name = "hyper-tls" 276 | version = "0.4.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" 279 | dependencies = [ 280 | "bytes", 281 | "hyper", 282 | "native-tls", 283 | "tokio", 284 | "tokio-tls", 285 | ] 286 | 287 | [[package]] 288 | name = "idna" 289 | version = "0.2.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 292 | dependencies = [ 293 | "matches", 294 | "unicode-bidi", 295 | "unicode-normalization", 296 | ] 297 | 298 | [[package]] 299 | name = "indexmap" 300 | version = "1.5.0" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" 303 | dependencies = [ 304 | "autocfg", 305 | "hashbrown", 306 | ] 307 | 308 | [[package]] 309 | name = "iovec" 310 | version = "0.1.4" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 313 | dependencies = [ 314 | "libc", 315 | ] 316 | 317 | [[package]] 318 | name = "ipnet" 319 | version = "2.3.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 322 | 323 | [[package]] 324 | name = "itoa" 325 | version = "0.4.6" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 328 | 329 | [[package]] 330 | name = "js-sys" 331 | version = "0.3.44" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" 334 | dependencies = [ 335 | "wasm-bindgen", 336 | ] 337 | 338 | [[package]] 339 | name = "kernel32-sys" 340 | version = "0.2.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 343 | dependencies = [ 344 | "winapi 0.2.8", 345 | "winapi-build", 346 | ] 347 | 348 | [[package]] 349 | name = "lazy_static" 350 | version = "1.4.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 353 | 354 | [[package]] 355 | name = "libc" 356 | version = "0.2.74" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 359 | 360 | [[package]] 361 | name = "log" 362 | version = "0.4.11" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 365 | dependencies = [ 366 | "cfg-if", 367 | ] 368 | 369 | [[package]] 370 | name = "matches" 371 | version = "0.1.8" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 374 | 375 | [[package]] 376 | name = "memchr" 377 | version = "2.3.3" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 380 | 381 | [[package]] 382 | name = "mime" 383 | version = "0.3.16" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 386 | 387 | [[package]] 388 | name = "mime_guess" 389 | version = "2.0.3" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 392 | dependencies = [ 393 | "mime", 394 | "unicase", 395 | ] 396 | 397 | [[package]] 398 | name = "mio" 399 | version = "0.6.22" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 402 | dependencies = [ 403 | "cfg-if", 404 | "fuchsia-zircon", 405 | "fuchsia-zircon-sys", 406 | "iovec", 407 | "kernel32-sys", 408 | "libc", 409 | "log", 410 | "miow", 411 | "net2", 412 | "slab", 413 | "winapi 0.2.8", 414 | ] 415 | 416 | [[package]] 417 | name = "miow" 418 | version = "0.2.1" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 421 | dependencies = [ 422 | "kernel32-sys", 423 | "net2", 424 | "winapi 0.2.8", 425 | "ws2_32-sys", 426 | ] 427 | 428 | [[package]] 429 | name = "native-tls" 430 | version = "0.2.4" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 433 | dependencies = [ 434 | "lazy_static", 435 | "libc", 436 | "log", 437 | "openssl", 438 | "openssl-probe", 439 | "openssl-sys", 440 | "schannel", 441 | "security-framework", 442 | "security-framework-sys", 443 | "tempfile", 444 | ] 445 | 446 | [[package]] 447 | name = "net2" 448 | version = "0.2.34" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 451 | dependencies = [ 452 | "cfg-if", 453 | "libc", 454 | "winapi 0.3.9", 455 | ] 456 | 457 | [[package]] 458 | name = "num-integer" 459 | version = "0.1.43" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 462 | dependencies = [ 463 | "autocfg", 464 | "num-traits", 465 | ] 466 | 467 | [[package]] 468 | name = "num-traits" 469 | version = "0.2.12" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 472 | dependencies = [ 473 | "autocfg", 474 | ] 475 | 476 | [[package]] 477 | name = "num_cpus" 478 | version = "1.13.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 481 | dependencies = [ 482 | "hermit-abi", 483 | "libc", 484 | ] 485 | 486 | [[package]] 487 | name = "once_cell" 488 | version = "1.4.0" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 491 | 492 | [[package]] 493 | name = "openssl" 494 | version = "0.10.30" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 497 | dependencies = [ 498 | "bitflags", 499 | "cfg-if", 500 | "foreign-types", 501 | "lazy_static", 502 | "libc", 503 | "openssl-sys", 504 | ] 505 | 506 | [[package]] 507 | name = "openssl-probe" 508 | version = "0.1.2" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 511 | 512 | [[package]] 513 | name = "openssl-sys" 514 | version = "0.9.58" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 517 | dependencies = [ 518 | "autocfg", 519 | "cc", 520 | "libc", 521 | "pkg-config", 522 | "vcpkg", 523 | ] 524 | 525 | [[package]] 526 | name = "percent-encoding" 527 | version = "2.1.0" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 530 | 531 | [[package]] 532 | name = "pin-project" 533 | version = "0.4.23" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" 536 | dependencies = [ 537 | "pin-project-internal", 538 | ] 539 | 540 | [[package]] 541 | name = "pin-project-internal" 542 | version = "0.4.23" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" 545 | dependencies = [ 546 | "proc-macro2", 547 | "quote", 548 | "syn", 549 | ] 550 | 551 | [[package]] 552 | name = "pin-project-lite" 553 | version = "0.1.7" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 556 | 557 | [[package]] 558 | name = "pin-utils" 559 | version = "0.1.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 562 | 563 | [[package]] 564 | name = "pkg-config" 565 | version = "0.3.18" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" 568 | 569 | [[package]] 570 | name = "ppv-lite86" 571 | version = "0.2.8" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 574 | 575 | [[package]] 576 | name = "proc-macro2" 577 | version = "1.0.19" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 580 | dependencies = [ 581 | "unicode-xid", 582 | ] 583 | 584 | [[package]] 585 | name = "quote" 586 | version = "1.0.7" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 589 | dependencies = [ 590 | "proc-macro2", 591 | ] 592 | 593 | [[package]] 594 | name = "rand" 595 | version = "0.7.3" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 598 | dependencies = [ 599 | "getrandom", 600 | "libc", 601 | "rand_chacha", 602 | "rand_core", 603 | "rand_hc", 604 | ] 605 | 606 | [[package]] 607 | name = "rand_chacha" 608 | version = "0.2.2" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 611 | dependencies = [ 612 | "ppv-lite86", 613 | "rand_core", 614 | ] 615 | 616 | [[package]] 617 | name = "rand_core" 618 | version = "0.5.1" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 621 | dependencies = [ 622 | "getrandom", 623 | ] 624 | 625 | [[package]] 626 | name = "rand_hc" 627 | version = "0.2.0" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 630 | dependencies = [ 631 | "rand_core", 632 | ] 633 | 634 | [[package]] 635 | name = "redox_syscall" 636 | version = "0.1.57" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 639 | 640 | [[package]] 641 | name = "remove_dir_all" 642 | version = "0.5.3" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 645 | dependencies = [ 646 | "winapi 0.3.9", 647 | ] 648 | 649 | [[package]] 650 | name = "reqwest" 651 | version = "0.10.7" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "12427a5577082c24419c9c417db35cfeb65962efc7675bb6b0d5f1f9d315bfe6" 654 | dependencies = [ 655 | "base64", 656 | "bytes", 657 | "encoding_rs", 658 | "futures-core", 659 | "futures-util", 660 | "http", 661 | "http-body", 662 | "hyper", 663 | "hyper-tls", 664 | "ipnet", 665 | "js-sys", 666 | "lazy_static", 667 | "log", 668 | "mime", 669 | "mime_guess", 670 | "native-tls", 671 | "percent-encoding", 672 | "pin-project-lite", 673 | "serde", 674 | "serde_json", 675 | "serde_urlencoded", 676 | "tokio", 677 | "tokio-tls", 678 | "url", 679 | "wasm-bindgen", 680 | "wasm-bindgen-futures", 681 | "web-sys", 682 | "winreg", 683 | ] 684 | 685 | [[package]] 686 | name = "rust-error-handling-examples" 687 | version = "0.1.0" 688 | dependencies = [ 689 | "chrono", 690 | "reqwest", 691 | ] 692 | 693 | [[package]] 694 | name = "ryu" 695 | version = "1.0.5" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 698 | 699 | [[package]] 700 | name = "schannel" 701 | version = "0.1.19" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 704 | dependencies = [ 705 | "lazy_static", 706 | "winapi 0.3.9", 707 | ] 708 | 709 | [[package]] 710 | name = "security-framework" 711 | version = "0.4.4" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 714 | dependencies = [ 715 | "bitflags", 716 | "core-foundation", 717 | "core-foundation-sys", 718 | "libc", 719 | "security-framework-sys", 720 | ] 721 | 722 | [[package]] 723 | name = "security-framework-sys" 724 | version = "0.4.3" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 727 | dependencies = [ 728 | "core-foundation-sys", 729 | "libc", 730 | ] 731 | 732 | [[package]] 733 | name = "serde" 734 | version = "1.0.114" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 737 | 738 | [[package]] 739 | name = "serde_json" 740 | version = "1.0.57" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" 743 | dependencies = [ 744 | "itoa", 745 | "ryu", 746 | "serde", 747 | ] 748 | 749 | [[package]] 750 | name = "serde_urlencoded" 751 | version = "0.6.1" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 754 | dependencies = [ 755 | "dtoa", 756 | "itoa", 757 | "serde", 758 | "url", 759 | ] 760 | 761 | [[package]] 762 | name = "slab" 763 | version = "0.4.2" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 766 | 767 | [[package]] 768 | name = "socket2" 769 | version = "0.3.12" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 772 | dependencies = [ 773 | "cfg-if", 774 | "libc", 775 | "redox_syscall", 776 | "winapi 0.3.9", 777 | ] 778 | 779 | [[package]] 780 | name = "syn" 781 | version = "1.0.36" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 784 | dependencies = [ 785 | "proc-macro2", 786 | "quote", 787 | "unicode-xid", 788 | ] 789 | 790 | [[package]] 791 | name = "tempfile" 792 | version = "3.1.0" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 795 | dependencies = [ 796 | "cfg-if", 797 | "libc", 798 | "rand", 799 | "redox_syscall", 800 | "remove_dir_all", 801 | "winapi 0.3.9", 802 | ] 803 | 804 | [[package]] 805 | name = "time" 806 | version = "0.1.43" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 809 | dependencies = [ 810 | "libc", 811 | "winapi 0.3.9", 812 | ] 813 | 814 | [[package]] 815 | name = "tinyvec" 816 | version = "0.3.3" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 819 | 820 | [[package]] 821 | name = "tokio" 822 | version = "0.2.22" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" 825 | dependencies = [ 826 | "bytes", 827 | "fnv", 828 | "futures-core", 829 | "iovec", 830 | "lazy_static", 831 | "memchr", 832 | "mio", 833 | "num_cpus", 834 | "pin-project-lite", 835 | "slab", 836 | ] 837 | 838 | [[package]] 839 | name = "tokio-tls" 840 | version = "0.3.1" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" 843 | dependencies = [ 844 | "native-tls", 845 | "tokio", 846 | ] 847 | 848 | [[package]] 849 | name = "tokio-util" 850 | version = "0.3.1" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 853 | dependencies = [ 854 | "bytes", 855 | "futures-core", 856 | "futures-sink", 857 | "log", 858 | "pin-project-lite", 859 | "tokio", 860 | ] 861 | 862 | [[package]] 863 | name = "tower-service" 864 | version = "0.3.0" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 867 | 868 | [[package]] 869 | name = "tracing" 870 | version = "0.1.18" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" 873 | dependencies = [ 874 | "cfg-if", 875 | "log", 876 | "tracing-core", 877 | ] 878 | 879 | [[package]] 880 | name = "tracing-core" 881 | version = "0.1.12" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 884 | dependencies = [ 885 | "lazy_static", 886 | ] 887 | 888 | [[package]] 889 | name = "try-lock" 890 | version = "0.2.3" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 893 | 894 | [[package]] 895 | name = "unicase" 896 | version = "2.6.0" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 899 | dependencies = [ 900 | "version_check", 901 | ] 902 | 903 | [[package]] 904 | name = "unicode-bidi" 905 | version = "0.3.4" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 908 | dependencies = [ 909 | "matches", 910 | ] 911 | 912 | [[package]] 913 | name = "unicode-normalization" 914 | version = "0.1.13" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 917 | dependencies = [ 918 | "tinyvec", 919 | ] 920 | 921 | [[package]] 922 | name = "unicode-xid" 923 | version = "0.2.1" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 926 | 927 | [[package]] 928 | name = "url" 929 | version = "2.1.1" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 932 | dependencies = [ 933 | "idna", 934 | "matches", 935 | "percent-encoding", 936 | ] 937 | 938 | [[package]] 939 | name = "vcpkg" 940 | version = "0.2.10" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 943 | 944 | [[package]] 945 | name = "version_check" 946 | version = "0.9.2" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 949 | 950 | [[package]] 951 | name = "want" 952 | version = "0.3.0" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 955 | dependencies = [ 956 | "log", 957 | "try-lock", 958 | ] 959 | 960 | [[package]] 961 | name = "wasi" 962 | version = "0.9.0+wasi-snapshot-preview1" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 965 | 966 | [[package]] 967 | name = "wasm-bindgen" 968 | version = "0.2.67" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 971 | dependencies = [ 972 | "cfg-if", 973 | "serde", 974 | "serde_json", 975 | "wasm-bindgen-macro", 976 | ] 977 | 978 | [[package]] 979 | name = "wasm-bindgen-backend" 980 | version = "0.2.67" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 983 | dependencies = [ 984 | "bumpalo", 985 | "lazy_static", 986 | "log", 987 | "proc-macro2", 988 | "quote", 989 | "syn", 990 | "wasm-bindgen-shared", 991 | ] 992 | 993 | [[package]] 994 | name = "wasm-bindgen-futures" 995 | version = "0.4.17" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699" 998 | dependencies = [ 999 | "cfg-if", 1000 | "js-sys", 1001 | "wasm-bindgen", 1002 | "web-sys", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "wasm-bindgen-macro" 1007 | version = "0.2.67" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 1010 | dependencies = [ 1011 | "quote", 1012 | "wasm-bindgen-macro-support", 1013 | ] 1014 | 1015 | [[package]] 1016 | name = "wasm-bindgen-macro-support" 1017 | version = "0.2.67" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 1020 | dependencies = [ 1021 | "proc-macro2", 1022 | "quote", 1023 | "syn", 1024 | "wasm-bindgen-backend", 1025 | "wasm-bindgen-shared", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "wasm-bindgen-shared" 1030 | version = "0.2.67" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 1033 | 1034 | [[package]] 1035 | name = "web-sys" 1036 | version = "0.3.44" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" 1039 | dependencies = [ 1040 | "js-sys", 1041 | "wasm-bindgen", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "winapi" 1046 | version = "0.2.8" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1049 | 1050 | [[package]] 1051 | name = "winapi" 1052 | version = "0.3.9" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1055 | dependencies = [ 1056 | "winapi-i686-pc-windows-gnu", 1057 | "winapi-x86_64-pc-windows-gnu", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "winapi-build" 1062 | version = "0.1.1" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1065 | 1066 | [[package]] 1067 | name = "winapi-i686-pc-windows-gnu" 1068 | version = "0.4.0" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1071 | 1072 | [[package]] 1073 | name = "winapi-x86_64-pc-windows-gnu" 1074 | version = "0.4.0" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1077 | 1078 | [[package]] 1079 | name = "winreg" 1080 | version = "0.7.0" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1083 | dependencies = [ 1084 | "winapi 0.3.9", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "ws2_32-sys" 1089 | version = "0.2.1" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1092 | dependencies = [ 1093 | "winapi 0.2.8", 1094 | "winapi-build", 1095 | ] 1096 | -------------------------------------------------------------------------------- /07-create-custom-errors/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | reqwest = { version = "0.10", features = ["blocking", "json"] } 9 | chrono = "0.4" -------------------------------------------------------------------------------- /07-create-custom-errors/src/error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | #[derive(Debug)] 4 | pub enum MyCustomError { 5 | HttpError, 6 | ParseError, 7 | } 8 | 9 | impl std::error::Error for MyCustomError {} 10 | 11 | impl fmt::Display for MyCustomError { 12 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 13 | match self { 14 | MyCustomError::HttpError => write!(f, "HTTP Error"), 15 | MyCustomError::ParseError => write!(f, "Parse Error"), 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /07-create-custom-errors/src/main.rs: -------------------------------------------------------------------------------- 1 | mod error; 2 | 3 | use chrono::NaiveDate; 4 | use error::MyCustomError; 5 | use std::collections::HashMap; 6 | 7 | fn main() { 8 | match get_current_date() { 9 | Ok(date) => println!("We've time travelled to {}!!", date), 10 | Err(e) => { 11 | eprintln!("Oh noes, we don't know which era we're in! :("); 12 | match e { 13 | MyCustomError::HttpError => eprintln!("Request Error: {}", e), 14 | MyCustomError::ParseError => eprintln!("Parse Error: {}", e), 15 | } 16 | } 17 | } 18 | } 19 | 20 | fn get_current_date() -> Result { 21 | // Try changing the url to "https://postman-echo.com/time/objectzzzz" 22 | let url = "https://postman-echo.com/time/object"; 23 | let res = reqwest::blocking::get(url) 24 | .map_err(|_| MyCustomError::HttpError)? 25 | .json::>() 26 | .map_err(|_| MyCustomError::HttpError)?; 27 | 28 | // Try changing the format to "{}-{}-{}z" 29 | let formatted_date = format!("{}-{}-{}", res["years"], res["months"] + 1, res["date"]); 30 | let parsed_date = NaiveDate::parse_from_str(formatted_date.as_str(), "%Y-%m-%d") 31 | .map_err(|_| MyCustomError::ParseError)?; 32 | let date = parsed_date.format("%Y %B %d").to_string(); 33 | 34 | Ok(date) 35 | } 36 | -------------------------------------------------------------------------------- /08-bubble-up-custom-errors/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /08-bubble-up-custom-errors/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "1.0.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 8 | 9 | [[package]] 10 | name = "base64" 11 | version = "0.12.3" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 14 | 15 | [[package]] 16 | name = "bitflags" 17 | version = "1.2.1" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 20 | 21 | [[package]] 22 | name = "bumpalo" 23 | version = "3.4.0" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 26 | 27 | [[package]] 28 | name = "bytes" 29 | version = "0.5.6" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 32 | 33 | [[package]] 34 | name = "cc" 35 | version = "1.0.58" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" 38 | 39 | [[package]] 40 | name = "cfg-if" 41 | version = "0.1.10" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 44 | 45 | [[package]] 46 | name = "chrono" 47 | version = "0.4.13" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" 50 | dependencies = [ 51 | "num-integer", 52 | "num-traits", 53 | "time", 54 | ] 55 | 56 | [[package]] 57 | name = "core-foundation" 58 | version = "0.7.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 61 | dependencies = [ 62 | "core-foundation-sys", 63 | "libc", 64 | ] 65 | 66 | [[package]] 67 | name = "core-foundation-sys" 68 | version = "0.7.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 71 | 72 | [[package]] 73 | name = "dtoa" 74 | version = "0.4.6" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" 77 | 78 | [[package]] 79 | name = "encoding_rs" 80 | version = "0.8.23" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" 83 | dependencies = [ 84 | "cfg-if", 85 | ] 86 | 87 | [[package]] 88 | name = "fnv" 89 | version = "1.0.7" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 92 | 93 | [[package]] 94 | name = "foreign-types" 95 | version = "0.3.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 98 | dependencies = [ 99 | "foreign-types-shared", 100 | ] 101 | 102 | [[package]] 103 | name = "foreign-types-shared" 104 | version = "0.1.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 107 | 108 | [[package]] 109 | name = "fuchsia-zircon" 110 | version = "0.3.3" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 113 | dependencies = [ 114 | "bitflags", 115 | "fuchsia-zircon-sys", 116 | ] 117 | 118 | [[package]] 119 | name = "fuchsia-zircon-sys" 120 | version = "0.3.3" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 123 | 124 | [[package]] 125 | name = "futures-channel" 126 | version = "0.3.5" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 129 | dependencies = [ 130 | "futures-core", 131 | ] 132 | 133 | [[package]] 134 | name = "futures-core" 135 | version = "0.3.5" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 138 | 139 | [[package]] 140 | name = "futures-io" 141 | version = "0.3.5" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 144 | 145 | [[package]] 146 | name = "futures-sink" 147 | version = "0.3.5" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 150 | 151 | [[package]] 152 | name = "futures-task" 153 | version = "0.3.5" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 156 | dependencies = [ 157 | "once_cell", 158 | ] 159 | 160 | [[package]] 161 | name = "futures-util" 162 | version = "0.3.5" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 165 | dependencies = [ 166 | "futures-core", 167 | "futures-io", 168 | "futures-task", 169 | "memchr", 170 | "pin-project", 171 | "pin-utils", 172 | "slab", 173 | ] 174 | 175 | [[package]] 176 | name = "getrandom" 177 | version = "0.1.14" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 180 | dependencies = [ 181 | "cfg-if", 182 | "libc", 183 | "wasi", 184 | ] 185 | 186 | [[package]] 187 | name = "h2" 188 | version = "0.2.6" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" 191 | dependencies = [ 192 | "bytes", 193 | "fnv", 194 | "futures-core", 195 | "futures-sink", 196 | "futures-util", 197 | "http", 198 | "indexmap", 199 | "slab", 200 | "tokio", 201 | "tokio-util", 202 | "tracing", 203 | ] 204 | 205 | [[package]] 206 | name = "hashbrown" 207 | version = "0.8.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" 210 | dependencies = [ 211 | "autocfg", 212 | ] 213 | 214 | [[package]] 215 | name = "hermit-abi" 216 | version = "0.1.15" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 219 | dependencies = [ 220 | "libc", 221 | ] 222 | 223 | [[package]] 224 | name = "http" 225 | version = "0.2.1" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 228 | dependencies = [ 229 | "bytes", 230 | "fnv", 231 | "itoa", 232 | ] 233 | 234 | [[package]] 235 | name = "http-body" 236 | version = "0.3.1" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 239 | dependencies = [ 240 | "bytes", 241 | "http", 242 | ] 243 | 244 | [[package]] 245 | name = "httparse" 246 | version = "1.3.4" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 249 | 250 | [[package]] 251 | name = "hyper" 252 | version = "0.13.7" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" 255 | dependencies = [ 256 | "bytes", 257 | "futures-channel", 258 | "futures-core", 259 | "futures-util", 260 | "h2", 261 | "http", 262 | "http-body", 263 | "httparse", 264 | "itoa", 265 | "pin-project", 266 | "socket2", 267 | "time", 268 | "tokio", 269 | "tower-service", 270 | "tracing", 271 | "want", 272 | ] 273 | 274 | [[package]] 275 | name = "hyper-tls" 276 | version = "0.4.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" 279 | dependencies = [ 280 | "bytes", 281 | "hyper", 282 | "native-tls", 283 | "tokio", 284 | "tokio-tls", 285 | ] 286 | 287 | [[package]] 288 | name = "idna" 289 | version = "0.2.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 292 | dependencies = [ 293 | "matches", 294 | "unicode-bidi", 295 | "unicode-normalization", 296 | ] 297 | 298 | [[package]] 299 | name = "indexmap" 300 | version = "1.5.0" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" 303 | dependencies = [ 304 | "autocfg", 305 | "hashbrown", 306 | ] 307 | 308 | [[package]] 309 | name = "iovec" 310 | version = "0.1.4" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 313 | dependencies = [ 314 | "libc", 315 | ] 316 | 317 | [[package]] 318 | name = "ipnet" 319 | version = "2.3.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 322 | 323 | [[package]] 324 | name = "itoa" 325 | version = "0.4.6" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 328 | 329 | [[package]] 330 | name = "js-sys" 331 | version = "0.3.44" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" 334 | dependencies = [ 335 | "wasm-bindgen", 336 | ] 337 | 338 | [[package]] 339 | name = "kernel32-sys" 340 | version = "0.2.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 343 | dependencies = [ 344 | "winapi 0.2.8", 345 | "winapi-build", 346 | ] 347 | 348 | [[package]] 349 | name = "lazy_static" 350 | version = "1.4.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 353 | 354 | [[package]] 355 | name = "libc" 356 | version = "0.2.74" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 359 | 360 | [[package]] 361 | name = "log" 362 | version = "0.4.11" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 365 | dependencies = [ 366 | "cfg-if", 367 | ] 368 | 369 | [[package]] 370 | name = "matches" 371 | version = "0.1.8" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 374 | 375 | [[package]] 376 | name = "memchr" 377 | version = "2.3.3" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 380 | 381 | [[package]] 382 | name = "mime" 383 | version = "0.3.16" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 386 | 387 | [[package]] 388 | name = "mime_guess" 389 | version = "2.0.3" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 392 | dependencies = [ 393 | "mime", 394 | "unicase", 395 | ] 396 | 397 | [[package]] 398 | name = "mio" 399 | version = "0.6.22" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 402 | dependencies = [ 403 | "cfg-if", 404 | "fuchsia-zircon", 405 | "fuchsia-zircon-sys", 406 | "iovec", 407 | "kernel32-sys", 408 | "libc", 409 | "log", 410 | "miow", 411 | "net2", 412 | "slab", 413 | "winapi 0.2.8", 414 | ] 415 | 416 | [[package]] 417 | name = "miow" 418 | version = "0.2.1" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 421 | dependencies = [ 422 | "kernel32-sys", 423 | "net2", 424 | "winapi 0.2.8", 425 | "ws2_32-sys", 426 | ] 427 | 428 | [[package]] 429 | name = "native-tls" 430 | version = "0.2.4" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 433 | dependencies = [ 434 | "lazy_static", 435 | "libc", 436 | "log", 437 | "openssl", 438 | "openssl-probe", 439 | "openssl-sys", 440 | "schannel", 441 | "security-framework", 442 | "security-framework-sys", 443 | "tempfile", 444 | ] 445 | 446 | [[package]] 447 | name = "net2" 448 | version = "0.2.34" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 451 | dependencies = [ 452 | "cfg-if", 453 | "libc", 454 | "winapi 0.3.9", 455 | ] 456 | 457 | [[package]] 458 | name = "num-integer" 459 | version = "0.1.43" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 462 | dependencies = [ 463 | "autocfg", 464 | "num-traits", 465 | ] 466 | 467 | [[package]] 468 | name = "num-traits" 469 | version = "0.2.12" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 472 | dependencies = [ 473 | "autocfg", 474 | ] 475 | 476 | [[package]] 477 | name = "num_cpus" 478 | version = "1.13.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 481 | dependencies = [ 482 | "hermit-abi", 483 | "libc", 484 | ] 485 | 486 | [[package]] 487 | name = "once_cell" 488 | version = "1.4.0" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 491 | 492 | [[package]] 493 | name = "openssl" 494 | version = "0.10.30" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 497 | dependencies = [ 498 | "bitflags", 499 | "cfg-if", 500 | "foreign-types", 501 | "lazy_static", 502 | "libc", 503 | "openssl-sys", 504 | ] 505 | 506 | [[package]] 507 | name = "openssl-probe" 508 | version = "0.1.2" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 511 | 512 | [[package]] 513 | name = "openssl-sys" 514 | version = "0.9.58" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 517 | dependencies = [ 518 | "autocfg", 519 | "cc", 520 | "libc", 521 | "pkg-config", 522 | "vcpkg", 523 | ] 524 | 525 | [[package]] 526 | name = "percent-encoding" 527 | version = "2.1.0" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 530 | 531 | [[package]] 532 | name = "pin-project" 533 | version = "0.4.23" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" 536 | dependencies = [ 537 | "pin-project-internal", 538 | ] 539 | 540 | [[package]] 541 | name = "pin-project-internal" 542 | version = "0.4.23" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" 545 | dependencies = [ 546 | "proc-macro2", 547 | "quote", 548 | "syn", 549 | ] 550 | 551 | [[package]] 552 | name = "pin-project-lite" 553 | version = "0.1.7" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 556 | 557 | [[package]] 558 | name = "pin-utils" 559 | version = "0.1.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 562 | 563 | [[package]] 564 | name = "pkg-config" 565 | version = "0.3.18" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" 568 | 569 | [[package]] 570 | name = "ppv-lite86" 571 | version = "0.2.8" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 574 | 575 | [[package]] 576 | name = "proc-macro2" 577 | version = "1.0.19" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 580 | dependencies = [ 581 | "unicode-xid", 582 | ] 583 | 584 | [[package]] 585 | name = "quote" 586 | version = "1.0.7" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 589 | dependencies = [ 590 | "proc-macro2", 591 | ] 592 | 593 | [[package]] 594 | name = "rand" 595 | version = "0.7.3" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 598 | dependencies = [ 599 | "getrandom", 600 | "libc", 601 | "rand_chacha", 602 | "rand_core", 603 | "rand_hc", 604 | ] 605 | 606 | [[package]] 607 | name = "rand_chacha" 608 | version = "0.2.2" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 611 | dependencies = [ 612 | "ppv-lite86", 613 | "rand_core", 614 | ] 615 | 616 | [[package]] 617 | name = "rand_core" 618 | version = "0.5.1" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 621 | dependencies = [ 622 | "getrandom", 623 | ] 624 | 625 | [[package]] 626 | name = "rand_hc" 627 | version = "0.2.0" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 630 | dependencies = [ 631 | "rand_core", 632 | ] 633 | 634 | [[package]] 635 | name = "redox_syscall" 636 | version = "0.1.57" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 639 | 640 | [[package]] 641 | name = "remove_dir_all" 642 | version = "0.5.3" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 645 | dependencies = [ 646 | "winapi 0.3.9", 647 | ] 648 | 649 | [[package]] 650 | name = "reqwest" 651 | version = "0.10.7" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "12427a5577082c24419c9c417db35cfeb65962efc7675bb6b0d5f1f9d315bfe6" 654 | dependencies = [ 655 | "base64", 656 | "bytes", 657 | "encoding_rs", 658 | "futures-core", 659 | "futures-util", 660 | "http", 661 | "http-body", 662 | "hyper", 663 | "hyper-tls", 664 | "ipnet", 665 | "js-sys", 666 | "lazy_static", 667 | "log", 668 | "mime", 669 | "mime_guess", 670 | "native-tls", 671 | "percent-encoding", 672 | "pin-project-lite", 673 | "serde", 674 | "serde_json", 675 | "serde_urlencoded", 676 | "tokio", 677 | "tokio-tls", 678 | "url", 679 | "wasm-bindgen", 680 | "wasm-bindgen-futures", 681 | "web-sys", 682 | "winreg", 683 | ] 684 | 685 | [[package]] 686 | name = "rust-error-handling-examples" 687 | version = "0.1.0" 688 | dependencies = [ 689 | "chrono", 690 | "reqwest", 691 | ] 692 | 693 | [[package]] 694 | name = "ryu" 695 | version = "1.0.5" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 698 | 699 | [[package]] 700 | name = "schannel" 701 | version = "0.1.19" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 704 | dependencies = [ 705 | "lazy_static", 706 | "winapi 0.3.9", 707 | ] 708 | 709 | [[package]] 710 | name = "security-framework" 711 | version = "0.4.4" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 714 | dependencies = [ 715 | "bitflags", 716 | "core-foundation", 717 | "core-foundation-sys", 718 | "libc", 719 | "security-framework-sys", 720 | ] 721 | 722 | [[package]] 723 | name = "security-framework-sys" 724 | version = "0.4.3" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 727 | dependencies = [ 728 | "core-foundation-sys", 729 | "libc", 730 | ] 731 | 732 | [[package]] 733 | name = "serde" 734 | version = "1.0.114" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 737 | 738 | [[package]] 739 | name = "serde_json" 740 | version = "1.0.57" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" 743 | dependencies = [ 744 | "itoa", 745 | "ryu", 746 | "serde", 747 | ] 748 | 749 | [[package]] 750 | name = "serde_urlencoded" 751 | version = "0.6.1" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 754 | dependencies = [ 755 | "dtoa", 756 | "itoa", 757 | "serde", 758 | "url", 759 | ] 760 | 761 | [[package]] 762 | name = "slab" 763 | version = "0.4.2" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 766 | 767 | [[package]] 768 | name = "socket2" 769 | version = "0.3.12" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 772 | dependencies = [ 773 | "cfg-if", 774 | "libc", 775 | "redox_syscall", 776 | "winapi 0.3.9", 777 | ] 778 | 779 | [[package]] 780 | name = "syn" 781 | version = "1.0.36" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 784 | dependencies = [ 785 | "proc-macro2", 786 | "quote", 787 | "unicode-xid", 788 | ] 789 | 790 | [[package]] 791 | name = "tempfile" 792 | version = "3.1.0" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 795 | dependencies = [ 796 | "cfg-if", 797 | "libc", 798 | "rand", 799 | "redox_syscall", 800 | "remove_dir_all", 801 | "winapi 0.3.9", 802 | ] 803 | 804 | [[package]] 805 | name = "time" 806 | version = "0.1.43" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 809 | dependencies = [ 810 | "libc", 811 | "winapi 0.3.9", 812 | ] 813 | 814 | [[package]] 815 | name = "tinyvec" 816 | version = "0.3.3" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 819 | 820 | [[package]] 821 | name = "tokio" 822 | version = "0.2.22" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" 825 | dependencies = [ 826 | "bytes", 827 | "fnv", 828 | "futures-core", 829 | "iovec", 830 | "lazy_static", 831 | "memchr", 832 | "mio", 833 | "num_cpus", 834 | "pin-project-lite", 835 | "slab", 836 | ] 837 | 838 | [[package]] 839 | name = "tokio-tls" 840 | version = "0.3.1" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" 843 | dependencies = [ 844 | "native-tls", 845 | "tokio", 846 | ] 847 | 848 | [[package]] 849 | name = "tokio-util" 850 | version = "0.3.1" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 853 | dependencies = [ 854 | "bytes", 855 | "futures-core", 856 | "futures-sink", 857 | "log", 858 | "pin-project-lite", 859 | "tokio", 860 | ] 861 | 862 | [[package]] 863 | name = "tower-service" 864 | version = "0.3.0" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 867 | 868 | [[package]] 869 | name = "tracing" 870 | version = "0.1.18" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" 873 | dependencies = [ 874 | "cfg-if", 875 | "log", 876 | "tracing-core", 877 | ] 878 | 879 | [[package]] 880 | name = "tracing-core" 881 | version = "0.1.12" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 884 | dependencies = [ 885 | "lazy_static", 886 | ] 887 | 888 | [[package]] 889 | name = "try-lock" 890 | version = "0.2.3" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 893 | 894 | [[package]] 895 | name = "unicase" 896 | version = "2.6.0" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 899 | dependencies = [ 900 | "version_check", 901 | ] 902 | 903 | [[package]] 904 | name = "unicode-bidi" 905 | version = "0.3.4" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 908 | dependencies = [ 909 | "matches", 910 | ] 911 | 912 | [[package]] 913 | name = "unicode-normalization" 914 | version = "0.1.13" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 917 | dependencies = [ 918 | "tinyvec", 919 | ] 920 | 921 | [[package]] 922 | name = "unicode-xid" 923 | version = "0.2.1" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 926 | 927 | [[package]] 928 | name = "url" 929 | version = "2.1.1" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 932 | dependencies = [ 933 | "idna", 934 | "matches", 935 | "percent-encoding", 936 | ] 937 | 938 | [[package]] 939 | name = "vcpkg" 940 | version = "0.2.10" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 943 | 944 | [[package]] 945 | name = "version_check" 946 | version = "0.9.2" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 949 | 950 | [[package]] 951 | name = "want" 952 | version = "0.3.0" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 955 | dependencies = [ 956 | "log", 957 | "try-lock", 958 | ] 959 | 960 | [[package]] 961 | name = "wasi" 962 | version = "0.9.0+wasi-snapshot-preview1" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 965 | 966 | [[package]] 967 | name = "wasm-bindgen" 968 | version = "0.2.67" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 971 | dependencies = [ 972 | "cfg-if", 973 | "serde", 974 | "serde_json", 975 | "wasm-bindgen-macro", 976 | ] 977 | 978 | [[package]] 979 | name = "wasm-bindgen-backend" 980 | version = "0.2.67" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 983 | dependencies = [ 984 | "bumpalo", 985 | "lazy_static", 986 | "log", 987 | "proc-macro2", 988 | "quote", 989 | "syn", 990 | "wasm-bindgen-shared", 991 | ] 992 | 993 | [[package]] 994 | name = "wasm-bindgen-futures" 995 | version = "0.4.17" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699" 998 | dependencies = [ 999 | "cfg-if", 1000 | "js-sys", 1001 | "wasm-bindgen", 1002 | "web-sys", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "wasm-bindgen-macro" 1007 | version = "0.2.67" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 1010 | dependencies = [ 1011 | "quote", 1012 | "wasm-bindgen-macro-support", 1013 | ] 1014 | 1015 | [[package]] 1016 | name = "wasm-bindgen-macro-support" 1017 | version = "0.2.67" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 1020 | dependencies = [ 1021 | "proc-macro2", 1022 | "quote", 1023 | "syn", 1024 | "wasm-bindgen-backend", 1025 | "wasm-bindgen-shared", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "wasm-bindgen-shared" 1030 | version = "0.2.67" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 1033 | 1034 | [[package]] 1035 | name = "web-sys" 1036 | version = "0.3.44" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" 1039 | dependencies = [ 1040 | "js-sys", 1041 | "wasm-bindgen", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "winapi" 1046 | version = "0.2.8" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1049 | 1050 | [[package]] 1051 | name = "winapi" 1052 | version = "0.3.9" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1055 | dependencies = [ 1056 | "winapi-i686-pc-windows-gnu", 1057 | "winapi-x86_64-pc-windows-gnu", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "winapi-build" 1062 | version = "0.1.1" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1065 | 1066 | [[package]] 1067 | name = "winapi-i686-pc-windows-gnu" 1068 | version = "0.4.0" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1071 | 1072 | [[package]] 1073 | name = "winapi-x86_64-pc-windows-gnu" 1074 | version = "0.4.0" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1077 | 1078 | [[package]] 1079 | name = "winreg" 1080 | version = "0.7.0" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1083 | dependencies = [ 1084 | "winapi 0.3.9", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "ws2_32-sys" 1089 | version = "0.2.1" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1092 | dependencies = [ 1093 | "winapi 0.2.8", 1094 | "winapi-build", 1095 | ] 1096 | -------------------------------------------------------------------------------- /08-bubble-up-custom-errors/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-error-handling-examples" 3 | version = "0.1.0" 4 | authors = ["sheshbabu "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | reqwest = { version = "0.10", features = ["blocking", "json"] } 9 | chrono = "0.4" -------------------------------------------------------------------------------- /08-bubble-up-custom-errors/src/error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | #[derive(Debug)] 4 | pub enum MyCustomError { 5 | HttpError, 6 | ParseError, 7 | } 8 | 9 | impl std::error::Error for MyCustomError {} 10 | 11 | impl fmt::Display for MyCustomError { 12 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 13 | match self { 14 | MyCustomError::HttpError => write!(f, "HTTP Error"), 15 | MyCustomError::ParseError => write!(f, "Parse Error"), 16 | } 17 | } 18 | } 19 | 20 | impl From for MyCustomError { 21 | fn from(_: reqwest::Error) -> Self { 22 | MyCustomError::HttpError 23 | } 24 | } 25 | 26 | impl From for MyCustomError { 27 | fn from(_: chrono::format::ParseError) -> Self { 28 | MyCustomError::ParseError 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /08-bubble-up-custom-errors/src/main.rs: -------------------------------------------------------------------------------- 1 | mod error; 2 | 3 | use chrono::NaiveDate; 4 | use error::MyCustomError; 5 | use std::collections::HashMap; 6 | 7 | fn main() { 8 | match get_current_date() { 9 | Ok(date) => println!("We've time travelled to {}!!", date), 10 | Err(e) => { 11 | eprintln!("Oh noes, we don't know which era we're in! :("); 12 | match e { 13 | MyCustomError::HttpError => eprintln!("Request Error: {}", e), 14 | MyCustomError::ParseError => eprintln!("Parse Error: {}", e), 15 | } 16 | } 17 | } 18 | } 19 | 20 | fn get_current_date() -> Result { 21 | // Try changing the url to "https://postman-echo.com/time/objectzzzz" 22 | let url = "https://postman-echo.com/time/object"; 23 | let res = reqwest::blocking::get(url)?.json::>()?; 24 | 25 | // Try changing the format to "{}-{}-{}z" 26 | let formatted_date = format!("{}-{}-{}", res["years"], res["months"] + 1, res["date"]); 27 | let parsed_date = NaiveDate::parse_from_str(formatted_date.as_str(), "%Y-%m-%d")?; 28 | let date = parsed_date.format("%Y %B %d").to_string(); 29 | 30 | Ok(date) 31 | } 32 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Rust Error Handling Examples 2 | 3 | Run the examples by `cd`ing into the folder and running `cargo run` 4 | --------------------------------------------------------------------------------