aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock1572
-rw-r--r--Cargo.toml9
-rw-r--r--src/controllers/event.rs28
-rw-r--r--src/controllers/film.rs26
-rw-r--r--src/controllers/room.rs26
-rw-r--r--src/controllers/screening.rs51
-rw-r--r--src/db.rs137
-rw-r--r--src/lib.rs31
-rw-r--r--src/main.rs35
-rw-r--r--src/models/event.rs22
-rw-r--r--templates/event/index.html.tera (renamed from templates/event/index.tera)0
-rw-r--r--templates/event/new.html.tera (renamed from templates/event/new.tera)2
-rw-r--r--templates/film/list.html.tera (renamed from templates/film/list.tera)0
-rw-r--r--templates/film/new.html.tera (renamed from templates/film/new.tera)0
-rw-r--r--templates/room/list.html.tera (renamed from templates/room/list.tera)0
-rw-r--r--templates/room/new.html.tera (renamed from templates/room/new.tera)0
-rw-r--r--templates/screening/edit.html.tera (renamed from templates/screening/edit.tera)0
-rw-r--r--templates/screening/list.html.tera (renamed from templates/screening/list.tera)0
-rw-r--r--templates/screening/new.html.tera (renamed from templates/screening/new.tera)0
19 files changed, 1284 insertions, 655 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 22a994f..75d7b3c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,82 +1,70 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "addr2line"
-version = "0.13.0"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
+checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
dependencies = [
"gimli",
]
[[package]]
name = "adler"
-version = "0.2.3"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
-name = "aead"
-version = "0.2.0"
+name = "aho-corasick"
+version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4"
+checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
- "generic-array",
+ "memchr",
]
[[package]]
-name = "aes"
+name = "async-stream"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9"
+checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625"
dependencies = [
- "aes-soft",
- "aesni",
- "block-cipher-trait",
+ "async-stream-impl",
+ "futures-core",
]
[[package]]
-name = "aes-gcm"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638"
-dependencies = [
- "aead",
- "aes",
- "block-cipher-trait",
- "ghash",
- "subtle 2.2.3",
- "zeroize",
-]
-
-[[package]]
-name = "aes-soft"
-version = "0.3.3"
+name = "async-stream-impl"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d"
+checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308"
dependencies = [
- "block-cipher-trait",
- "byteorder",
- "opaque-debug",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
-name = "aesni"
-version = "0.6.0"
+name = "async-trait"
+version = "0.1.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100"
+checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
dependencies = [
- "block-cipher-trait",
- "opaque-debug",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
-name = "aho-corasick"
-version = "0.7.13"
+name = "atomic"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
+checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281"
dependencies = [
- "memchr",
+ "autocfg",
]
[[package]]
@@ -98,12 +86,13 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "backtrace"
-version = "0.3.50"
+version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293"
+checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01"
dependencies = [
"addr2line",
- "cfg-if",
+ "cc",
+ "cfg-if 1.0.0",
"libc",
"miniz_oxide",
"object",
@@ -111,26 +100,22 @@ dependencies = [
]
[[package]]
-name = "base64"
-version = "0.9.3"
+name = "base-x"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
-dependencies = [
- "byteorder",
- "safemem",
-]
+checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
[[package]]
-name = "base64"
-version = "0.12.3"
+name = "binascii"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
+checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
[[package]]
name = "bitflags"
-version = "1.2.1"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "block-buffer"
@@ -145,24 +130,30 @@ dependencies = [
]
[[package]]
-name = "block-cipher-trait"
-version = "0.6.2"
+name = "block-padding"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774"
+checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
dependencies = [
- "generic-array",
+ "byte-tools",
]
[[package]]
-name = "block-padding"
-version = "0.1.5"
+name = "bstr"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
+checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
dependencies = [
- "byte-tools",
+ "memchr",
]
[[package]]
+name = "bumpalo"
+version = "3.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
+
+[[package]]
name = "byte-tools"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -170,9 +161,21 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
[[package]]
name = "byteorder"
-version = "1.3.4"
+version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
+checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
+
+[[package]]
+name = "bytes"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
+
+[[package]]
+name = "cc"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
[[package]]
name = "cfg-if"
@@ -181,50 +184,61 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
name = "chrono"
-version = "0.4.15"
+version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "942f72db697d8767c22d46a598e01f2d3b475501ea43d0db4f16d90259182d0b"
+checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
dependencies = [
+ "libc",
"num-integer",
"num-traits",
"serde",
- "time",
+ "time 0.1.43",
+ "winapi 0.3.9",
]
[[package]]
-name = "cloudabi"
-version = "0.1.0"
+name = "chrono-tz"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
+checksum = "2554a3155fec064362507487171dcc4edc3df60cb10f3a1fb10ed8094822b120"
dependencies = [
- "bitflags",
+ "chrono",
+ "parse-zoneinfo",
]
[[package]]
+name = "const_fn"
+version = "0.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7"
+
+[[package]]
name = "cookie"
-version = "0.11.3"
+version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5795cda0897252e34380a27baf884c53aa7ad9990329cdad96d4c5d027015d44"
+checksum = "d5f1c7727e460397e56abc4bddc1d49e07a1ad78fc98eb2e1c8f032a58a2f80d"
dependencies = [
- "aes-gcm",
- "base64 0.12.3",
- "hkdf",
- "hmac",
- "percent-encoding 2.1.0",
- "rand",
- "sha2",
- "time",
+ "percent-encoding",
+ "time 0.2.27",
+ "version_check",
]
[[package]]
-name = "crypto-mac"
-version = "0.7.0"
+name = "crossbeam-utils"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5"
+checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
dependencies = [
- "generic-array",
- "subtle 1.0.0",
+ "autocfg",
+ "cfg-if 0.1.10",
+ "lazy_static",
]
[[package]]
@@ -235,9 +249,9 @@ checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690"
[[package]]
name = "devise"
-version = "0.2.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74e04ba2d03c5fa0d954c061fc8c9c288badadffc272ebb87679a89846de3ed3"
+checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595"
dependencies = [
"devise_codegen",
"devise_core",
@@ -245,31 +259,32 @@ dependencies = [
[[package]]
name = "devise_codegen"
-version = "0.2.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "066ceb7928ca93a9bedc6d0e612a8a0424048b0ab1f75971b203d01420c055d7"
+checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2"
dependencies = [
"devise_core",
- "quote 0.6.13",
+ "quote",
]
[[package]]
name = "devise_core"
-version = "0.2.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf41c59b22b5e3ec0ea55c7847e5f358d340f3a8d6d53a5cf4f1564967f96487"
+checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0"
dependencies = [
"bitflags",
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "syn 0.15.44",
+ "proc-macro2",
+ "proc-macro2-diagnostics",
+ "quote",
+ "syn",
]
[[package]]
name = "diesel"
-version = "1.4.5"
+version = "1.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e2de9deab977a153492a1468d1b1c0662c1cf39e5ea87d0c060ecd59ef18d8c"
+checksum = "bba51ca66f57261fd17cadf8b73e4775cc307d0521d855de3f5de91a8f074e0e"
dependencies = [
"bitflags",
"byteorder",
@@ -285,9 +300,9 @@ version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
dependencies = [
- "proc-macro2 1.0.19",
- "quote 1.0.7",
- "syn 1.0.39",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -300,6 +315,12 @@ dependencies = [
]
[[package]]
+name = "discard"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
+
+[[package]]
name = "dotenv"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -311,13 +332,18 @@ dependencies = [
]
[[package]]
-name = "error-chain"
-version = "0.12.4"
+name = "either"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
+
+[[package]]
+name = "encoding_rs"
+version = "0.8.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc"
+checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
dependencies = [
- "backtrace",
- "version_check 0.9.2",
+ "cfg-if 1.0.0",
]
[[package]]
@@ -336,9 +362,9 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
dependencies = [
- "proc-macro2 1.0.19",
- "quote 1.0.7",
- "syn 1.0.39",
+ "proc-macro2",
+ "quote",
+ "syn",
"synstructure",
]
@@ -349,18 +375,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
[[package]]
+name = "figment"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "790b4292c72618abbab50f787a477014fe15634f96291de45672ce46afe122df"
+dependencies = [
+ "atomic",
+ "pear",
+ "serde",
+ "toml",
+ "uncased",
+ "version_check",
+]
+
+[[package]]
name = "filetime"
-version = "0.2.12"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e"
+checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
dependencies = [
- "cfg-if",
+ "cfg-if 1.0.0",
"libc",
"redox_syscall",
"winapi 0.3.9",
]
[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
name = "fsevent"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -396,45 +442,137 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
-name = "generic-array"
-version = "0.12.3"
+name = "futures"
+version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
+checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
dependencies = [
- "typenum",
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
]
[[package]]
-name = "getrandom"
-version = "0.1.14"
+name = "futures-channel"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582"
+
+[[package]]
+name = "futures-macro"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
+dependencies = [
+ "autocfg",
+ "proc-macro-hack",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "futures-sink"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53"
+
+[[package]]
+name = "futures-task"
+version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
+checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
+
+[[package]]
+name = "futures-util"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
dependencies = [
- "cfg-if",
+ "autocfg",
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-macro",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "proc-macro-hack",
+ "proc-macro-nested",
+ "slab",
+]
+
+[[package]]
+name = "generator"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee"
+dependencies = [
+ "cc",
"libc",
- "wasi",
+ "log",
+ "rustversion",
+ "winapi 0.3.9",
]
[[package]]
-name = "ghash"
-version = "0.2.3"
+name = "generic-array"
+version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252"
+checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
dependencies = [
- "polyval",
+ "typenum",
]
[[package]]
-name = "gimli"
-version = "0.22.0"
+name = "getrandom"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
+checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "wasi",
+]
[[package]]
-name = "glob"
-version = "0.2.11"
+name = "gimli"
+version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
+checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
[[package]]
name = "glob"
@@ -443,96 +581,163 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]]
-name = "hashbrown"
-version = "0.8.2"
+name = "globset"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25"
+checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd"
dependencies = [
- "autocfg",
+ "aho-corasick",
+ "bstr",
+ "fnv",
+ "log",
+ "regex",
]
[[package]]
+name = "globwalk"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc"
+dependencies = [
+ "bitflags",
+ "ignore",
+ "walkdir",
+]
+
+[[package]]
+name = "h2"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472"
+dependencies = [
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "http",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
+
+[[package]]
name = "hermit-abi"
-version = "0.1.15"
+version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
-name = "hkdf"
-version = "0.8.0"
+name = "http"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3"
+checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
dependencies = [
- "digest",
- "hmac",
+ "bytes",
+ "fnv",
+ "itoa",
]
[[package]]
-name = "hmac"
-version = "0.7.1"
+name = "http-body"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695"
+checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
dependencies = [
- "crypto-mac",
- "digest",
+ "bytes",
+ "http",
+ "pin-project-lite",
]
[[package]]
name = "httparse"
-version = "1.3.4"
+version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9"
+checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503"
+
+[[package]]
+name = "httpdate"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
[[package]]
name = "humansize"
-version = "1.1.0"
+version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e"
+checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026"
[[package]]
name = "hyper"
-version = "0.10.16"
+version = "0.14.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273"
+checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11"
dependencies = [
- "base64 0.9.3",
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
"httparse",
- "language-tags",
- "log 0.3.9",
- "mime",
- "num_cpus",
- "time",
- "traitobject",
- "typeable",
- "unicase",
- "url",
+ "httpdate",
+ "itoa",
+ "pin-project-lite",
+ "socket2",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "want",
]
[[package]]
-name = "idna"
-version = "0.1.5"
+name = "ignore"
+version = "0.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
+checksum = "22dcbf2a4a289528dbef21686354904e1c694ac642610a9bff9e7df730d9ec72"
dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
+ "crossbeam-utils",
+ "globset",
+ "lazy_static",
+ "log",
+ "memchr",
+ "regex",
+ "same-file",
+ "thread_local",
+ "walkdir",
+ "winapi-util",
]
[[package]]
name = "indexmap"
-version = "1.5.1"
+version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9"
+checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
"hashbrown",
+ "serde",
]
[[package]]
+name = "inlinable_string"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77"
+
+[[package]]
name = "inotify"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -545,18 +750,21 @@ dependencies = [
[[package]]
name = "inotify-sys"
-version = "0.1.3"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0"
+checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb"
dependencies = [
"libc",
]
[[package]]
name = "instant"
-version = "0.1.6"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"
+checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d"
+dependencies = [
+ "cfg-if 1.0.0",
+]
[[package]]
name = "iovec"
@@ -569,9 +777,9 @@ dependencies = [
[[package]]
name = "itoa"
-version = "0.4.6"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
+checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "kernel32-sys"
@@ -584,12 +792,6 @@ dependencies = [
]
[[package]]
-name = "language-tags"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
-
-[[package]]
name = "lazy_static"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -603,35 +805,39 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.76"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3"
+checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5"
[[package]]
name = "lock_api"
-version = "0.4.1"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
+checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
dependencies = [
"scopeguard",
]
[[package]]
name = "log"
-version = "0.3.9"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
- "log 0.4.11",
+ "cfg-if 1.0.0",
]
[[package]]
-name = "log"
-version = "0.4.11"
+name = "loom"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
+checksum = "2111607c723d7857e0d8299d5ce7a0bf4b844d3e44f8de136b13da513eaf8fc4"
dependencies = [
- "cfg-if",
+ "cfg-if 1.0.0",
+ "generator",
+ "scoped-tls",
+ "serde",
+ "serde_json",
]
[[package]]
@@ -641,71 +847,76 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]]
-name = "matches"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
-
-[[package]]
name = "memchr"
-version = "2.3.3"
+version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
+checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "mime"
-version = "0.2.6"
+version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0"
-dependencies = [
- "log 0.3.9",
-]
+checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
[[package]]
name = "miniz_oxide"
-version = "0.4.0"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f"
+checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
dependencies = [
"adler",
+ "autocfg",
]
[[package]]
name = "mio"
-version = "0.6.22"
+version = "0.6.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
+checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4"
dependencies = [
- "cfg-if",
+ "cfg-if 0.1.10",
"fuchsia-zircon",
"fuchsia-zircon-sys",
"iovec",
"kernel32-sys",
"libc",
- "log 0.4.11",
- "miow",
+ "log",
+ "miow 0.2.2",
"net2",
"slab",
"winapi 0.2.8",
]
[[package]]
+name = "mio"
+version = "0.7.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
+dependencies = [
+ "libc",
+ "log",
+ "miow 0.3.7",
+ "ntapi",
+ "winapi 0.3.9",
+]
+
+[[package]]
name = "mio-extras"
version = "2.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19"
dependencies = [
"lazycell",
- "log 0.4.11",
- "mio",
+ "log",
+ "mio 0.6.23",
"slab",
]
[[package]]
name = "miow"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
+checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
dependencies = [
"kernel32-sys",
"net2",
@@ -714,21 +925,59 @@ dependencies = [
]
[[package]]
+name = "miow"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
+dependencies = [
+ "winapi 0.3.9",
+]
+
+[[package]]
+name = "multer"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "408327e2999b839cd1af003fc01b2019a6c10a1361769542203f6fedc5179680"
+dependencies = [
+ "bytes",
+ "encoding_rs",
+ "futures-util",
+ "http",
+ "httparse",
+ "log",
+ "mime",
+ "spin",
+ "tokio",
+ "tokio-util",
+ "twoway",
+ "version_check",
+]
+
+[[package]]
name = "net2"
-version = "0.2.34"
+version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
+checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae"
dependencies = [
- "cfg-if",
+ "cfg-if 0.1.10",
"libc",
"winapi 0.3.9",
]
[[package]]
+name = "normpath"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27e6e8f70e9fbbe3752d330d769e3424f24b9458ce266df93a3b456902fd696a"
+dependencies = [
+ "winapi 0.3.9",
+]
+
+[[package]]
name = "notify"
-version = "4.0.15"
+version = "4.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd"
+checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257"
dependencies = [
"bitflags",
"filetime",
@@ -736,17 +985,26 @@ dependencies = [
"fsevent-sys",
"inotify",
"libc",
- "mio",
+ "mio 0.6.23",
"mio-extras",
"walkdir",
"winapi 0.3.9",
]
[[package]]
+name = "ntapi"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
+dependencies = [
+ "winapi 0.3.9",
+]
+
+[[package]]
name = "num-integer"
-version = "0.1.43"
+version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
+checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [
"autocfg",
"num-traits",
@@ -754,9 +1012,9 @@ dependencies = [
[[package]]
name = "num-traits"
-version = "0.2.12"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [
"autocfg",
]
@@ -773,9 +1031,18 @@ dependencies = [
[[package]]
name = "object"
-version = "0.20.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
+checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
[[package]]
name = "opaque-debug"
@@ -785,9 +1052,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
[[package]]
name = "parking_lot"
-version = "0.11.0"
+version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
+checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
dependencies = [
"instant",
"lock_api",
@@ -796,12 +1063,11 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.8.0"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
+checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
dependencies = [
- "cfg-if",
- "cloudabi",
+ "cfg-if 1.0.0",
"instant",
"libc",
"redox_syscall",
@@ -810,32 +1076,36 @@ dependencies = [
]
[[package]]
-name = "pear"
-version = "0.1.4"
+name = "parse-zoneinfo"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5320f212db967792b67cfe12bd469d08afd6318a249bd917d5c19bc92200ab8a"
+checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41"
dependencies = [
- "pear_codegen",
+ "regex",
]
[[package]]
-name = "pear_codegen"
-version = "0.1.4"
+name = "pear"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca"
+checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702"
dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "syn 0.15.44",
- "version_check 0.9.2",
+ "inlinable_string",
+ "pear_codegen",
"yansi",
]
[[package]]
-name = "percent-encoding"
-version = "1.0.1"
+name = "pear_codegen"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
+checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0"
+dependencies = [
+ "proc-macro2",
+ "proc-macro2-diagnostics",
+ "quote",
+ "syn",
+]
[[package]]
name = "percent-encoding"
@@ -870,9 +1140,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
dependencies = [
"pest",
"pest_meta",
- "proc-macro2 1.0.19",
- "quote 1.0.7",
- "syn 1.0.39",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
@@ -887,20 +1157,22 @@ dependencies = [
]
[[package]]
-name = "polyval"
-version = "0.3.3"
+name = "pin-project-lite"
+version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212"
-dependencies = [
- "cfg-if",
- "universal-hash",
-]
+checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "ppv-lite86"
-version = "0.2.9"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]]
name = "pq-sys"
@@ -912,39 +1184,46 @@ dependencies = [
]
[[package]]
-name = "proc-macro2"
-version = "0.4.30"
+name = "proc-macro-hack"
+version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
-dependencies = [
- "unicode-xid 0.1.0",
-]
+checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
+
+[[package]]
+name = "proc-macro-nested"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]]
name = "proc-macro2"
-version = "1.0.19"
+version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
+checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
dependencies = [
- "unicode-xid 0.2.1",
+ "unicode-xid",
]
[[package]]
-name = "quote"
-version = "0.6.13"
+name = "proc-macro2-diagnostics"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
+checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada"
dependencies = [
- "proc-macro2 0.4.30",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "version_check",
+ "yansi",
]
[[package]]
name = "quote"
-version = "1.0.7"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
+checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
- "proc-macro2 1.0.19",
+ "proc-macro2",
]
[[package]]
@@ -953,7 +1232,7 @@ version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
dependencies = [
- "log 0.4.11",
+ "log",
"parking_lot",
"scheduled-thread-pool",
]
@@ -967,18 +1246,18 @@ dependencies = [
"dotenv",
"lazy_static",
"rocket",
- "rocket_contrib",
+ "rocket_dyn_templates",
+ "rocket_sync_db_pools",
"serde",
"serde_json",
]
[[package]]
name = "rand"
-version = "0.7.3"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
+checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
dependencies = [
- "getrandom",
"libc",
"rand_chacha",
"rand_core",
@@ -987,9 +1266,9 @@ dependencies = [
[[package]]
name = "rand_chacha"
-version = "0.2.2"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core",
@@ -997,146 +1276,225 @@ dependencies = [
[[package]]
name = "rand_core"
-version = "0.5.1"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
+checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
dependencies = [
"getrandom",
]
[[package]]
name = "rand_hc"
-version = "0.2.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
+checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
dependencies = [
"rand_core",
]
[[package]]
name = "redox_syscall"
-version = "0.1.57"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "ref-cast"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da"
+dependencies = [
+ "ref-cast-impl",
+]
+
+[[package]]
+name = "ref-cast-impl"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
+checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
[[package]]
name = "regex"
-version = "1.3.9"
+version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
+checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
- "thread_local",
]
[[package]]
name = "regex-syntax"
-version = "0.6.18"
+version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
+checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
+
+[[package]]
+name = "remove_dir_all"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
+dependencies = [
+ "winapi 0.3.9",
+]
[[package]]
name = "rocket"
-version = "0.4.5"
+version = "0.5.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6130967b369cfb8411b0b73e96fcba1229c32a9cc6f295d144f879bfced13c6e"
+checksum = "0a71c18c42a0eb15bf3816831caf0dad11e7966f2a41aaf486a701979c4dd1f2"
dependencies = [
+ "async-stream",
+ "async-trait",
+ "atomic",
"atty",
- "base64 0.12.3",
- "log 0.4.11",
+ "binascii",
+ "bytes",
+ "either",
+ "figment",
+ "futures",
+ "indexmap",
+ "log",
"memchr",
+ "multer",
"num_cpus",
- "pear",
+ "parking_lot",
+ "pin-project-lite",
+ "rand",
+ "ref-cast",
"rocket_codegen",
"rocket_http",
+ "serde",
+ "serde_json",
"state",
- "time",
- "toml",
- "version_check 0.9.2",
+ "tempfile",
+ "time 0.2.27",
+ "tokio",
+ "tokio-stream",
+ "tokio-util",
+ "ubyte",
+ "version_check",
"yansi",
]
[[package]]
name = "rocket_codegen"
-version = "0.4.5"
+version = "0.5.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb852e6da168fb948a8f2b798ba2e2f0e4fc860eae0efa9cf2bf0f5466bb0425"
+checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb"
dependencies = [
"devise",
- "glob 0.3.0",
+ "glob",
"indexmap",
- "quote 0.6.13",
+ "proc-macro2",
+ "quote",
"rocket_http",
- "version_check 0.9.2",
- "yansi",
+ "syn",
+ "unicode-xid",
]
[[package]]
-name = "rocket_contrib"
-version = "0.4.5"
+name = "rocket_dyn_templates"
+version = "0.1.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3946ca815127041d8f64455561031d058c22ae1b135251502c5ea523cf9e14b"
+checksum = "c83f1287ad8fa034410928297a91db37518d5c46d7cc7e1e1b4a77aec0cd8807"
dependencies = [
- "diesel",
- "glob 0.3.0",
- "log 0.4.11",
+ "glob",
+ "normpath",
"notify",
- "r2d2",
"rocket",
- "rocket_contrib_codegen",
"serde",
"serde_json",
"tera",
]
[[package]]
-name = "rocket_contrib_codegen"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbc1c93c930af81f5097b8fd3cbc245a8b47c906a45a30c167cb3df0cd7ac404"
-dependencies = [
- "devise",
- "quote 0.6.13",
- "version_check 0.9.2",
- "yansi",
-]
-
-[[package]]
name = "rocket_http"
-version = "0.4.5"
+version = "0.5.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aff5a5480175f2f553a876b251e9350c74196128806d176da3a51c82aab5428"
+checksum = "23c8b7d512d2fcac2316ebe590cde67573844b99e6cc9ee0f53375fa16e25ebd"
dependencies = [
"cookie",
+ "either",
+ "http",
"hyper",
"indexmap",
+ "log",
+ "memchr",
+ "mime",
+ "parking_lot",
"pear",
- "percent-encoding 1.0.1",
+ "percent-encoding",
+ "pin-project-lite",
+ "ref-cast",
+ "serde",
"smallvec",
+ "stable-pattern",
"state",
- "time",
- "unicode-xid 0.1.0",
+ "time 0.2.27",
+ "tokio",
+ "uncased",
+]
+
+[[package]]
+name = "rocket_sync_db_pools"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38cfdfebd552d075c368e641c88a5cd6ce1c58c5c710548aeb777abb48830f4b"
+dependencies = [
+ "diesel",
+ "r2d2",
+ "rocket",
+ "rocket_sync_db_pools_codegen",
+ "serde",
+ "tokio",
+]
+
+[[package]]
+name = "rocket_sync_db_pools_codegen"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5267808c094db5366e1d8925aaf9f2ce05ff9b3bd92cb18c7040a1fe219c2e25"
+dependencies = [
+ "devise",
+ "quote",
]
[[package]]
name = "rustc-demangle"
-version = "0.1.16"
+version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
+checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49"
[[package]]
-name = "ryu"
+name = "rustc_version"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "rustversion"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
[[package]]
-name = "safemem"
-version = "0.3.3"
+name = "ryu"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
[[package]]
name = "same-file"
@@ -1157,36 +1515,57 @@ dependencies = [
]
[[package]]
+name = "scoped-tls"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
+
+[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
+name = "semver"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
+dependencies = [
+ "semver-parser",
+]
+
+[[package]]
+name = "semver-parser"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
+
+[[package]]
name = "serde"
-version = "1.0.115"
+version = "1.0.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5"
+checksum = "1056a0db1978e9dbf0f6e4fca677f6f9143dc1c19de346f22cac23e422196834"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.115"
+version = "1.0.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48"
+checksum = "13af2fbb8b60a8950d6c72a56d2095c28870367cc8e10c55e9745bac4995a2c4"
dependencies = [
- "proc-macro2 1.0.19",
- "quote 1.0.7",
- "syn 1.0.39",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
name = "serde_json"
-version = "1.0.57"
+version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c"
+checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127"
dependencies = [
"itoa",
"ryu",
@@ -1206,22 +1585,25 @@ dependencies = [
]
[[package]]
-name = "sha2"
-version = "0.8.2"
+name = "sha1"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
+checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
dependencies = [
- "block-buffer",
- "digest",
- "fake-simd",
- "opaque-debug",
+ "libc",
]
[[package]]
name = "slab"
-version = "0.4.2"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
+checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
[[package]]
name = "slug"
@@ -1234,90 +1616,168 @@ dependencies = [
[[package]]
name = "smallvec"
-version = "1.4.2"
+version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
+checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]]
-name = "state"
+name = "socket2"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7345c971d1ef21ffdbd103a75990a15eb03604fc8b8852ca8cb418ee1a099028"
+checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad"
+dependencies = [
+ "libc",
+ "winapi 0.3.9",
+]
[[package]]
-name = "subtle"
-version = "1.0.0"
+name = "spin"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
+checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5"
[[package]]
-name = "subtle"
-version = "2.2.3"
+name = "stable-pattern"
+version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1"
+checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045"
+dependencies = [
+ "memchr",
+]
[[package]]
-name = "syn"
-version = "0.15.44"
+name = "standback"
+version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
+checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "unicode-xid 0.1.0",
+ "version_check",
]
[[package]]
+name = "state"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87cf4f5369e6d3044b5e365c9690f451516ac8f0954084622b49ea3fde2f6de5"
+dependencies = [
+ "loom",
+]
+
+[[package]]
+name = "stdweb"
+version = "0.4.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
+dependencies = [
+ "discard",
+ "rustc_version",
+ "stdweb-derive",
+ "stdweb-internal-macros",
+ "stdweb-internal-runtime",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "stdweb-derive"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "serde_derive",
+ "syn",
+]
+
+[[package]]
+name = "stdweb-internal-macros"
+version = "0.2.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
+dependencies = [
+ "base-x",
+ "proc-macro2",
+ "quote",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "sha1",
+ "syn",
+]
+
+[[package]]
+name = "stdweb-internal-runtime"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
+
+[[package]]
name = "syn"
-version = "1.0.39"
+version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891d8d6567fe7c7f8835a3a98af4208f3846fba258c1bc3c31d6e506239f11f9"
+checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
dependencies = [
- "proc-macro2 1.0.19",
- "quote 1.0.7",
- "unicode-xid 0.2.1",
+ "proc-macro2",
+ "quote",
+ "unicode-xid",
]
[[package]]
name = "synstructure"
-version = "0.12.4"
+version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
+checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa"
dependencies = [
- "proc-macro2 1.0.19",
- "quote 1.0.7",
- "syn 1.0.39",
- "unicode-xid 0.2.1",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "unicode-xid",
+]
+
+[[package]]
+name = "tempfile"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "rand",
+ "redox_syscall",
+ "remove_dir_all",
+ "winapi 0.3.9",
]
[[package]]
name = "tera"
-version = "0.11.20"
+version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b505279e19d8f7d24b1a9dc58327c9c36174b1a2c7ebdeac70792d017cb64f3"
+checksum = "bf95b0d8a46da5fe3ea119394a6c7f1e745f9de359081641c99946e2bf55d4f2"
dependencies = [
"chrono",
- "error-chain",
- "glob 0.2.11",
+ "chrono-tz",
+ "globwalk",
"humansize",
"lazy_static",
+ "percent-encoding",
"pest",
"pest_derive",
+ "rand",
"regex",
"serde",
"serde_json",
"slug",
"unic-segment",
- "url",
]
[[package]]
name = "thread_local"
-version = "1.0.1"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
+checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd"
dependencies = [
- "lazy_static",
+ "once_cell",
]
[[package]]
@@ -1331,37 +1791,163 @@ dependencies = [
]
[[package]]
-name = "tinyvec"
-version = "0.3.4"
+name = "time"
+version = "0.2.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242"
+dependencies = [
+ "const_fn",
+ "libc",
+ "standback",
+ "stdweb",
+ "time-macros",
+ "version_check",
+ "winapi 0.3.9",
+]
+
+[[package]]
+name = "time-macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1"
+dependencies = [
+ "proc-macro-hack",
+ "time-macros-impl",
+]
+
+[[package]]
+name = "time-macros-impl"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f"
+dependencies = [
+ "proc-macro-hack",
+ "proc-macro2",
+ "quote",
+ "standback",
+ "syn",
+]
+
+[[package]]
+name = "tokio"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b"
+dependencies = [
+ "autocfg",
+ "bytes",
+ "libc",
+ "memchr",
+ "mio 0.7.13",
+ "num_cpus",
+ "once_cell",
+ "pin-project-lite",
+ "signal-hook-registry",
+ "tokio-macros",
+ "winapi 0.3.9",
+]
+
+[[package]]
+name = "tokio-macros"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
+checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "tokio-stream"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.6.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "log",
+ "pin-project-lite",
+ "tokio",
+]
[[package]]
name = "toml"
-version = "0.4.10"
+version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
+checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
dependencies = [
"serde",
]
[[package]]
-name = "traitobject"
-version = "0.1.0"
+name = "tower-service"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
+checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
[[package]]
-name = "typeable"
-version = "0.1.2"
+name = "tracing"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
+dependencies = [
+ "cfg-if 1.0.0",
+ "pin-project-lite",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "try-lock"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887"
+checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
+
+[[package]]
+name = "twoway"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47"
+dependencies = [
+ "memchr",
+ "unchecked-index",
+]
[[package]]
name = "typenum"
-version = "1.12.0"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
+checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
+
+[[package]]
+name = "ubyte"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe"
+dependencies = [
+ "serde",
+]
[[package]]
name = "ucd-trie"
@@ -1370,40 +1956,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
+name = "uncased"
+version = "0.9.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0"
+dependencies = [
+ "serde",
+ "version_check",
+]
+
+[[package]]
+name = "unchecked-index"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
+
+[[package]]
name = "unic-char-property"
-version = "0.7.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce36d3f7ce754afdbccccf8ff0dd0134e50fb44aaae579f96218856e9e5dbd1e"
+checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221"
dependencies = [
"unic-char-range",
]
[[package]]
name = "unic-char-range"
-version = "0.7.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9ab85fab42ad1b26cafc03bf891f69cb4d6e15f491030e89a0122197baa8ae8"
+checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc"
[[package]]
name = "unic-common"
-version = "0.7.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff8d4a7ade929ef7d971e16ced21a8cd56a63869aa6032dfb8cb083cf7d077bf"
+checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc"
[[package]]
name = "unic-segment"
-version = "0.7.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9ca47cbb09fb5fcd066b5867d11dc528302fa465277882797d6a836e1ee6f9e"
+checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23"
dependencies = [
"unic-ucd-segment",
]
[[package]]
name = "unic-ucd-segment"
-version = "0.7.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48f1a08ce0409a9e391b88d1930118eec48af12742fc538bcec55f775865776e"
+checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700"
dependencies = [
"unic-char-property",
"unic-char-range",
@@ -1412,107 +2014,111 @@ dependencies = [
[[package]]
name = "unic-ucd-version"
-version = "0.7.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf1f5e6c6c53c2d0ece4a5964bc55fcff8602153063cb4fab20958ff32998ff6"
+checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4"
dependencies = [
"unic-common",
]
[[package]]
-name = "unicase"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33"
-dependencies = [
- "version_check 0.1.5",
-]
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.4"
+name = "unicode-xid"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
-dependencies = [
- "matches",
-]
+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
-name = "unicode-normalization"
-version = "0.1.13"
+name = "vcpkg"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977"
-dependencies = [
- "tinyvec",
-]
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
-name = "unicode-xid"
-version = "0.1.0"
+name = "version_check"
+version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
+checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
[[package]]
-name = "unicode-xid"
-version = "0.2.1"
+name = "walkdir"
+version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
+checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
+dependencies = [
+ "same-file",
+ "winapi 0.3.9",
+ "winapi-util",
+]
[[package]]
-name = "universal-hash"
+name = "want"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01"
+checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
dependencies = [
- "generic-array",
- "subtle 2.2.3",
+ "log",
+ "try-lock",
]
[[package]]
-name = "url"
-version = "1.7.2"
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
-dependencies = [
- "idna",
- "matches",
- "percent-encoding 1.0.1",
-]
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
-name = "vcpkg"
-version = "0.2.10"
+name = "wasm-bindgen"
+version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
+checksum = "8ce9b1b516211d33767048e5d47fa2a381ed8b76fc48d2ce4aa39877f9f183e0"
+dependencies = [
+ "cfg-if 1.0.0",
+ "wasm-bindgen-macro",
+]
[[package]]
-name = "version_check"
-version = "0.1.5"
+name = "wasm-bindgen-backend"
+version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
+checksum = "cfe8dc78e2326ba5f845f4b5bf548401604fa20b1dd1d365fb73b6c1d6364041"
+dependencies = [
+ "bumpalo",
+ "lazy_static",
+ "log",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "wasm-bindgen-shared",
+]
[[package]]
-name = "version_check"
-version = "0.9.2"
+name = "wasm-bindgen-macro"
+version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
+checksum = "44468aa53335841d9d6b6c023eaab07c0cd4bddbcfdee3e2bb1e8d2cb8069fef"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
[[package]]
-name = "walkdir"
-version = "2.3.1"
+name = "wasm-bindgen-macro-support"
+version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
+checksum = "0195807922713af1e67dc66132c7328206ed9766af3858164fb583eedc25fbad"
dependencies = [
- "same-file",
- "winapi 0.3.9",
- "winapi-util",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
]
[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
+name = "wasm-bindgen-shared"
+version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
+checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29"
[[package]]
name = "winapi"
@@ -1572,9 +2178,3 @@ name = "yansi"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71"
-
-[[package]]
-name = "zeroize"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8"
diff --git a/Cargo.toml b/Cargo.toml
index 0e75d1f..e099f63 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,15 +8,12 @@ edition = "2018"
chrono = { version = "0.4", features = ["serde"] }
diesel = { version = "1.4.1", features = ["chrono", "postgres"] }
dotenv = "0.13.0"
-rocket = "0.4.5"
+rocket = { version = "0.5.0-rc.1", features = ["json"] }
+rocket_dyn_templates = { version = "0.1.0-rc.1", features = ["tera"] }
+rocket_sync_db_pools = { version = "0.1.0-rc.1", features = ["diesel_postgres_pool"] }
serde = { version = "1.0.115", features = ["derive"] }
serde_json = "1.0"
-[dependencies.rocket_contrib]
-version = "0.4.5"
-default-features = false
-features = ["json", "serve", "diesel_postgres_pool", "tera_templates"]
-
[dev-dependencies]
lazy_static = "~1.3.0"
serde_json = "~1.0.39"
diff --git a/src/controllers/event.rs b/src/controllers/event.rs
index 4de8740..c585933 100644
--- a/src/controllers/event.rs
+++ b/src/controllers/event.rs
@@ -23,21 +23,21 @@ use crate::{
use serde::Serialize;
use serde_json::json;
-use std::error::Error;
use std::result::Result;
use rocket::{get, post};
+use rocket::http::Status;
use rocket::response::Redirect;
-use rocket::request::{Form, FromForm};
-use rocket_contrib::templates::Template;
+use rocket::form::{Form, FromForm};
+use rocket_dyn_templates::Template;
#[get("/")]
-pub fn index(db: db::Connection) -> Result<Template, Redirect> {
+pub async fn index(db: db::Connection) -> Result<Template, Redirect> {
#[derive(Serialize)]
struct Context {
event: models::Event,
}
- let db_res = models::Event::get(&db);
+ let db_res = models::Event::get(&db).await;
match db_res {
Ok(event) => {
let ctx = Context { event };
@@ -61,8 +61,20 @@ pub struct NewEventForm {
pub description: String,
}
-#[post("/", format = "application/x-www-form-urlencoded", data = "<form>")]
-pub fn create(db: db::Connection, form: Form<NewEventForm>) -> Result<Redirect, Box<dyn Error>> {
- models::Event::create(&db, &form.name, &form.description)?;
+// fn full_uri(path: &str) -> String {
+// let config = rocket::rocket.config();
+// if Some(base_uri) = config.extras.get("base_uri") {
+// String::from(base_uri.as_str().unwrap()) + path
+// } else {
+// String::from(path)
+// }
+// }
+
+#[post("/create", format = "application/x-www-form-urlencoded", data = "<form>")]
+pub async fn create(db: db::Connection, form: Form<NewEventForm>) -> Result<Redirect, Status> {
+ models::Event::create(&db, form.name.to_owned(), form.description.to_owned())
+ .await
+ .map_err(|_| Status::InternalServerError)?;
+
Ok(Redirect::to(""))
}
diff --git a/src/controllers/film.rs b/src/controllers/film.rs
index f407a4b..4a3dfa1 100644
--- a/src/controllers/film.rs
+++ b/src/controllers/film.rs
@@ -22,37 +22,35 @@ use crate::{
};
use rocket::{get, post};
-use rocket::request::{Form, FromForm};
+use rocket::form::{Form, FromForm};
+use rocket::http::Status;
use rocket::response::Redirect;
-use rocket_contrib::{
- json::Json,
- templates::Template,
-};
+use rocket::serde::json::Json;
+use rocket_dyn_templates::Template;
use serde::Serialize;
use std::collections::HashMap;
-use std::error::Error;
use std::result::Result;
#[get("/", format = "application/json", rank = 1)]
-pub fn get_films_json(db: db::Connection) -> Json<Vec<models::Film>> {
- Json(db.get_films().unwrap())
+pub async fn get_films_json(db: db::Connection) -> Json<Vec<models::Film>> {
+ Json(db.get_films().await.unwrap())
}
#[get("/", rank = 2)]
-pub fn list_films(db: db::Connection) -> Result<Template, Box<dyn Error>> {
+pub async fn list_films(db: db::Connection) -> Result<Template, Status> {
#[derive(Serialize)]
struct Context {
films: Vec<models::Film>,
}
- let ctx = Context { films: db.get_films()? };
+ let ctx = Context { films: db.get_films().await.map_err(|_| Status::InternalServerError)? };
Ok(Template::render("film/list", &ctx))
}
#[get("/new")]
-pub fn new_film() -> Result<Template, Box<dyn Error>> {
+pub fn new_film() -> Template {
let ctx: HashMap<String, String> = HashMap::new();
- Ok(Template::render("film/new", &ctx))
+ Template::render("film/new", &ctx)
}
#[derive(FromForm)]
@@ -62,7 +60,7 @@ pub struct NewFilmForm {
}
#[post("/", format = "application/x-www-form-urlencoded", data = "<film>")]
-pub fn create_film(db: db::Connection, film: Form<NewFilmForm>) -> Result<Redirect, Box<dyn Error>> {
- db.create_film(&film.title, &film.url)?;
+pub async fn create_film(db: db::Connection, film: Form<NewFilmForm>) -> Result<Redirect, Status> {
+ db.create_film(film.title.to_owned(), film.url.to_owned()).await.map_err(|_| Status::InternalServerError)?;
Ok(Redirect::to("films"))
}
diff --git a/src/controllers/room.rs b/src/controllers/room.rs
index 9a4f4c2..08ce56d 100644
--- a/src/controllers/room.rs
+++ b/src/controllers/room.rs
@@ -23,15 +23,13 @@ use crate::{
use std::result::Result;
use rocket::{get, post};
-use rocket::request::{Form, FromForm};
+use rocket::form::{Form, FromForm};
+use rocket::http::Status;
use rocket::response::Redirect;
-use rocket_contrib::{
- json::Json,
- templates::Template,
-};
+use rocket::serde::json::Json;
+use rocket_dyn_templates::Template;
use serde::Serialize;
use std::collections::HashMap;
-use std::error::Error;
#[derive(Serialize)]
struct Context {
@@ -39,20 +37,20 @@ struct Context {
}
#[get("/", format = "application/json", rank = 1)]
-pub fn get_rooms_json(db: db::Connection) -> Json<Vec<models::Room>> {
- Json(db.get_rooms().unwrap())
+pub async fn get_rooms_json(db: db::Connection) -> Json<Vec<models::Room>> {
+ Json(db.get_rooms().await.unwrap())
}
#[get("/", rank = 2)]
-pub fn list_rooms(db: db::Connection) -> Result<Template, Box<dyn Error>> {
- let ctx = Context { rooms: db.get_rooms()? };
+pub async fn list_rooms(db: db::Connection) -> Result<Template, Status> {
+ let ctx = Context { rooms: db.get_rooms().await.map_err(|_| Status::InternalServerError)? };
Ok(Template::render("room/list", &ctx))
}
#[get("/new")]
-pub fn new_room() -> Result<Template, Box<dyn Error>> {
+pub fn new_room() -> Template {
let ctx: HashMap<String, String> = HashMap::new();
- Ok(Template::render("room/new", &ctx))
+ Template::render("room/new", &ctx)
}
#[derive(FromForm)]
@@ -61,7 +59,7 @@ pub struct NewRoomForm {
}
#[post("/", format = "application/x-www-form-urlencoded", data = "<room>")]
-pub fn create_room(db: db::Connection, room: Form<NewRoomForm>) -> Result<Redirect, Box<dyn Error>> {
- db.create_room(&room.name)?;
+pub async fn create_room(db: db::Connection, room: Form<NewRoomForm>) -> Result<Redirect, Status> {
+ db.create_room(room.name.to_owned()).await.map_err(|_| Status::InternalServerError)?;
Ok(Redirect::to("rooms"))
}
diff --git a/src/controllers/screening.rs b/src/controllers/screening.rs
index 06b0b84..5df8602 100644
--- a/src/controllers/screening.rs
+++ b/src/controllers/screening.rs
@@ -23,33 +23,32 @@ use crate::{
use std::result::Result;
use rocket::{delete, get, patch, post};
-use rocket::request::{Form, FromForm};
+use rocket::form::{Form, FromForm};
+use rocket::http::Status;
use rocket::response::Redirect;
-use rocket_contrib::{
- json::Json,
- templates::Template,
-};
+use rocket::serde::json::Json;
+use rocket_dyn_templates::Template;
use serde::Serialize;
use std::error::Error;
#[get("/", format = "application/json")]
-pub fn get_aggregated_screenings(db: db::Connection) -> Json<Vec<models::AggregatedScreening>> {
- Json(db.get_aggregated_screenings().unwrap())
+pub async fn get_aggregated_screenings(db: db::Connection) -> Json<Vec<models::AggregatedScreening>> {
+ Json(db.get_aggregated_screenings().await.unwrap())
}
#[get("/", rank = 2)]
-pub fn list_screenings(db: db::Connection) -> Result<Template, Box<dyn Error>> {
+pub async fn list_screenings(db: db::Connection) -> Result<Template, Status> {
#[derive(Serialize)]
struct Context {
screenings: Vec<models::AggregatedScreening>,
}
- let ctx = Context { screenings: db.get_aggregated_screenings()? };
+ let ctx = Context { screenings: db.get_aggregated_screenings().await.map_err(|_| Status::InternalServerError)? };
Ok(Template::render("screening/list", &ctx))
}
#[get("/new")]
-pub fn new_screening(db: db::Connection) -> Result<Template, Box<dyn Error>> {
+pub async fn new_screening(db: db::Connection) -> Result<Template, Status> {
#[derive(Serialize)]
struct Context {
rooms: Vec<models::Room>,
@@ -57,8 +56,8 @@ pub fn new_screening(db: db::Connection) -> Result<Template, Box<dyn Error>> {
}
let ctx = Context {
- rooms: db.get_rooms()?,
- films: db.get_films()?,
+ rooms: db.get_rooms().await.map_err(|_| Status::InternalServerError)?,
+ films: db.get_films().await.map_err(|_| Status::InternalServerError)?,
};
Ok(Template::render("screening/new", &ctx))
@@ -79,9 +78,9 @@ fn parse_datetime(date: &str, time: &str) -> Result<chrono::DateTime<chrono::Utc
}
#[post("/", format = "application/x-www-form-urlencoded", data = "<screening>")]
-pub fn create_screening(db: db::Connection, screening: Form<NewScreeningForm>) -> Result<Redirect, Box<dyn Error>> {
- let start_time = parse_datetime(&screening.date, &screening.start_time)?;
- let mut end_time = parse_datetime(&screening.date, &screening.end_time)?;
+pub async fn create_screening(db: db::Connection, screening: Form<NewScreeningForm>) -> Result<Redirect, Status> {
+ let start_time = parse_datetime(&screening.date, &screening.start_time).map_err(|_| Status::InternalServerError)?;
+ let mut end_time = parse_datetime(&screening.date, &screening.end_time).map_err(|_| Status::InternalServerError)?;
if end_time < start_time {
end_time = end_time + chrono::Duration::days(1);
@@ -91,13 +90,13 @@ pub fn create_screening(db: db::Connection, screening: Form<NewScreeningForm>) -
screening.room_id,
screening.film_id,
start_time,
- end_time)?;
+ end_time).await.map_err(|_| Status::InternalServerError)?;
Ok(Redirect::to("screenings"))
}
#[get("/<id>")]
-pub fn edit(db: db::Connection, id: i32) -> Result<Template, Box<dyn Error>> {
+pub async fn edit(db: db::Connection, id: i32) -> Result<Template, Status> {
#[derive(Serialize)]
struct Context {
screening: models::Screening,
@@ -106,9 +105,9 @@ pub fn edit(db: db::Connection, id: i32) -> Result<Template, Box<dyn Error>> {
}
let ctx = Context {
- screening: db.get_screening(id)?,
- rooms: db.get_rooms()?,
- films: db.get_films()?,
+ screening: db.get_screening(id).await.map_err(|_| Status::InternalServerError)?,
+ rooms: db.get_rooms().await.map_err(|_| Status::InternalServerError)?,
+ films: db.get_films().await.map_err(|_| Status::InternalServerError)?,
};
Ok(Template::render("screening/edit", &ctx))
@@ -125,9 +124,9 @@ pub struct EditScreeningForm {
}
#[patch("/", format = "application/x-www-form-urlencoded", data = "<screening>")]
-pub fn update(db: db::Connection, screening: Form<EditScreeningForm>) -> Result<Redirect, Box<dyn Error>> {
- let start_time = parse_datetime(&screening.date, &screening.start_time)?;
- let mut end_time = parse_datetime(&screening.date, &screening.end_time)?;
+pub async fn update(db: db::Connection, screening: Form<EditScreeningForm>) -> Result<Redirect, Status> {
+ let start_time = parse_datetime(&screening.date, &screening.start_time).map_err(|_| Status::InternalServerError)?;
+ let mut end_time = parse_datetime(&screening.date, &screening.end_time).map_err(|_| Status::InternalServerError)?;
if end_time < start_time {
end_time = end_time + chrono::Duration::days(1);
@@ -138,7 +137,7 @@ pub fn update(db: db::Connection, screening: Form<EditScreeningForm>) -> Result<
screening.room_id,
screening.film_id,
start_time,
- end_time)?;
+ end_time).await.map_err(|_| Status::InternalServerError)?;
Ok(Redirect::to("screenings"))
}
@@ -149,7 +148,7 @@ pub struct DeleteScreeningForm {
}
#[delete("/", format = "application/x-www-form-urlencoded", data = "<screening>")]
-pub fn delete(db: db::Connection, screening: Form<DeleteScreeningForm>) -> Result<Redirect, Box<dyn Error>> {
- db.delete_screening(screening.screening_id)?;
+pub async fn delete(db: db::Connection, screening: Form<DeleteScreeningForm>) -> Result<Redirect, Status> {
+ db.delete_screening(screening.screening_id).await.map_err(|_| Status::InternalServerError)?;
Ok(Redirect::to("screenings"))
}
diff --git a/src/db.rs b/src/db.rs
index 6bce5e8..a5341f1 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -23,16 +23,16 @@ use crate::{
use diesel::prelude::*;
-use rocket_contrib::{
+use rocket_sync_db_pools::{
database,
- databases::diesel,
+ diesel,
};
#[database("main")]
pub struct Connection(diesel::PgConnection);
impl Connection {
- pub fn create_screening(
+ pub async fn create_screening(
&self,
room_id: i32,
film_id: i32,
@@ -40,22 +40,24 @@ impl Connection {
end_time: chrono::DateTime<chrono::Utc>) -> QueryResult<usize>
{
let s = models::NewScreening { room_id, film_id, start_time, end_time };
- diesel::insert_into(screenings::table)
- .values(&s)
- .execute(&**self)
+ self.run(move |conn| {
+ diesel::insert_into(screenings::table)
+ .values(&s)
+ .execute(conn)
+ }).await
}
- pub fn create_screening_from_aggregate(
+ pub async fn create_screening_from_aggregate(
&self,
room: &models::Room,
film: &models::Film,
start_time: chrono::DateTime<chrono::Utc>,
end_time: chrono::DateTime<chrono::Utc>) -> QueryResult<usize>
{
- self.create_screening(room.id, film.id, start_time, end_time)
+ self.create_screening(room.id, film.id, start_time, end_time).await
}
- pub fn update_screening(
+ pub async fn update_screening(
&self,
screening_id: i32,
room_id: i32,
@@ -64,72 +66,95 @@ impl Connection {
end_time: chrono::DateTime<chrono::Utc>) -> QueryResult<usize>
{
let s = models::Screening { id: screening_id, film_id, room_id, start_time, end_time };
- diesel::update(screenings::table)
- .filter(screenings::id.eq(screening_id))
- .set(&s)
- .execute(&**self)
+ self.run(move |conn| {
+ diesel::update(screenings::table)
+ .filter(screenings::id.eq(screening_id))
+ .set(&s)
+ .execute(conn)
+ }).await
}
- pub fn get_screenings(&self) -> QueryResult<Vec<models::Screening>> {
- use crate::schema::screenings::dsl::*;
- screenings.load(&**self)
+ pub async fn get_screenings(&self) -> QueryResult<Vec<models::Screening>> {
+ self.run(|conn| {
+ use crate::schema::screenings::dsl::*;
+ screenings.load(conn)
+ }).await
}
- pub fn get_screening(&self, screening_id: i32) -> QueryResult<models::Screening> {
- use crate::schema::screenings::dsl::*;
- screenings.filter(id.eq(screening_id)).get_result(&**self)
+ pub async fn get_screening(&self, screening_id: i32) -> QueryResult<models::Screening> {
+ self.run(move |conn| {
+ use crate::schema::screenings::dsl::*;
+ screenings.filter(id.eq(screening_id)).get_result(conn)
+ }).await
}
- pub fn get_aggregated_screenings(&self) -> QueryResult<Vec<models::AggregatedScreening>> {
- use crate::schema::screenings::dsl::*;
- let s = screenings
- .left_join(films::table)
- .left_join(rooms::table)
- .get_results(&**self)?;
- Ok(models::AggregatedScreening::from_query(s))
+ pub async fn get_aggregated_screenings(&self) -> QueryResult<Vec<models::AggregatedScreening>> {
+ let s = self.run(|conn| {
+ use crate::schema::screenings::dsl::*;
+ screenings
+ .left_join(films::table)
+ .left_join(rooms::table)
+ .get_results(conn)
+ }).await;
+
+ Ok(models::AggregatedScreening::from_query(s?))
}
- pub fn delete_screening(&self, screening_id: i32) -> QueryResult<usize> {
- use crate::schema::screenings::dsl::*;
- diesel::delete(screenings.filter(id.eq(screening_id)))
- .execute(&**self)
+ pub async fn delete_screening(&self, screening_id: i32) -> QueryResult<usize> {
+ self.run(move |conn| {
+ use crate::schema::screenings::dsl::*;
+ diesel::delete(screenings.filter(id.eq(screening_id)))
+ .execute(conn)
+ }).await
}
- pub fn create_room(&self, room_name: &String) -> QueryResult<usize> {
- use crate::schema::rooms::dsl::*;
- diesel::insert_into(rooms)
- .values(&name.eq(room_name))
- .execute(&**self)
+ pub async fn create_room(&self, room_name: String) -> QueryResult<usize> {
+ self.run(move |conn| {
+ use crate::schema::rooms::dsl::*;
+ diesel::insert_into(rooms)
+ .values(&name.eq(room_name))
+ .execute(conn)
+ }).await
}
- pub fn get_rooms(&self) -> QueryResult<Vec<models::Room>> {
- use crate::schema::rooms::dsl::*;
- rooms.load(&**self)
+ pub async fn get_rooms(&self) -> QueryResult<Vec<models::Room>> {
+ self.run(|conn| {
+ use crate::schema::rooms::dsl::*;
+ rooms.load(conn)
+ }).await
}
- pub fn get_room_by_name(&self, room_name: &str) -> QueryResult<models::Room> {
- use crate::schema::rooms::dsl::*;
- rooms
- .filter(name.eq(&room_name))
- .get_result(&**self)
+ pub async fn get_room_by_name(&self, room_name: String) -> QueryResult<models::Room> {
+ self.run(move |conn| {
+ use crate::schema::rooms::dsl::*;
+ rooms
+ .filter(name.eq(&room_name))
+ .get_result(conn)
+ }).await
}
- pub fn create_film(&self, film_title: &str, film_url: &Option<String>) -> QueryResult<usize> {
- use crate::schema::films::dsl::*;
- diesel::insert_into(films)
- .values(&(title.eq(film_title), url.eq(film_url)))
- .execute(&**self)
+ pub async fn create_film(&self, film_title: String, film_url: Option<String>) -> QueryResult<usize> {
+ self.run(move |conn| {
+ use crate::schema::films::dsl::*;
+ diesel::insert_into(films)
+ .values(&(title.eq(film_title), url.eq(film_url)))
+ .execute(conn)
+ }).await
}
- pub fn get_films(&self) -> QueryResult<Vec<models::Film>> {
- use crate::schema::films::dsl::*;
- films.load(&**self)
+ pub async fn get_films(&self) -> QueryResult<Vec<models::Film>> {
+ self.run(|conn| {
+ use crate::schema::films::dsl::*;
+ films.load(conn)
+ }).await
}
- pub fn get_film_by_title(&self, film_title: &str) -> QueryResult<models::Film> {
- use crate::schema::films::dsl::*;
- films
- .filter(title.eq(&film_title))
- .get_result(&**self)
+ pub async fn get_film_by_title(&self, film_title: String) -> QueryResult<models::Film> {
+ self.run(move |conn| {
+ use crate::schema::films::dsl::*;
+ films
+ .filter(title.eq(&film_title))
+ .get_result(conn)
+ }).await
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 6a9e488..dae5380 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -15,39 +15,10 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate diesel;
-mod controllers;
+pub mod controllers;
pub mod db;
pub mod models;
pub mod schema;
-use crate::controllers::{event, film, room, screening};
-
-use rocket::routes;
-use std::error::Error;
-use std::result::Result;
-
-pub fn build_rocket() -> Result<rocket::Rocket, Box<dyn Error>> {
- Ok(rocket::ignite()
- .attach(db::Connection::fairing())
- .attach(rocket_contrib::templates::Template::fairing())
- .mount("/", routes![
- event::index,
- event::new,
- event::create,
- ])
- .mount("/", rocket_contrib::serve::StaticFiles::from("public/"))
- .mount("/rooms", routes![room::get_rooms_json, room::list_rooms, room::new_room, room::create_room])
- .mount("/films", routes![film::get_films_json, film::list_films, film::new_film, film::create_film])
- .mount("/screenings", routes![
- screening::get_aggregated_screenings,
- screening::list_screenings,
- screening::new_screening,
- screening::create_screening,
- screening::edit,
- screening::update,
- screening::delete,
- ]))
-}
diff --git a/src/main.rs b/src/main.rs
index fdc8ff3..2b4d01b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,11 +16,36 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#[macro_use] extern crate rocket;
+
use ramaskrik;
-use std::error::Error;
-use std::result::Result;
+use ramaskrik::controllers::{event, film, room, screening};
+use ramaskrik::db;
+
+use rocket::routes;
+use rocket::fs::FileServer;
+use rocket_dyn_templates::Template;
-fn main() -> Result<(), Box<dyn Error>> {
- ramaskrik::build_rocket()?.launch();
- Ok(())
+#[launch]
+fn rocket() -> _ {
+ rocket::build()
+ .attach(db::Connection::fairing())
+ .attach(Template::fairing())
+ .mount("/", routes![
+ event::index,
+ event::new,
+ event::create,
+ ])
+ .mount("/", FileServer::from("public/"))
+ .mount("/rooms", routes![room::get_rooms_json, room::list_rooms, room::new_room, room::create_room])
+ .mount("/films", routes![film::get_films_json, film::list_films, film::new_film, film::create_film])
+ .mount("/screenings", routes![
+ screening::get_aggregated_screenings,
+ screening::list_screenings,
+ screening::new_screening,
+ screening::create_screening,
+ screening::edit,
+ screening::update,
+ screening::delete,
+ ])
}
diff --git a/src/models/event.rs b/src/models/event.rs
index 0b31cbe..646673d 100644
--- a/src/models/event.rs
+++ b/src/models/event.rs
@@ -30,16 +30,20 @@ pub struct Event {
}
impl Event {
- pub fn get(db: &db::Connection) -> QueryResult<Event> {
- use crate::schema::event::dsl::*;
- event.first(&**db)
+ pub async fn get(db: &db::Connection) -> QueryResult<Event> {
+ db.run(|conn| {
+ use crate::schema::event::dsl::*;
+ event.first(conn)
+ }).await
}
- pub fn create(db: &db::Connection, eventname: &str, desc: &str) -> QueryResult<usize> {
- use crate::schema::event::dsl::*;
- let new_event = (name.eq(&eventname), description.eq(&desc));
- diesel::insert_into(event)
- .values(&new_event)
- .execute(&**db)
+ pub async fn create(db: &db::Connection, eventname: String, desc: String) -> QueryResult<usize> {
+ db.run(move |conn| {
+ use crate::schema::event::dsl::*;
+ let new_event = (name.eq(&eventname), description.eq(&desc));
+ diesel::insert_into(event)
+ .values(&new_event)
+ .execute(conn)
+ }).await
}
}
diff --git a/templates/event/index.tera b/templates/event/index.html.tera
index 504e2b4..504e2b4 100644
--- a/templates/event/index.tera
+++ b/templates/event/index.html.tera
diff --git a/templates/event/new.tera b/templates/event/new.html.tera
index 41a9aca..15e5334 100644
--- a/templates/event/new.tera
+++ b/templates/event/new.html.tera
@@ -6,7 +6,7 @@
<body>
<h1>Create event</h1>
- <form name="new_event_form" action="/" method="POST">
+ <form name="new_event_form" action="create" method="POST">
<label for="name">Name: </label><input name="name" type="text">
<label for="description">Description: </label>
<textarea name="description"></textarea>
diff --git a/templates/film/list.tera b/templates/film/list.html.tera
index d40b6bf..d40b6bf 100644
--- a/templates/film/list.tera
+++ b/templates/film/list.html.tera
diff --git a/templates/film/new.tera b/templates/film/new.html.tera
index 30d567e..30d567e 100644
--- a/templates/film/new.tera
+++ b/templates/film/new.html.tera
diff --git a/templates/room/list.tera b/templates/room/list.html.tera
index 977edb1..977edb1 100644
--- a/templates/room/list.tera
+++ b/templates/room/list.html.tera
diff --git a/templates/room/new.tera b/templates/room/new.html.tera
index 2bbe27c..2bbe27c 100644
--- a/templates/room/new.tera
+++ b/templates/room/new.html.tera
diff --git a/templates/screening/edit.tera b/templates/screening/edit.html.tera
index 39268fe..39268fe 100644
--- a/templates/screening/edit.tera
+++ b/templates/screening/edit.html.tera
diff --git a/templates/screening/list.tera b/templates/screening/list.html.tera
index 7112796..7112796 100644
--- a/templates/screening/list.tera
+++ b/templates/screening/list.html.tera
diff --git a/templates/screening/new.tera b/templates/screening/new.html.tera
index 0c3eb73..0c3eb73 100644
--- a/templates/screening/new.tera
+++ b/templates/screening/new.html.tera