├── .gitignore ├── README.md ├── Cargo.toml ├── Dockerfile ├── src ├── shortener.rs ├── repository.rs └── main.rs ├── LICENSE └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | ======= 3 | # Generated by Cargo 4 | # will have compiled files and executables 5 | /target/ 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rustly 2 | 3 | A toy Rustlang URL shortener. 4 | This is the complimentary example code for [my blog post about Rocket](https://endler.dev/2017/rust-url-shortener). 5 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustly" 3 | version = "0.1.0" 4 | authors = ["Matthias Endler "] 5 | 6 | [dependencies] 7 | rocket = "0.4.7" 8 | rocket_codegen = "0.4.5" 9 | harsh = "0.2.0" 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ekidd/rust-musl-builder 2 | RUN rustup default nightly 3 | RUN rustup target add x86_64-unknown-linux-musl 4 | ADD . /home/rust/src 5 | #RUN sudo chmod -R /home/rust/src 6 | RUN sudo chown -R rust:rust /home/rust/src 7 | WORKDIR /home/rust/src 8 | RUN cargo build --release 9 | EXPOSE 8000 10 | ENTRYPOINT ["/bin/bash", "-c", "/home/rust/src/target/release/rustly"] 11 | -------------------------------------------------------------------------------- /src/shortener.rs: -------------------------------------------------------------------------------- 1 | use harsh::Harsh; 2 | 3 | pub struct Shortener { 4 | id: u64, 5 | generator: Harsh, 6 | } 7 | 8 | impl Shortener { 9 | pub fn new() -> Shortener { 10 | let harsh = Harsh::default(); 11 | Shortener { 12 | id: 0, 13 | generator: harsh, 14 | } 15 | } 16 | 17 | pub fn next_id(&mut self) -> String { 18 | let hashed = self.generator.encode(&[self.id]); 19 | self.id += 1; 20 | hashed 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/repository.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use shortener::Shortener; 3 | 4 | pub struct Repository { 5 | urls: HashMap, 6 | shortener: Shortener, 7 | } 8 | 9 | impl Repository { 10 | pub fn new() -> Repository { 11 | Repository { 12 | urls: HashMap::new(), 13 | shortener: Shortener::new(), 14 | } 15 | } 16 | 17 | pub fn store(&mut self, url: &str) -> String { 18 | let id = self.shortener.next_id(); 19 | self.urls.insert(id.to_string(), url.to_string()); 20 | id 21 | } 22 | 23 | pub fn lookup(&self, id: &str) -> Option<&String> { 24 | self.urls.get(id) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Matthias Endler 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature(proc_macro_hygiene, decl_macro)] 2 | #[macro_use] 3 | extern crate rocket; 4 | 5 | extern crate harsh; 6 | 7 | use rocket::request::Form; 8 | use rocket::response::Redirect; 9 | use rocket::State; 10 | use std::sync::RwLock; 11 | 12 | mod repository; 13 | mod shortener; 14 | use repository::Repository; 15 | 16 | #[derive(FromForm, Debug)] 17 | struct Url { 18 | url: String, 19 | } 20 | 21 | #[get("/")] 22 | fn index() -> &'static str { 23 | " 24 | USAGE 25 | 26 | POST / 27 | Ex: curl --data \"url=https://www.endler.dev\" http://localhost:8000 28 | It shold respond with a shortened url like http://localhost:8000/gY 29 | 30 | GET / 31 | Redirects to shortned link. Try from browser or using the example below. 32 | Ex: curl -i http://localhost:8000/gY 33 | " 34 | } 35 | #[get("/")] 36 | fn lookup(repo: State>, id: String) -> Result { 37 | match repo.read().unwrap().lookup(&id) { 38 | Some(url) => Ok(Redirect::permanent(format!("{}", url))), 39 | _ => Err("Requested ID was not found."), 40 | } 41 | } 42 | 43 | #[post("/", data = "")] 44 | fn shorten(repo: State>, url_form: Form) -> Result { 45 | let ref url = format!("{}", url_form.into_inner().url); 46 | if !url.starts_with("https") && !url.starts_with("http") { 47 | return Err(format!("Not a valid URL {:?}", url)); 48 | } 49 | let mut repo = repo.write().unwrap(); 50 | let id = repo.store(&url); 51 | Ok(format!("http://localhost:8000/{}", id)) 52 | } 53 | fn main() { 54 | rocket::ignite() 55 | .manage(RwLock::new(Repository::new())) 56 | .mount("/", routes![index, lookup, shorten]) 57 | .launch(); 58 | } 59 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aead" 7 | version = "0.2.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4" 10 | dependencies = [ 11 | "generic-array", 12 | ] 13 | 14 | [[package]] 15 | name = "aes" 16 | version = "0.3.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" 19 | dependencies = [ 20 | "aes-soft", 21 | "aesni", 22 | "block-cipher-trait", 23 | ] 24 | 25 | [[package]] 26 | name = "aes-gcm" 27 | version = "0.5.0" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638" 30 | dependencies = [ 31 | "aead", 32 | "aes", 33 | "block-cipher-trait", 34 | "ghash", 35 | "subtle 2.2.3", 36 | "zeroize", 37 | ] 38 | 39 | [[package]] 40 | name = "aes-soft" 41 | version = "0.3.3" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" 44 | dependencies = [ 45 | "block-cipher-trait", 46 | "byteorder", 47 | "opaque-debug", 48 | ] 49 | 50 | [[package]] 51 | name = "aesni" 52 | version = "0.6.0" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" 55 | dependencies = [ 56 | "block-cipher-trait", 57 | "opaque-debug", 58 | ] 59 | 60 | [[package]] 61 | name = "atty" 62 | version = "0.2.14" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 65 | dependencies = [ 66 | "hermit-abi", 67 | "libc", 68 | "winapi 0.3.9", 69 | ] 70 | 71 | [[package]] 72 | name = "autocfg" 73 | version = "1.0.1" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 76 | 77 | [[package]] 78 | name = "base64" 79 | version = "0.9.3" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" 82 | dependencies = [ 83 | "byteorder", 84 | "safemem", 85 | ] 86 | 87 | [[package]] 88 | name = "base64" 89 | version = "0.12.3" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 92 | 93 | [[package]] 94 | name = "bitflags" 95 | version = "1.2.1" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 98 | 99 | [[package]] 100 | name = "block-buffer" 101 | version = "0.7.3" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" 104 | dependencies = [ 105 | "block-padding", 106 | "byte-tools", 107 | "byteorder", 108 | "generic-array", 109 | ] 110 | 111 | [[package]] 112 | name = "block-cipher-trait" 113 | version = "0.6.2" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" 116 | dependencies = [ 117 | "generic-array", 118 | ] 119 | 120 | [[package]] 121 | name = "block-padding" 122 | version = "0.1.5" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" 125 | dependencies = [ 126 | "byte-tools", 127 | ] 128 | 129 | [[package]] 130 | name = "byte-tools" 131 | version = "0.3.1" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" 134 | 135 | [[package]] 136 | name = "byteorder" 137 | version = "1.3.4" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 140 | 141 | [[package]] 142 | name = "cfg-if" 143 | version = "0.1.10" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 146 | 147 | [[package]] 148 | name = "cookie" 149 | version = "0.11.3" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "5795cda0897252e34380a27baf884c53aa7ad9990329cdad96d4c5d027015d44" 152 | dependencies = [ 153 | "aes-gcm", 154 | "base64 0.12.3", 155 | "hkdf", 156 | "hmac", 157 | "percent-encoding 2.1.0", 158 | "rand", 159 | "sha2", 160 | "time", 161 | ] 162 | 163 | [[package]] 164 | name = "crypto-mac" 165 | version = "0.7.0" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" 168 | dependencies = [ 169 | "generic-array", 170 | "subtle 1.0.0", 171 | ] 172 | 173 | [[package]] 174 | name = "devise" 175 | version = "0.2.1" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "dd716c4a507adc5a2aa7c2a372d06c7497727e0892b243d3036bc7478a13e526" 178 | dependencies = [ 179 | "devise_codegen", 180 | "devise_core", 181 | ] 182 | 183 | [[package]] 184 | name = "devise_codegen" 185 | version = "0.2.1" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "ea7b8290d118127c08e3669da20b331bed56b09f20be5945b7da6c116d8fab53" 188 | dependencies = [ 189 | "devise_core", 190 | "quote", 191 | ] 192 | 193 | [[package]] 194 | name = "devise_core" 195 | version = "0.2.1" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "d1053e9d5d5aade9bcedb5ab53b78df2b56ff9408a3138ce77eaaef87f932373" 198 | dependencies = [ 199 | "bitflags", 200 | "proc-macro2", 201 | "quote", 202 | "syn", 203 | ] 204 | 205 | [[package]] 206 | name = "digest" 207 | version = "0.8.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" 210 | dependencies = [ 211 | "generic-array", 212 | ] 213 | 214 | [[package]] 215 | name = "fake-simd" 216 | version = "0.1.2" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 219 | 220 | [[package]] 221 | name = "generic-array" 222 | version = "0.12.3" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" 225 | dependencies = [ 226 | "typenum", 227 | ] 228 | 229 | [[package]] 230 | name = "getrandom" 231 | version = "0.1.14" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 234 | dependencies = [ 235 | "cfg-if", 236 | "libc", 237 | "wasi", 238 | ] 239 | 240 | [[package]] 241 | name = "ghash" 242 | version = "0.2.3" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252" 245 | dependencies = [ 246 | "polyval", 247 | ] 248 | 249 | [[package]] 250 | name = "glob" 251 | version = "0.3.0" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 254 | 255 | [[package]] 256 | name = "harsh" 257 | version = "0.2.0" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "54791bc1351cc4efa5eba6acead1bdd87dae0d2ba375671f2de6f72349b200d9" 260 | 261 | [[package]] 262 | name = "hashbrown" 263 | version = "0.11.2" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 266 | 267 | [[package]] 268 | name = "hermit-abi" 269 | version = "0.1.15" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 272 | dependencies = [ 273 | "libc", 274 | ] 275 | 276 | [[package]] 277 | name = "hkdf" 278 | version = "0.8.0" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3" 281 | dependencies = [ 282 | "digest", 283 | "hmac", 284 | ] 285 | 286 | [[package]] 287 | name = "hmac" 288 | version = "0.7.1" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" 291 | dependencies = [ 292 | "crypto-mac", 293 | "digest", 294 | ] 295 | 296 | [[package]] 297 | name = "httparse" 298 | version = "1.2.1" 299 | source = "registry+https://github.com/rust-lang/crates.io-index" 300 | checksum = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d" 301 | 302 | [[package]] 303 | name = "hyper" 304 | version = "0.10.16" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" 307 | dependencies = [ 308 | "base64 0.9.3", 309 | "httparse", 310 | "language-tags", 311 | "log 0.3.9", 312 | "mime", 313 | "num_cpus", 314 | "time", 315 | "traitobject", 316 | "typeable", 317 | "unicase", 318 | "url", 319 | ] 320 | 321 | [[package]] 322 | name = "idna" 323 | version = "0.1.0" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" 326 | dependencies = [ 327 | "matches", 328 | "unicode-bidi", 329 | "unicode-normalization", 330 | ] 331 | 332 | [[package]] 333 | name = "indexmap" 334 | version = "1.8.2" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" 337 | dependencies = [ 338 | "autocfg", 339 | "hashbrown", 340 | ] 341 | 342 | [[package]] 343 | name = "kernel32-sys" 344 | version = "0.2.2" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 347 | dependencies = [ 348 | "winapi 0.2.8", 349 | "winapi-build", 350 | ] 351 | 352 | [[package]] 353 | name = "language-tags" 354 | version = "0.2.2" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" 357 | 358 | [[package]] 359 | name = "libc" 360 | version = "0.2.76" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3" 363 | 364 | [[package]] 365 | name = "log" 366 | version = "0.3.9" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 369 | dependencies = [ 370 | "log 0.4.11", 371 | ] 372 | 373 | [[package]] 374 | name = "log" 375 | version = "0.4.11" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 378 | dependencies = [ 379 | "cfg-if", 380 | ] 381 | 382 | [[package]] 383 | name = "matches" 384 | version = "0.1.4" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" 387 | 388 | [[package]] 389 | name = "memchr" 390 | version = "2.3.3" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 393 | 394 | [[package]] 395 | name = "mime" 396 | version = "0.2.3" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "5514f038123342d01ee5f95129e4ef1e0470c93bc29edf058a46f9ee3ba6737e" 399 | dependencies = [ 400 | "log 0.3.9", 401 | ] 402 | 403 | [[package]] 404 | name = "num_cpus" 405 | version = "1.3.0" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "a18c392466409c50b87369414a2680c93e739aedeb498eb2bff7d7eb569744e2" 408 | dependencies = [ 409 | "libc", 410 | ] 411 | 412 | [[package]] 413 | name = "opaque-debug" 414 | version = "0.2.3" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" 417 | 418 | [[package]] 419 | name = "pear" 420 | version = "0.1.5" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "32dfa7458144c6af7f9ce6a137ef975466aa68ffa44d4d816ee5934018ba960a" 423 | dependencies = [ 424 | "pear_codegen", 425 | ] 426 | 427 | [[package]] 428 | name = "pear_codegen" 429 | version = "0.1.4" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca" 432 | dependencies = [ 433 | "proc-macro2", 434 | "quote", 435 | "syn", 436 | "version_check", 437 | "yansi", 438 | ] 439 | 440 | [[package]] 441 | name = "percent-encoding" 442 | version = "1.0.1" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 445 | 446 | [[package]] 447 | name = "percent-encoding" 448 | version = "2.1.0" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 451 | 452 | [[package]] 453 | name = "polyval" 454 | version = "0.3.3" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212" 457 | dependencies = [ 458 | "cfg-if", 459 | "universal-hash", 460 | ] 461 | 462 | [[package]] 463 | name = "ppv-lite86" 464 | version = "0.2.9" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" 467 | 468 | [[package]] 469 | name = "proc-macro2" 470 | version = "0.4.30" 471 | source = "registry+https://github.com/rust-lang/crates.io-index" 472 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 473 | dependencies = [ 474 | "unicode-xid", 475 | ] 476 | 477 | [[package]] 478 | name = "quote" 479 | version = "0.6.13" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 482 | dependencies = [ 483 | "proc-macro2", 484 | ] 485 | 486 | [[package]] 487 | name = "rand" 488 | version = "0.7.3" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 491 | dependencies = [ 492 | "getrandom", 493 | "libc", 494 | "rand_chacha", 495 | "rand_core", 496 | "rand_hc", 497 | ] 498 | 499 | [[package]] 500 | name = "rand_chacha" 501 | version = "0.2.2" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 504 | dependencies = [ 505 | "ppv-lite86", 506 | "rand_core", 507 | ] 508 | 509 | [[package]] 510 | name = "rand_core" 511 | version = "0.5.1" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 514 | dependencies = [ 515 | "getrandom", 516 | ] 517 | 518 | [[package]] 519 | name = "rand_hc" 520 | version = "0.2.0" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 523 | dependencies = [ 524 | "rand_core", 525 | ] 526 | 527 | [[package]] 528 | name = "redox_syscall" 529 | version = "0.1.17" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "29dbdfd4b9df8ab31dec47c6087b7b13cbf4a776f335e4de8efba8288dda075b" 532 | 533 | [[package]] 534 | name = "rocket" 535 | version = "0.4.7" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "7febfdfd4d43facfc7daba20349ebe2c310c6735bd6a2a9255ea8bc425b4cb13" 538 | dependencies = [ 539 | "atty", 540 | "base64 0.12.3", 541 | "log 0.4.11", 542 | "memchr", 543 | "num_cpus", 544 | "pear", 545 | "rocket_codegen", 546 | "rocket_http", 547 | "state", 548 | "time", 549 | "toml", 550 | "version_check", 551 | "yansi", 552 | ] 553 | 554 | [[package]] 555 | name = "rocket_codegen" 556 | version = "0.4.11" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "2810037b5820098af97bd4fdd309e76a8101ceb178147de775c835a2537284fe" 559 | dependencies = [ 560 | "devise", 561 | "glob", 562 | "indexmap", 563 | "quote", 564 | "rocket_http", 565 | "version_check", 566 | "yansi", 567 | ] 568 | 569 | [[package]] 570 | name = "rocket_http" 571 | version = "0.4.11" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "2bf9cbd128e1f321a2d0bebd2b7cf0aafd89ca43edf69e49b56a5c46e48eb19f" 574 | dependencies = [ 575 | "cookie", 576 | "hyper", 577 | "indexmap", 578 | "pear", 579 | "percent-encoding 1.0.1", 580 | "smallvec", 581 | "state", 582 | "time", 583 | "unicode-xid", 584 | ] 585 | 586 | [[package]] 587 | name = "rustc_version" 588 | version = "0.1.7" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" 591 | dependencies = [ 592 | "semver", 593 | ] 594 | 595 | [[package]] 596 | name = "rustly" 597 | version = "0.1.0" 598 | dependencies = [ 599 | "harsh", 600 | "rocket", 601 | "rocket_codegen", 602 | ] 603 | 604 | [[package]] 605 | name = "safemem" 606 | version = "0.3.3" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" 609 | 610 | [[package]] 611 | name = "semver" 612 | version = "0.1.20" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" 615 | 616 | [[package]] 617 | name = "serde" 618 | version = "1.0.115" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" 621 | 622 | [[package]] 623 | name = "sha2" 624 | version = "0.8.2" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" 627 | dependencies = [ 628 | "block-buffer", 629 | "digest", 630 | "fake-simd", 631 | "opaque-debug", 632 | ] 633 | 634 | [[package]] 635 | name = "smallvec" 636 | version = "1.4.2" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" 639 | 640 | [[package]] 641 | name = "state" 642 | version = "0.4.1" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "7345c971d1ef21ffdbd103a75990a15eb03604fc8b8852ca8cb418ee1a099028" 645 | 646 | [[package]] 647 | name = "subtle" 648 | version = "1.0.0" 649 | source = "registry+https://github.com/rust-lang/crates.io-index" 650 | checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" 651 | 652 | [[package]] 653 | name = "subtle" 654 | version = "2.2.3" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" 657 | 658 | [[package]] 659 | name = "syn" 660 | version = "0.15.44" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" 663 | dependencies = [ 664 | "proc-macro2", 665 | "quote", 666 | "unicode-xid", 667 | ] 668 | 669 | [[package]] 670 | name = "time" 671 | version = "0.1.36" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" 674 | dependencies = [ 675 | "kernel32-sys", 676 | "libc", 677 | "redox_syscall", 678 | "winapi 0.2.8", 679 | ] 680 | 681 | [[package]] 682 | name = "toml" 683 | version = "0.4.10" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" 686 | dependencies = [ 687 | "serde", 688 | ] 689 | 690 | [[package]] 691 | name = "traitobject" 692 | version = "0.1.0" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" 695 | 696 | [[package]] 697 | name = "typeable" 698 | version = "0.1.2" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" 701 | 702 | [[package]] 703 | name = "typenum" 704 | version = "1.12.0" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 707 | 708 | [[package]] 709 | name = "unicase" 710 | version = "1.4.0" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" 713 | dependencies = [ 714 | "rustc_version", 715 | ] 716 | 717 | [[package]] 718 | name = "unicode-bidi" 719 | version = "0.2.5" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" 722 | dependencies = [ 723 | "matches", 724 | ] 725 | 726 | [[package]] 727 | name = "unicode-normalization" 728 | version = "0.1.4" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" 731 | 732 | [[package]] 733 | name = "unicode-xid" 734 | version = "0.1.0" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 737 | 738 | [[package]] 739 | name = "universal-hash" 740 | version = "0.3.0" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01" 743 | dependencies = [ 744 | "generic-array", 745 | "subtle 2.2.3", 746 | ] 747 | 748 | [[package]] 749 | name = "url" 750 | version = "1.7.2" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" 753 | dependencies = [ 754 | "idna", 755 | "matches", 756 | "percent-encoding 1.0.1", 757 | ] 758 | 759 | [[package]] 760 | name = "version_check" 761 | version = "0.9.2" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 764 | 765 | [[package]] 766 | name = "wasi" 767 | version = "0.9.0+wasi-snapshot-preview1" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 770 | 771 | [[package]] 772 | name = "winapi" 773 | version = "0.2.8" 774 | source = "registry+https://github.com/rust-lang/crates.io-index" 775 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 776 | 777 | [[package]] 778 | name = "winapi" 779 | version = "0.3.9" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 782 | dependencies = [ 783 | "winapi-i686-pc-windows-gnu", 784 | "winapi-x86_64-pc-windows-gnu", 785 | ] 786 | 787 | [[package]] 788 | name = "winapi-build" 789 | version = "0.1.1" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 792 | 793 | [[package]] 794 | name = "winapi-i686-pc-windows-gnu" 795 | version = "0.4.0" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 798 | 799 | [[package]] 800 | name = "winapi-x86_64-pc-windows-gnu" 801 | version = "0.4.0" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 804 | 805 | [[package]] 806 | name = "yansi" 807 | version = "0.5.0" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" 810 | 811 | [[package]] 812 | name = "zeroize" 813 | version = "1.1.0" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | checksum = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" 816 | --------------------------------------------------------------------------------