From 31925a716b0020979525fea066d281dca92f5c1a Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Mon, 12 Jul 2021 15:45:14 +0200 Subject: [PATCH 1/4] Update dependencies --- Cargo.lock | 2002 ++++++++++++++++++++++++++++++++++------------------ Cargo.toml | 24 +- 2 files changed, 1326 insertions(+), 700 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ab19d5..2476ab3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,57 +2,82 @@ # It is not intended for manual editing. [[package]] name = "actix" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4af87564ff659dee8f9981540cac9418c45e910c8072fdedd643a262a38fcaf" +checksum = "1be241f88f3b1e7e9a3fbe3b5a8a0f6915b5a1d7ee0d9a248d3376d01068cc60" dependencies = [ - "actix-http", - "actix-rt", - "actix_derive", + "actix-rt 1.1.1", + "actix_derive 0.5.0", "bitflags", - "bytes", - "crossbeam-channel", + "bytes 0.5.6", + "crossbeam-channel 0.4.4", "derive_more", - "futures", - "lazy_static", + "futures-channel", + "futures-util", "log", + "once_cell", "parking_lot", - "pin-project", + "pin-project 0.4.28", "smallvec", - "tokio", - "tokio-util 0.2.0", + "tokio 0.2.25", + "tokio-util 0.3.1", "trust-dns-proto", "trust-dns-resolver", ] +[[package]] +name = "actix" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3720d0064a0ce5c0de7bd93bdb0a6caebab2a9b5668746145d7b3b0c5da02914" +dependencies = [ + "actix-rt 2.2.0", + "actix_derive 0.6.0", + "bitflags", + "bytes 1.0.1", + "crossbeam-channel 0.5.1", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot", + "pin-project-lite 0.2.7", + "smallvec", + "tokio 1.8.0", + "tokio-util 0.6.7", +] + [[package]] name = "actix-codec" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e55f0a5c2ca15795035d90c46bd0e73a5123b72f68f12596d6ba5282051380" +checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570" dependencies = [ "bitflags", - "bytes", + "bytes 0.5.6", "futures-core", "futures-sink", "log", - "tokio", - "tokio-util 0.2.0", + "pin-project 0.4.28", + "tokio 0.2.25", + "tokio-util 0.3.1", ] [[package]] name = "actix-connect" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95cc9569221e9802bf4c377f6c18b90ef10227d787611decf79fd47d2a8e76c" +checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc" dependencies = [ "actix-codec", - "actix-rt", - "actix-service", + "actix-rt 1.1.1", + "actix-service 1.0.6", "actix-utils", "derive_more", "either", - "futures", + "futures-util", "http", "log", "openssl", @@ -63,15 +88,14 @@ dependencies = [ [[package]] name = "actix-files" -version = "0.2.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193b22cb1f7b4ff12a4eb2415d6d19e47e44ea93e05930b30d05375ea29d3529" +checksum = "c51e8a9146c12fce92a6e4c24b8c4d9b05268130bfd8d61bc587e822c32ce689" dependencies = [ - "actix-http", - "actix-service", + "actix-service 1.0.6", "actix-web", "bitflags", - "bytes", + "bytes 0.5.6", "derive_more", "futures-core", "futures-util", @@ -84,27 +108,26 @@ dependencies = [ [[package]] name = "actix-http" -version = "1.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c16664cc4fdea8030837ad5a845eb231fb93fc3c5c171edfefb52fad92ce9019" +checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874" dependencies = [ "actix-codec", "actix-connect", - "actix-rt", - "actix-service", + "actix-rt 1.1.1", + "actix-service 1.0.6", "actix-threadpool", "actix-tls", "actix-utils", - "base64 0.11.0", + "base64 0.13.0", "bitflags", "brotli2", - "bytes", - "chrono", + "bytes 0.5.6", + "cookie", "copyless", "derive_more", "either", "encoding_rs", - "failure", "flate2", "futures-channel", "futures-core", @@ -114,27 +137,38 @@ dependencies = [ "http", "httparse", "indexmap", + "itoa", "language-tags", "lazy_static", "log", "mime", "percent-encoding", - "pin-project", - "rand", + "pin-project 1.0.7", + "rand 0.7.3", "regex", "serde", "serde_json", "serde_urlencoded", - "sha1", + "sha-1", "slab", - "time", + "time 0.2.27", ] [[package]] name = "actix-macros" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60f9ba7c4e6df97f3aacb14bb5c0cd7d98a49dcbaed0d7f292912ad9a6a3ed2" +checksum = "b4ca8ce00b267af8ccebbd647de0d61e0674b6e61185cc7a592ff88772bed655" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "actix-macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f86cd6857c135e6e9fe57b1619a88d1f94a7df34c00e11fe13e64fd3438837" dependencies = [ "quote", "syn", @@ -142,9 +176,9 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7a10ca4d94e8c8e7a87c5173aba1b97ba9a6563ca02b0e1cd23531093d3ec8" +checksum = "2ad299af73649e1fc893e333ccf86f377751eb95ff875d095131574c6f43452c" dependencies = [ "bytestring", "http", @@ -159,43 +193,65 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" dependencies = [ - "actix-macros", + "actix-macros 0.1.3", "actix-threadpool", "copyless", "futures-channel", "futures-util", "smallvec", - "tokio", + "tokio 0.2.25", +] + +[[package]] +name = "actix-rt" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d7cd957c9ed92288a7c3c96af81fa5291f65247a76a34dac7b6af74e52ba0" +dependencies = [ + "actix-macros 0.2.1", + "futures-core", + "tokio 1.8.0", ] [[package]] name = "actix-server" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d74b464215a473c973a2d7d03a69cc10f4ce1f4b38a7659c5193dc5c675630" +checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e" dependencies = [ "actix-codec", - "actix-rt", - "actix-service", + "actix-rt 1.1.1", + "actix-service 1.0.6", "actix-utils", "futures-channel", "futures-util", "log", - "mio", + "mio 0.6.23", "mio-uds", "num_cpus", "slab", - "socket2", + "socket2 0.3.19", ] [[package]] name = "actix-service" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e4fc95dfa7e24171b2d0bb46b85f8ab0e8499e4e3caec691fc4ea65c287564" +checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb" dependencies = [ "futures-util", - "pin-project", + "pin-project 0.4.28", +] + +[[package]] +name = "actix-service" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f5f9d66a8730d0fae62c26f3424f5751e5518086628a40b7ab6fca4a705034" +dependencies = [ + "futures-core", + "paste", + "pin-project-lite 0.2.7", ] [[package]] @@ -204,19 +260,19 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c" dependencies = [ - "actix-macros", - "actix-rt", + "actix-macros 0.1.3", + "actix-rt 1.1.1", "actix-server", - "actix-service", + "actix-service 1.0.6", "log", - "socket2", + "socket2 0.3.19", ] [[package]] name = "actix-threadpool" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91164716d956745c79dcea5e66d2aa04506549958accefcede5368c70f2fd4ff" +checksum = "d209f04d002854b9afd3743032a27b066158817965bf5d036824d19ac2cc0e30" dependencies = [ "derive_more", "futures-channel", @@ -229,97 +285,99 @@ dependencies = [ [[package]] name = "actix-tls" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e5b4faaf105e9a6d389c606c298dcdb033061b00d532af9df56ff3a54995a8" +checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb" dependencies = [ "actix-codec", - "actix-rt", - "actix-service", + "actix-service 1.0.6", "actix-utils", - "derive_more", - "either", - "futures", - "log", + "futures-util", "openssl", "tokio-openssl", ] [[package]] name = "actix-utils" -version = "1.0.6" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf8f5631bf01adec2267808f00e228b761c60c0584cc9fa0b5364f41d147f4e" +checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a" dependencies = [ "actix-codec", - "actix-rt", - "actix-service", + "actix-rt 1.1.1", + "actix-service 1.0.6", "bitflags", - "bytes", + "bytes 0.5.6", "either", - "futures", + "futures-channel", + "futures-sink", + "futures-util", "log", - "pin-project", + "pin-project 0.4.28", "slab", ] [[package]] name = "actix-web" -version = "2.0.0" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3158e822461040822f0dbf1735b9c2ce1f95f93b651d7a7aded00b1efbb1f635" +checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86" dependencies = [ "actix-codec", "actix-http", - "actix-macros", + "actix-macros 0.1.3", "actix-router", - "actix-rt", + "actix-rt 1.1.1", "actix-server", - "actix-service", + "actix-service 1.0.6", "actix-testing", "actix-threadpool", "actix-tls", "actix-utils", "actix-web-codegen", "awc", - "bytes", + "bytes 0.5.6", "derive_more", "encoding_rs", - "futures", + "futures-channel", + "futures-core", + "futures-util", "fxhash", "log", "mime", - "net2", "openssl", - "pin-project", + "pin-project 1.0.7", "regex", "serde", "serde_json", "serde_urlencoded", - "time", + "socket2 0.3.19", + "time 0.2.27", + "tinyvec", "url", ] [[package]] name = "actix-web-actors" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1bd41bd66c4e9b5274cec87aac30168e63d64e96fd19db38edef6b46ba2982" +checksum = "7f6edf3c2693e2a8c422800c87ee89a6a4eac7dd01109bc172a1093ce1f4f001" dependencies = [ - "actix", + "actix 0.10.0", "actix-codec", "actix-http", "actix-web", - "bytes", - "futures", - "pin-project", + "bytes 0.5.6", + "futures-channel", + "futures-core", + "pin-project 0.4.28", ] [[package]] name = "actix-web-codegen" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a71bf475cbe07281d0b3696abb48212db118e7e23219f13596ce865235ff5766" +checksum = "ad26f77093333e0e7c6ffe54ebe3582d908a104e448723eec6d43d08b07143fb" dependencies = [ "proc-macro2", "quote", @@ -338,34 +396,125 @@ dependencies = [ ] [[package]] -name = "addr2line" -version = "0.12.2" +name = "actix_derive" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602d785912f476e480434627e8732e6766b760c045bbf897d9dfaa9f4fbd399c" +checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" dependencies = [ - "gimli", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "adler32" -version = "1.1.0" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +dependencies = [ + "getrandom 0.2.3", + "once_cell", + "version_check 0.9.3", +] [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] [[package]] -name = "arc-swap" -version = "0.4.7" +name = "arrayvec" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-mutex", + "blocking", + "futures-lite", + "num_cpus", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2 0.4.0", + "waker-fn", + "winapi 0.3.9", +] + +[[package]] +name = "async-lock" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] [[package]] name = "async-native-tls" @@ -379,45 +528,62 @@ dependencies = [ "url", ] +[[package]] +name = "async-process" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" +dependencies = [ + "async-io", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "once_cell", + "signal-hook", + "winapi 0.3.9", +] + [[package]] name = "async-std" -version = "1.6.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d68a33ebc8b57800847d00787307f84a562224a14db069b0acefe4c2abbf5d" +checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" dependencies = [ - "async-task", - "crossbeam-utils", + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils 0.8.5", "futures-channel", "futures-core", "futures-io", - "futures-timer", + "futures-lite", + "gloo-timers", "kv-log-macro", "log", "memchr", "num_cpus", "once_cell", - "pin-project-lite", + "pin-project-lite 0.2.7", "pin-utils", "slab", - "smol", "wasm-bindgen-futures", ] [[package]] -name = "async-stream" -version = "0.2.1" +name = "async-task" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22068c0c19514942eefcfd4daf8976ef1aad84e61539f95cd200c35202f80af5" -dependencies = [ - "async-stream-impl", - "futures-core", -] +checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" [[package]] -name = "async-stream-impl" -version = "0.2.1" +name = "async-trait" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f9db3b38af870bf7e5cc649167533b493928e50744e2c30ae350230b414670" +checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" dependencies = [ "proc-macro2", "quote", @@ -425,21 +591,19 @@ dependencies = [ ] [[package]] -name = "async-task" -version = "3.0.0" +name = "atoi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3" +checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" +dependencies = [ + "num-traits", +] [[package]] -name = "async-trait" -version = "0.1.36" +name = "atomic-waker" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a265e3abeffdce30b2e26b7a11b222fe37c6067404001b434101457d0385eb92" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" [[package]] name = "atty" @@ -454,59 +618,52 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "awc" -version = "1.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7601d4d1d7ef2335d6597a41b5fe069f6ab799b85f53565ab390e7b7065aac5" +checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691" dependencies = [ "actix-codec", "actix-http", - "actix-rt", - "actix-service", - "base64 0.11.0", - "bytes", + "actix-rt 1.1.1", + "actix-service 1.0.6", + "base64 0.13.0", + "bytes 0.5.6", + "cfg-if 1.0.0", "derive_more", "futures-core", "log", "mime", "openssl", "percent-encoding", - "rand", + "rand 0.7.3", "serde", "serde_json", "serde_urlencoded", ] [[package]] -name = "backtrace" -version = "0.3.49" +name = "base-x" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05100821de9e028f12ae3d189176b41ee198341eb8f369956407fea2f5cc666c" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" [[package]] name = "base64" -version = "0.11.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" @@ -515,37 +672,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] -name = "block-buffer" -version = "0.7.3" +name = "bitvec" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array", + "funty", + "radium", + "tap", + "wyz", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "byte-tools", + "generic-array", ] [[package]] name = "blocking" -version = "0.4.6" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d17efb70ce4421e351d61aafd90c16a20fb5bfe339fcdc32a86816280e62ce0" +checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" dependencies = [ - "futures-channel", - "futures-util", + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", "once_cell", - "parking", - "waker-fn", ] [[package]] @@ -569,52 +727,58 @@ dependencies = [ ] [[package]] -name = "bumpalo" -version = "3.4.0" +name = "buf-min" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "fa17aa1cf56bdd6bb30518767d00e58019d326f3f05d8c3e0730b549d332ea83" +dependencies = [ + "bytes 0.5.6", +] [[package]] -name = "byte-tools" -version = "0.3.1" +name = "bumpalo" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[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 = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "118cf036fbb97d0816e3c34b2d7a1e8cfc60f68fcf63d550ddbe9bd5f59c213b" -dependencies = [ - "loom", -] +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "bytestring" -version = "0.1.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363" +checksum = "90706ba19e97b90786e19dc0d5e2abd80008d99d4c0c5d1ad0b5e72cec7c494d" dependencies = [ - "bytes", + "bytes 1.0.1", ] [[package]] name = "cache-padded" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24508e28c677875c380c20f4d28124fab6f8ed4ef929a1397d7b1a31e92f1005" +checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "cc" -version = "1.0.55" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1be3409f94d7bdceeb5f5fac551039d9b3f00e25da7a74fc4d33400a0d96368" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" [[package]] name = "cfg-if" @@ -622,34 +786,56 @@ version = "0.1.10" 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.11" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ + "libc", "num-integer", "num-traits", "serde", - "time", + "time 0.1.43", + "winapi 0.3.9", ] [[package]] -name = "cloudabi" -version = "0.0.3" +name = "concurrent-queue" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" dependencies = [ - "bitflags", + "cache-padded", ] [[package]] -name = "concurrent-queue" -version = "1.1.1" +name = "const_fn" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83c06aff61f2d899eb87c379df3cbf7876f14471dcab474e0b6dc90ab96c080" +checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" dependencies = [ - "cache-padded", + "percent-encoding", + "time 0.2.27", + "version_check 0.9.3", ] [[package]] @@ -660,9 +846,9 @@ checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" [[package]] name = "core-foundation" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ "core-foundation-sys", "libc", @@ -670,38 +856,56 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.7.0" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" + +[[package]] +name = "cpufeatures" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +dependencies = [ + "libc", +] [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "crossbeam-channel" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.7.2", "maybe-uninit", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils 0.8.5", +] + [[package]] name = "crossbeam-queue" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" dependencies = [ - "cfg-if", - "crossbeam-utils", - "maybe-uninit", + "cfg-if 1.0.0", + "crossbeam-utils 0.8.5", ] [[package]] @@ -711,26 +915,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ "autocfg", - "cfg-if", + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +dependencies = [ + "cfg-if 1.0.0", "lazy_static", ] [[package]] name = "crypto-mac" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" dependencies = [ "generic-array", "subtle", ] +[[package]] +name = "ctor" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "derive_more" -version = "0.99.8" +version = "0.99.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc655351f820d774679da6cdc23355a93de496867d8203496675162e17b1d671" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" dependencies = [ + "convert_case", "proc-macro2", "quote", "syn", @@ -738,45 +963,65 @@ dependencies = [ [[package]] name = "digest" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ "generic-array", ] [[package]] -name = "dotenv" -version = "0.15.0" +name = "dirs" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] [[package]] -name = "dtoa" -version = "0.4.6" +name = "dirs-sys" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.23" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" +checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "enum-as-inner" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4bfcfacb61d231109d1d55202c1f33263319668b168843e02ad4652725ec9c" +checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" dependencies = [ "heck", "proc-macro2", @@ -786,9 +1031,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.7.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ "atty", "humantime", @@ -798,52 +1043,39 @@ dependencies = [ ] [[package]] -name = "failure" -version = "0.1.8" +name = "event-listener" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] +checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" [[package]] -name = "failure_derive" -version = "0.1.8" +name = "fastrand" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", + "instant", ] [[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "fastrand" -version = "1.3.2" +name = "fixedbitset" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b90eb1dec02087df472ab9f0db65f27edaa654a746830042688bcc2eaf68090f" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "fixedbitset" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" [[package]] name = "flate2" -version = "1.0.14" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crc32fast", "libc", "miniz_oxide", @@ -870,6 +1102,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -886,11 +1128,17 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "futures" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" dependencies = [ "futures-channel", "futures-core", @@ -903,9 +1151,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" dependencies = [ "futures-core", "futures-sink", @@ -913,15 +1161,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" +checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" [[package]] name = "futures-executor" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" dependencies = [ "futures-core", "futures-task", @@ -930,16 +1178,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.5" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" + +[[package]] +name = "futures-lite" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.7", + "waker-fn", +] [[package]] name = "futures-macro" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" dependencies = [ + "autocfg", "proc-macro-hack", "proc-macro2", "quote", @@ -948,35 +1212,23 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" +checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" [[package]] name = "futures-task" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" -dependencies = [ - "once_cell", -] - -[[package]] -name = "futures-timer" -version = "3.0.2" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" -dependencies = [ - "gloo-timers", - "send_wrapper", -] +checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" [[package]] name = "futures-util" -version = "0.3.5" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" dependencies = [ + "autocfg", "futures-channel", "futures-core", "futures-io", @@ -984,7 +1236,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project", + "pin-project-lite 0.2.7", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1005,48 +1257,41 @@ name = "galaxy-rs" version = "1.2.1" source = "git+https://github.com/ablanleuil/galaxy-rs#5d3b6e2b7b8eef8117a7dabb389adff606a4876d" dependencies = [ - "petgraph", - "rand", -] - -[[package]] -name = "generator" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add72f17bb81521258fcc8a7a3245b1e184e916bfbe34f0ea89558f440df5c68" -dependencies = [ - "cc", - "libc", - "log", - "rustc_version", - "winapi 0.3.9", + "petgraph 0.5.1", + "rand 0.7.3", ] [[package]] name = "generic-array" -version = "0.12.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" dependencies = [ "typenum", + "version_check 0.9.3", ] [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] -name = "gimli" -version = "0.21.0" +name = "getrandom" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] [[package]] name = "gloo-timers" @@ -1063,52 +1308,71 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "futures-core", "futures-sink", "futures-util", "http", "indexmap", - "log", "slab", - "tokio", + "tokio 0.2.25", "tokio-util 0.3.1", + "tracing", + "tracing-futures", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +dependencies = [ + "hashbrown", ] [[package]] name = "heck" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.14" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hmac" -version = "0.7.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac", "digest", @@ -1127,35 +1391,32 @@ dependencies = [ [[package]] name = "http" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ - "bytes", + "bytes 1.0.1", "fnv", "itoa", ] [[package]] name = "httparse" -version = "1.3.4" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" [[package]] name = "humantime" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -1164,11 +1425,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.4.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] @@ -1186,7 +1457,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" dependencies = [ - "socket2", + "socket2 0.3.19", "widestring", "winapi 0.3.9", "winreg", @@ -1194,24 +1465,24 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" -version = "0.3.40" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonwebtoken" -version = "7.1.2" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f325ae57ddcf609f02d891486ce740f5bbd0cc3e93f9bffaacdf6594b21404" +checksum = "afabcc15e437a6484fc4f12d0fd63068fe457bf93f1c148d3d9649c60b103f32" dependencies = [ "base64 0.12.3", "pem", @@ -1225,10 +1496,10 @@ dependencies = [ name = "kalaxia-api" version = "0.1.0" dependencies = [ - "actix", + "actix 0.12.0", "actix-files", - "actix-rt", - "actix-service", + "actix-rt 2.2.0", + "actix-service 2.0.0", "actix-web", "actix-web-actors", "chrono", @@ -1238,8 +1509,8 @@ dependencies = [ "jsonwebtoken", "log", "openssl", - "petgraph", - "rand", + "petgraph 0.6.0", + "rand 0.8.4", "refinery", "serde", "serde_json", @@ -1260,9 +1531,9 @@ dependencies = [ [[package]] name = "kv-log-macro" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff57d6d215f7ca7eb35a9a64d656ba4d9d2bef114d741dc08048e75e2f5d418" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" dependencies = [ "log", ] @@ -1279,45 +1550,48 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lexical-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec", + "bitflags", + "cfg-if 1.0.0", + "ryu", + "static_assertions", +] + [[package]] name = "libc" -version = "0.2.71" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" +checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.3.4" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "loom" -version = "0.3.4" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ecc775857611e1df29abba5c41355cdf540e7e9d4acfdf0f355eefee82330b7" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if", - "generator", - "scoped-tls 0.1.2", + "cfg-if 1.0.0", + "value-bag", ] [[package]] @@ -1355,9 +1629,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "md-5" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18af3dcaf2b0219366cdb4e2af65a6101457b415c3d1a5c71dd9c2b7c77b9c8" +checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" dependencies = [ "block-buffer", "digest", @@ -1366,9 +1640,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" [[package]] name = "mime" @@ -1388,32 +1662,46 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.3.7" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ - "adler32", + "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", - "miow", + "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-uds" version = "0.6.8" @@ -1422,14 +1710,14 @@ checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" dependencies = [ "iovec", "libc", - "mio", + "mio 0.6.23", ] [[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", @@ -1437,11 +1725,20 @@ dependencies = [ "ws2_32-sys", ] +[[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 = "native-tls" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" dependencies = [ "lazy_static", "libc", @@ -1457,11 +1754,11 @@ dependencies = [ [[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", ] @@ -1476,6 +1773,28 @@ dependencies = [ "version_check 0.1.5", ] +[[package]] +name = "nom" +version = "6.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" +dependencies = [ + "bitvec", + "funty", + "lexical-core", + "memchr", + "version_check 0.9.3", +] + +[[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-bigint" version = "0.2.6" @@ -1489,9 +1808,9 @@ dependencies = [ [[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", @@ -1499,9 +1818,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", ] @@ -1516,58 +1835,52 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" - [[package]] name = "once_cell" -version = "1.4.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "opaque-debug" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.30" +version = "0.10.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" +checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" dependencies = [ "bitflags", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", - "lazy_static", "libc", + "once_cell", "openssl-sys", ] [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-src" -version = "111.10.0+1.1.1g" +version = "111.15.0+1.1.1k" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47cd4a96d49c3abf4cac8e8a80cba998a030c75608f158fb1c5f609772f265e6" +checksum = "b1a5f6ae2ac04393b217ea9f700cd04fa9bf3d93fae2872069f3d15d908af70a" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.58" +version = "0.9.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" dependencies = [ "autocfg", "cc", @@ -1579,41 +1892,48 @@ dependencies = [ [[package]] name = "parking" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4029bc3504a62d92e42f30b9095fdef73b8a0b2a06aa41ce2935143b05a1a06" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ + "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.7.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "cfg-if", - "cloudabi", + "cfg-if 1.0.0", + "instant", "libc", "redox_syscall", "smallvec", "winapi 0.3.9", ] +[[package]] +name = "paste" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" + [[package]] name = "pem" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59698ea79df9bf77104aefd39cc3ec990cb9693fb59c3b0a70ddf2646fdffb4b" +checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "once_cell", "regex", ] @@ -1630,24 +1950,54 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" dependencies = [ - "fixedbitset", + "fixedbitset 0.2.0", + "indexmap", +] + +[[package]] +name = "petgraph" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +dependencies = [ + "fixedbitset 0.4.0", "indexmap", ] [[package]] name = "pin-project" -version = "0.4.22" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +dependencies = [ + "pin-project-internal 0.4.28", +] + +[[package]] +name = "pin-project" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" +dependencies = [ + "pin-project-internal 1.0.7", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ - "pin-project-internal", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "pin-project-internal" -version = "0.4.22" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" +checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" dependencies = [ "proc-macro2", "quote", @@ -1656,9 +2006,15 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.7" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pin-utils" @@ -1668,33 +2024,46 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" + +[[package]] +name = "polling" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi 0.3.9", +] [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro-hack" -version = "0.5.16" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.18" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ "unicode-xid", ] @@ -1707,24 +2076,42 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[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", ] +[[package]] +name = "radium" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" + [[package]] name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ "libc", - "rand_chacha", - "rand_core", - "rand_hc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", ] [[package]] @@ -1734,7 +2121,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", ] [[package]] @@ -1743,7 +2140,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.3", ] [[package]] @@ -1752,20 +2158,42 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", ] [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.3", + "redox_syscall", +] [[package]] name = "refinery" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "432021bd2eb60a8851757fdd145907be1a96c70961da167a3fb362001f2f397c" +checksum = "e29bd9c881127d714f4b5b9fdd9ea7651f3dd254922e959a10f6ada620e841da" dependencies = [ "refinery-core", "refinery-macros", @@ -1773,12 +2201,12 @@ dependencies = [ [[package]] name = "refinery-core" -version = "0.3.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f670a4f4d6450ce53ecf0dd55324e0a3b684c24693e5cd68fdeca2294b875a" +checksum = "53260bc01535ea10c553ce0fc410609ba2dc0a9f4c9b4503e0af842dd4a6f89d" dependencies = [ "async-trait", - "cfg-if", + "cfg-if 1.0.0", "chrono", "lazy_static", "log", @@ -1787,14 +2215,15 @@ dependencies = [ "siphasher", "thiserror", "toml", + "url", "walkdir", ] [[package]] name = "refinery-macros" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f397c4dfbcf0b298e8b10e5702d69852829636ee121215c42efe421dd16126e1" +checksum = "7a79ff62c9b674b62c06a09cc8becf06cbafba9952afa1d8174e7e15f2c4ed43" dependencies = [ "proc-macro2", "quote", @@ -1805,21 +2234,20 @@ dependencies = [ [[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" @@ -1832,9 +2260,9 @@ dependencies = [ [[package]] name = "resolv-conf" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ "hostname", "quick-error", @@ -1842,9 +2270,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.15" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", @@ -1855,12 +2283,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1895,18 +2317,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "scoped-tls" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" - -[[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" @@ -1915,9 +2325,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "0.4.4" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" dependencies = [ "bitflags", "core-foundation", @@ -1928,9 +2338,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "0.4.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" dependencies = [ "core-foundation-sys", "libc", @@ -1951,26 +2361,20 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - [[package]] name = "serde" -version = "1.0.114" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" dependencies = [ "proc-macro2", "quote", @@ -1979,10 +2383,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.55" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ + "indexmap", "itoa", "ryu", "serde", @@ -1990,25 +2395,26 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" dependencies = [ - "dtoa", + "form_urlencoded", "itoa", + "ryu", "serde", - "url", ] [[package]] name = "sha-1" -version = "0.8.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" dependencies = [ "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", "digest", - "fake-simd", "opaque-debug", ] @@ -2020,31 +2426,41 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sha2" -version = "0.8.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", "digest", - "fake-simd", "opaque-debug", ] +[[package]] +name = "signal-hook" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ - "arc-swap", "libc", ] [[package]] name = "simple_asn1" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b25ecba7165254f0c97d6c22a64b1122a03634b18d20a34daf21e18f892e618" +checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b" dependencies = [ "chrono", "num-bigint", @@ -2053,52 +2469,40 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" +checksum = "cbce6d4507c7e4a3962091436e56e95290cb71fa302d0d270e32130b75fbff27" [[package]] name = "slab" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" [[package]] name = "smallvec" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] -name = "smol" -version = "0.1.18" +name = "socket2" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620cbb3c6e34da57d3a248cda0cd01cd5848164dc062e764e65d06fe3ea7aed5" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ - "async-task", - "blocking", - "concurrent-queue", - "fastrand", - "futures-io", - "futures-util", + "cfg-if 1.0.0", "libc", - "once_cell", - "scoped-tls 1.0.0", - "slab", - "socket2", - "wepoll-sys-stjepang", "winapi 0.3.9", ] [[package]] name = "socket2" -version = "0.3.12" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" dependencies = [ - "cfg-if", "libc", - "redox_syscall", "winapi 0.3.9", ] @@ -2110,20 +2514,22 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "sqlformat" -version = "0.1.0" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce64a4576e1720a2e511bf3ccdb8c0f6cfed0fc265bcbaa0bd369485e02c631" +checksum = "6d86e3c77ff882a828346ba401a7ef4b8e440df804491c6064fe8295765de71c" dependencies = [ "lazy_static", "maplit", + "nom 6.1.2", "regex", + "unicode_categories", ] [[package]] name = "sqlx" -version = "0.3.5" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8974cacd80085fbe49e778708d660dec6fb351604dc34c3905b26efb2803b038" +checksum = "ba82f79b31f30acebf19905bcd8b978f46891b9d0723f578447361a8910b6584" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2131,96 +2537,188 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.3.5" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ac5a436f941c42eac509471a730df5c3c58e1450e68cd39afedbd948206273" +checksum = "7f23af36748ec8ea8d49ef8499839907be41b0b1178a4e82b8cb45d29f531dc9" dependencies = [ - "async-native-tls", - "async-std", - "async-stream", - "base64 0.12.3", + "ahash", + "atoi", + "base64 0.13.0", "bitflags", "byteorder", + "bytes 1.0.1", "chrono", + "crossbeam-channel 0.5.1", "crossbeam-queue", - "crossbeam-utils", + "crossbeam-utils 0.8.5", + "dirs", + "either", "futures-channel", "futures-core", "futures-util", + "hashlink", "hex", "hmac", + "itoa", "libc", "log", "md-5", "memchr", + "once_cell", + "parking_lot", "percent-encoding", - "rand", + "rand 0.8.4", "serde", "serde_json", "sha-1", "sha2", + "smallvec", "sqlformat", - "tokio", + "sqlx-rt", + "stringprep", + "thiserror", "url", "uuid", + "whoami", ] [[package]] name = "sqlx-macros" -version = "0.3.5" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2ae78b783af5922d811b14665a5a3755e531c3087bb805cf24cf71f15e6780" +checksum = "47e4a2349d1ffd60a03ca0de3f116ba55d7f406e55a0d84c64a5590866d94c06" dependencies = [ - "async-std", "dotenv", + "either", "futures", "heck", + "once_cell", "proc-macro2", "quote", "serde_json", "sqlx-core", + "sqlx-rt", "syn", "url", ] [[package]] -name = "subtle" -version = "1.0.0" +name = "sqlx-rt" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" +checksum = "8199b421ecf3493ee9ef3e7bc90c904844cfb2ea7ea2f57347a93f52bfd3e057" +dependencies = [ + "async-native-tls", + "async-std", + "native-tls", +] [[package]] -name = "syn" -version = "1.0.33" +name = "standback" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" +dependencies = [ + "version_check 0.9.3", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[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 = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "serde", + "serde_derive", + "syn", ] [[package]] -name = "synstructure" -version = "0.12.4" +name = "stdweb-internal-macros" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +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 = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "subtle" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" + +[[package]] +name = "syn" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +dependencies = [ + "proc-macro2", + "quote", "unicode-xid", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "rand", + "rand 0.8.4", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -2228,42 +2726,33 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.20" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.20" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] - [[package]] name = "threadpool" version = "1.8.1" @@ -2283,33 +2772,98 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +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 0.9.3", + "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 = "tinyvec" -version = "0.3.3" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.2.21" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "futures-core", "iovec", "lazy_static", "libc", "memchr", - "mio", + "mio 0.6.23", "mio-uds", - "pin-project-lite", + "pin-project-lite 0.1.12", "signal-hook-registry", "slab", "winapi 0.3.9", ] +[[package]] +name = "tokio" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "570c2eb13b3ab38208130eccd41be92520388791207fde783bda7c1e8ace28d4" +dependencies = [ + "autocfg", + "bytes 1.0.1", + "libc", + "memchr", + "mio 0.7.13", + "once_cell", + "parking_lot", + "pin-project-lite 0.2.7", + "signal-hook-registry", + "winapi 0.3.9", +] + [[package]] name = "tokio-openssl" version = "0.4.0" @@ -2317,74 +2871,105 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c4b08c5f4208e699ede3df2520aca2e82401b2de33f45e96696a074480be594" dependencies = [ "openssl", - "tokio", + "tokio 0.2.25", ] [[package]] name = "tokio-util" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-core", + "futures-io", "futures-sink", "log", - "pin-project-lite", - "tokio", + "pin-project-lite 0.1.12", + "tokio 0.2.25", ] [[package]] name = "tokio-util" -version = "0.3.1" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" dependencies = [ - "bytes", + "bytes 1.0.1", "futures-core", "futures-sink", "log", - "pin-project-lite", - "tokio", + "pin-project-lite 0.2.7", + "tokio 1.8.0", ] [[package]] name = "toml" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] +[[package]] +name = "tracing" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +dependencies = [ + "cfg-if 1.0.0", + "log", + "pin-project-lite 0.2.7", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project 1.0.7", + "tracing", +] + [[package]] name = "trust-dns-proto" -version = "0.18.0-alpha.2" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f" +checksum = "1cad71a0c0d68ab9941d2fb6e82f8fb2e86d9945b94e1661dd0aaea2b88215a9" dependencies = [ "async-trait", + "cfg-if 1.0.0", "enum-as-inner", - "failure", "futures", "idna", "lazy_static", "log", - "rand", + "rand 0.7.3", "smallvec", - "socket2", - "tokio", + "thiserror", + "tokio 0.2.25", "url", ] [[package]] name = "trust-dns-resolver" -version = "0.18.0-alpha.2" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f90b1502b226f8b2514c6d5b37bafa8c200d7ca4102d57dc36ee0f3b7a04a2f" +checksum = "710f593b371175db53a26d0b38ed2978fafb9e9e8d3868b1acd753ea18df0ceb" dependencies = [ - "cfg-if", - "failure", + "cfg-if 0.1.10", "futures", "ipconfig", "lazy_static", @@ -2392,15 +2977,16 @@ dependencies = [ "lru-cache", "resolv-conf", "smallvec", - "tokio", + "thiserror", + "tokio 0.2.25", "trust-dns-proto", ] [[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 = "unicase" @@ -2408,38 +2994,44 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ - "version_check 0.9.2", + "version_check 0.9.3", ] [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "unicode_categories" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "untrusted" @@ -2449,10 +3041,11 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.1.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ + "form_urlencoded", "idna", "matches", "percent-encoding", @@ -2460,30 +3053,31 @@ dependencies = [ [[package]] name = "uuid" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "rand", + "getrandom 0.2.3", "serde", ] [[package]] name = "v_escape" -version = "0.7.4" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "660b101c07b5d0863deb9e7fb3138777e858d6d2a79f9e6049a27d1cc77c6da6" +checksum = "f3e0ab5fab1db278a9413d2ea794cb66f471f898c5b020c3c394f6447625d9d4" dependencies = [ + "buf-min", "v_escape_derive", ] [[package]] name = "v_escape_derive" -version = "0.5.6" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ca2a14bc3fc5b64d188b087a7d3a927df87b152e941ccfbc66672e20c467ae" +checksum = "c860ad1273f4eee7006cee05db20c9e60e5d24cba024a32e1094aa8e574f3668" dependencies = [ - "nom", + "nom 4.2.3", "proc-macro2", "quote", "syn", @@ -2491,19 +3085,29 @@ dependencies = [ [[package]] name = "v_htmlescape" -version = "0.4.5" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33e939c0d8cf047514fb6ba7d5aac78bc56677a6938b2ee67000b91f2e97e41" +checksum = "1f9a8af610ad6f7fc9989c9d2590d9764bc61f294884e9ee93baa58795174572" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "v_escape", ] +[[package]] +name = "value-bag" +version = "1.0.0-alpha.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" +dependencies = [ + "ctor", + "version_check 0.9.3", +] + [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" @@ -2513,21 +3117,21 @@ checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "waker-fn" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi 0.3.9", @@ -2540,21 +3144,27 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasm-bindgen" -version = "0.2.63" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.63" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" dependencies = [ "bumpalo", "lazy_static", @@ -2567,11 +3177,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.13" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64487204d863f109eb77e8462189d111f27cb5712cc9fdb3461297a76963a2f6" +checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -2579,9 +3189,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.63" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2589,9 +3199,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.63" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" dependencies = [ "proc-macro2", "quote", @@ -2602,34 +3212,44 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.63" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" [[package]] name = "web-sys" -version = "0.3.40" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" +checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "wepoll-sys-stjepang" -version = "1.0.6" +name = "wepoll-ffi" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd319e971980166b53e17b1026812ad66c6b54063be879eb182342b55284694" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" dependencies = [ "cc", ] +[[package]] +name = "whoami" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4abacf325c958dfeaf1046931d37f2a901b6dfe0968ee965a29e94c6766b2af6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "widestring" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a763e303c0e0f23b0da40888724762e802a8ffefbc22de4127ef42493c2ea68c" +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" [[package]] name = "winapi" @@ -2692,3 +3312,9 @@ dependencies = [ "winapi 0.2.8", "winapi-build", ] + +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" diff --git a/Cargo.toml b/Cargo.toml index ae36c6a..f8c423f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,24 +11,24 @@ ssl-secure = ["openssl", "actix-web/openssl"] vendored = ["openssl", "openssl/vendored"] [dependencies] -actix = "0.9.0" -actix-web = { version = "2.0" } -actix-web-actors = "2.0" -actix-rt = "1.1" -actix-files = "0.2.2" -rand = "0.7.3" +actix = "0.12" +actix-web = { version = "3.3" } +actix-web-actors = "3.0" +actix-rt = "2.2" +actix-files = "0.5" +rand = "0.8" log = "0.4.8" serde = "1.0.111" uuid = { version = "0.8", features = ["v4", "serde"] } jsonwebtoken = "7.1.1" futures = "0.3.5" -actix-service = "1.0.5" +actix-service = "2.0" serde_json = "1.0.55" openssl = { version = "0.10.30", optional = true } -env_logger = "0.7.1" -sqlx = { version = "0.3", default-features = false, features = [ "runtime-async-std", "macros", "postgres", "json", "uuid", "chrono" ] } -refinery = "0.3.0" -sqlx-core = { version = "0.3.5", default-features = false, features = [ "runtime-async-std", "postgres", "json" ] } +env_logger = "0.8" +sqlx = { version = "0.5", default-features = false, features = [ "runtime-async-std-native-tls", "macros", "postgres", "json", "uuid", "chrono" ] } +refinery = "0.5" +sqlx-core = { version = "0.5", default-features = false, features = [ "runtime-async-std-native-tls", "postgres", "json" ] } galaxy-rs = { git = "https://github.com/ablanleuil/galaxy-rs", version = "1.2.1" } -petgraph = "0.5.1" +petgraph = "0.6" chrono = { version = "0.4", features = ["serde"] } \ No newline at end of file From 5bab6cff42fd8f90804fff8df3290d346c5d4ffc Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Mon, 12 Jul 2021 15:45:55 +0200 Subject: [PATCH 2/4] Transform database schea dump in SQLX migration file --- ...210704180730_Initial_Migration_with_current_database_state.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename schema.sql => migrations/20210704180730_Initial_Migration_with_current_database_state.sql (100%) diff --git a/schema.sql b/migrations/20210704180730_Initial_Migration_with_current_database_state.sql similarity index 100% rename from schema.sql rename to migrations/20210704180730_Initial_Migration_with_current_database_state.sql From 4178126ebce0e0fb17eeb418b29071f0960a58d5 Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Mon, 12 Jul 2021 15:47:15 +0200 Subject: [PATCH 3/4] Introduce Mini map size --- src/game/game/option.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/game/game/option.rs b/src/game/game/option.rs index cb2ca4c..abff04a 100644 --- a/src/game/game/option.rs +++ b/src/game/game/option.rs @@ -17,6 +17,7 @@ pub enum GameOptionSpeed { #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum GameOptionMapSize { + Mini, VerySmall, Small, Medium, @@ -53,6 +54,14 @@ impl GameOptionSpeed { impl GameOptionMapSize { pub fn to_galaxy_builder(self) -> GalaxyBuilder { match self { + GameOptionMapSize::Mini => GalaxyBuilder::default() + .min_distance(Some(1.0)) + .cloud_population(1) + .nb_arms(1) + .nb_arm_bones(1) + .slope_factor(0.6) + .arm_slope(std::f64::consts::PI / 4.0) + .arm_width_factor(1.0 / 32.0), GameOptionMapSize::VerySmall => GalaxyBuilder::default() .min_distance(Some(1.0)) .cloud_population(1) From d5f762e4f8ccfa69366be6e19c599ece363b799b Mon Sep 17 00:00:00 2001 From: Axel Venet Date: Tue, 13 Jul 2021 13:18:31 +0200 Subject: [PATCH 4/4] WIP: refactor the codebase to fit the framework upgrade --- Cargo.lock | 150 ++++++++++++++---------------- Cargo.toml | 4 +- src/game/faction.rs | 18 ++-- src/game/fleet/combat/battle.rs | 32 +++---- src/game/fleet/combat/conquest.rs | 34 +++---- src/game/fleet/combat/round.rs | 2 +- src/game/fleet/fleet.rs | 37 ++++---- src/game/fleet/formation.rs | 2 +- src/game/fleet/squadron.rs | 49 +++++----- src/game/fleet/travel.rs | 16 ++-- src/game/game/game.rs | 30 +++--- src/game/game/option.rs | 4 +- src/game/game/server.rs | 12 ++- src/game/lobby.rs | 50 +++++----- src/game/player.rs | 24 ++--- src/game/ship/model.rs | 2 +- src/game/ship/queue.rs | 28 +++--- src/game/ship/squadron.rs | 36 +++---- src/game/system/building.rs | 30 +++--- src/game/system/system.rs | 47 +++++----- src/lib/error.rs | 2 +- src/main.rs | 4 +- src/ws/client.rs | 50 +++++----- 23 files changed, 340 insertions(+), 323 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2476ab3..eeed0d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,7 +7,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be241f88f3b1e7e9a3fbe3b5a8a0f6915b5a1d7ee0d9a248d3376d01068cc60" dependencies = [ "actix-rt 1.1.1", - "actix_derive 0.5.0", + "actix_derive", "bitflags", "bytes 0.5.6", "crossbeam-channel 0.4.4", @@ -20,35 +20,11 @@ dependencies = [ "pin-project 0.4.28", "smallvec", "tokio 0.2.25", - "tokio-util 0.3.1", + "tokio-util", "trust-dns-proto", "trust-dns-resolver", ] -[[package]] -name = "actix" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3720d0064a0ce5c0de7bd93bdb0a6caebab2a9b5668746145d7b3b0c5da02914" -dependencies = [ - "actix-rt 2.2.0", - "actix_derive 0.6.0", - "bitflags", - "bytes 1.0.1", - "crossbeam-channel 0.5.1", - "futures-core", - "futures-sink", - "futures-task", - "futures-util", - "log", - "once_cell", - "parking_lot", - "pin-project-lite 0.2.7", - "smallvec", - "tokio 1.8.0", - "tokio-util 0.6.7", -] - [[package]] name = "actix-codec" version = "0.3.0" @@ -62,7 +38,7 @@ dependencies = [ "log", "pin-project 0.4.28", "tokio 0.2.25", - "tokio-util 0.3.1", + "tokio-util", ] [[package]] @@ -210,7 +186,7 @@ checksum = "bc7d7cd957c9ed92288a7c3c96af81fa5291f65247a76a34dac7b6af74e52ba0" dependencies = [ "actix-macros 0.2.1", "futures-core", - "tokio 1.8.0", + "tokio 1.8.1", ] [[package]] @@ -363,7 +339,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6edf3c2693e2a8c422800c87ee89a6a4eac7dd01109bc172a1093ce1f4f001" dependencies = [ - "actix 0.10.0", + "actix", "actix-codec", "actix-http", "actix-web", @@ -395,17 +371,6 @@ dependencies = [ "syn", ] -[[package]] -name = "actix_derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "adler" version = "1.0.2" @@ -776,9 +741,9 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "cc" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" [[package]] name = "cfg-if" @@ -951,13 +916,14 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.14" +version = "0.99.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" +checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" dependencies = [ "convert_case", "proc-macro2", "quote", + "rustc_version 0.3.3", "syn", ] @@ -1321,7 +1287,7 @@ dependencies = [ "indexmap", "slab", "tokio 0.2.25", - "tokio-util 0.3.1", + "tokio-util", "tracing", "tracing-futures", ] @@ -1435,9 +1401,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" dependencies = [ "cfg-if 1.0.0", ] @@ -1496,7 +1462,7 @@ dependencies = [ name = "kalaxia-api" version = "0.1.0" dependencies = [ - "actix 0.12.0", + "actix", "actix-files", "actix-rt 2.2.0", "actix-service 2.0.0", @@ -1565,9 +1531,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.97" +version = "0.2.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" [[package]] name = "linked-hash-map" @@ -1944,6 +1910,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + [[package]] name = "petgraph" version = "0.5.1" @@ -2191,9 +2166,9 @@ dependencies = [ [[package]] name = "refinery" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e29bd9c881127d714f4b5b9fdd9ea7651f3dd254922e959a10f6ada620e841da" +checksum = "9f3a3d4976479c5e9a50352cf9117896b581c939e81f4169295cb9b353d30bc8" dependencies = [ "refinery-core", "refinery-macros", @@ -2201,9 +2176,9 @@ dependencies = [ [[package]] name = "refinery-core" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53260bc01535ea10c553ce0fc410609ba2dc0a9f4c9b4503e0af842dd4a6f89d" +checksum = "1eb7989daaee90c44763f644bfa2c3ce46b0a241b9966c1c2be9e65b4918815b" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -2221,9 +2196,9 @@ dependencies = [ [[package]] name = "refinery-macros" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a79ff62c9b674b62c06a09cc8becf06cbafba9952afa1d8174e7e15f2c4ed43" +checksum = "1e2d142a0c173f7e096ae1297d677cb4bb056fc80f25f31d6b0d2a82da07beee" dependencies = [ "proc-macro2", "quote", @@ -2289,7 +2264,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver", + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", ] [[package]] @@ -2352,7 +2336,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.2", ] [[package]] @@ -2361,6 +2354,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "serde" version = "1.0.126" @@ -2635,7 +2637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" dependencies = [ "discard", - "rustc_version", + "rustc_version 0.2.3", "stdweb-derive", "stdweb-internal-macros", "stdweb-internal-runtime", @@ -2689,9 +2691,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" @@ -2848,14 +2850,12 @@ dependencies = [ [[package]] name = "tokio" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570c2eb13b3ab38208130eccd41be92520388791207fde783bda7c1e8ace28d4" +checksum = "98c8b05dc14c75ea83d63dd391100353789f5f24b8b3866542a5e85c8be8e985" dependencies = [ "autocfg", - "bytes 1.0.1", "libc", - "memchr", "mio 0.7.13", "once_cell", "parking_lot", @@ -2889,20 +2889,6 @@ dependencies = [ "tokio 0.2.25", ] -[[package]] -name = "tokio-util" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" -dependencies = [ - "bytes 1.0.1", - "futures-core", - "futures-sink", - "log", - "pin-project-lite 0.2.7", - "tokio 1.8.0", -] - [[package]] name = "toml" version = "0.5.8" @@ -2988,6 +2974,12 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + [[package]] name = "unicase" version = "2.6.0" diff --git a/Cargo.toml b/Cargo.toml index f8c423f..c2b9c14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ ssl-secure = ["openssl", "actix-web/openssl"] vendored = ["openssl", "openssl/vendored"] [dependencies] -actix = "0.12" +actix = "0.10" actix-web = { version = "3.3" } actix-web-actors = "3.0" actix-rt = "2.2" @@ -27,7 +27,7 @@ serde_json = "1.0.55" openssl = { version = "0.10.30", optional = true } env_logger = "0.8" sqlx = { version = "0.5", default-features = false, features = [ "runtime-async-std-native-tls", "macros", "postgres", "json", "uuid", "chrono" ] } -refinery = "0.5" +refinery = "0.6" sqlx-core = { version = "0.5", default-features = false, features = [ "runtime-async-std-native-tls", "postgres", "json" ] } galaxy-rs = { git = "https://github.com/ablanleuil/galaxy-rs", version = "1.2.1" } petgraph = "0.6" diff --git a/src/game/faction.rs b/src/game/faction.rs index dbfb36c..af3fec2 100644 --- a/src/game/faction.rs +++ b/src/game/faction.rs @@ -8,7 +8,7 @@ use crate::{ lib::{Result, error::{ServerError, InternalError}}, }; use uuid::Uuid; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; #[derive(Serialize, Deserialize, Clone)] @@ -25,7 +25,7 @@ pub struct GameFaction{ pub victory_points: i32, } -impl<'a> FromRow<'a, PgRow<'a>> for Faction { +impl<'a> FromRow<'a, PgRow> for Faction { fn from_row(row: &PgRow) -> std::result::Result { Ok(Faction { id: row.try_get::("id").map(|id| FactionID(id as u8))?, @@ -35,7 +35,7 @@ impl<'a> FromRow<'a, PgRow<'a>> for Faction { } } -impl<'a> FromRow<'a, PgRow<'a>> for GameFaction { +impl<'a> FromRow<'a, PgRow> for GameFaction { fn from_row(row: &PgRow) -> std::result::Result { Ok(GameFaction{ faction: row.try_get::("faction_id").map(|id| FactionID(id as u8))?, @@ -99,22 +99,22 @@ impl GameFaction { .fetch_one(db_pool).await.map_err(ServerError::if_row_not_found(InternalError::FactionUnknown)) } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO game__factions(game_id, faction_id, victory_points) VALUES($1, $2, $3)") .bind(Uuid::from(self.game)) .bind(i32::from(self.faction)) .bind(self.victory_points as i16) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE game__factions SET victory_points = $1 WHERE game_id = $2 AND faction_id = $3") .bind(self.victory_points as i16) .bind(Uuid::from(self.game)) .bind(i32::from(self.faction)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } } diff --git a/src/game/fleet/combat/battle.rs b/src/game/fleet/combat/battle.rs index ee0fcad..0c30584 100644 --- a/src/game/fleet/combat/battle.rs +++ b/src/game/fleet/combat/battle.rs @@ -22,7 +22,7 @@ use crate::{ ws::protocol, }; use serde::{Deserialize, Serialize}; -use sqlx::{PgPool, PgConnection, pool::PoolConnection, postgres::PgQueryAs, Executor, Transaction, Postgres, types::Json}; +use sqlx::{PgPool, postgres::PgQueryResult, Executor, Transaction, Postgres, types::Json}; use rand::prelude::*; use uuid::Uuid; use std::time::Duration; @@ -53,9 +53,9 @@ impl From for Uuid { } impl Battle { - pub async fn insert(&self, exec: &mut E) -> Result + pub async fn insert<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO fleet__combat__battles(id, system_id, fleets, rounds, begun_at, ended_at) VALUES($1, $2, $3, $4, $5, $6)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.system)) @@ -63,19 +63,19 @@ impl Battle { .bind(Json(&self.rounds)) .bind(self.begun_at) .bind(self.ended_at) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result + pub async fn update<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE fleet__combat__battles SET fleets = $2, rounds = $3, victor_id = $4, ended_at = $5 WHERE id = $1") .bind(Uuid::from(self.id)) .bind(Json(&self.fleets)) .bind(Json(&self.rounds)) .bind(self.victor.map(i32::from)) .bind(self.ended_at) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } pub async fn get_joined_fleets(&self, db_pool: &PgPool) -> Result> { @@ -93,9 +93,9 @@ impl Battle { .map_err(ServerError::from) } - pub async fn generate_reports(&self, exec: &mut E) -> Result<()> + pub async fn generate_reports<'a, E>(&self, exec: &E) -> Result<()> where - E: Executor { + E: Executor<'a, Database = Postgres> + Copy { let mut players: HashSet = HashSet::new(); for fleets in self.fleets.values() { @@ -121,7 +121,7 @@ impl Battle { for fleet in fleets.values() { for squadron in &fleet.squadrons { if squadron.quantity > 0 { - let initiative = (f64::from(squadron.category.to_data().combat_speed) * rng.gen_range(0.5, 1.5)).round() as i32; + let initiative = (f64::from(squadron.category.to_data().combat_speed) * rng.gen_range(0.5..1.5)).round() as i32; squadrons.entry(initiative) .or_default() @@ -189,7 +189,7 @@ impl Battle { if let Some(round) = fight_round(&mut battle, round_number, new_fleets).await { battle.rounds.push(round); - battle.update(&mut &server.state.db_pool).await?; + battle.update(&server.state.db_pool).await?; round_number += 1; thread::sleep(Duration::new(1, 0)); @@ -199,20 +199,20 @@ impl Battle { } battle.victor = Some(battle.process_victor()?); battle.ended_at = Some(Time::now()); - battle.update(&mut &server.state.db_pool).await?; + battle.update(&server.state.db_pool).await?; battle.fleets = update_fleets(&battle, &server.state.db_pool).await?; Ok(battle) } } impl Report { - pub async fn insert(&self, exec: &mut E) -> Result + pub async fn insert<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> + Copy { sqlx::query("INSERT INTO fleet__combat__reports(battle_id, player_id) VALUES($1, $2)") .bind(Uuid::from(self.battle)) .bind(Uuid::from(self.player)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } } @@ -282,7 +282,7 @@ async fn update_fleets(battle: &Battle, db_pool: &PgPool) -> Result>) -> Result { +async fn update_fleet(mut fleet: Fleet, tx: &mut Transaction<'_, Postgres>) -> Result { for s in &fleet.squadrons { if s.quantity > 0 { s.update(tx).await?; diff --git a/src/game/fleet/combat/conquest.rs b/src/game/fleet/combat/conquest.rs index 9b832ad..f11af5d 100644 --- a/src/game/fleet/combat/conquest.rs +++ b/src/game/fleet/combat/conquest.rs @@ -29,7 +29,7 @@ use futures::{ }; use serde::{Deserialize, Serialize}; use uuid::Uuid; -use sqlx::{PgPool, PgConnection, pool::PoolConnection, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Transaction, Postgres, types::Json}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult}, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; const CONQUEST_DURATION_MAX: f64 = 60000.0; @@ -64,7 +64,7 @@ pub struct ConquestData { pub fleets: Vec, } -impl<'a> FromRow<'a, PgRow<'a>> for Conquest { +impl<'a> FromRow<'a, PgRow> for Conquest { fn from_row(row: &PgRow) -> std::result::Result { Ok(Conquest { id: row.try_get("id").map(ConquestID)?, @@ -93,19 +93,19 @@ impl GameServerTask for Conquest { } impl Conquest { - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO fleet__combat__conquests (id, player_id, system_id, started_at, ended_at) VALUES($1, $2, $3, $4, $5)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.player)) .bind(Uuid::from(self.system)) .bind(self.started_at) .bind(self.ended_at) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE fleet__combat__conquests SET started_at = $2, ended_at = $3, @@ -118,14 +118,14 @@ impl Conquest { .bind(self.is_successful) .bind(self.is_stopped) .bind(self.is_over) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("DELETE FROM fleet__combat__conquests WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } pub async fn find_by_system(sid: &SystemID, db_pool: &PgPool) -> Result> { @@ -165,7 +165,7 @@ impl Conquest { self.is_stopped = false; self.ended_at = ms_to_time(get_conquest_time(&fleets, self.percent, game_speed)); self.started_at = Time::now(); - self.update(&mut db_pool).await?; + self.update(db_pool).await?; Ok(()) } @@ -173,7 +173,7 @@ impl Conquest { pub async fn cancel(&mut self, server: &GameServer) -> Result<()> { self.ended_at = Time::now(); self.is_over = true; - self.update(&mut &server.state.db_pool).await?; + self.update(&server.state.db_pool).await?; let conquest = self.clone(); server.ws_broadcast(&protocol::Message::new( @@ -198,7 +198,7 @@ impl Conquest { pub async fn halt(&mut self, state: &web::Data, game_id: &GameID) -> Result<()> { self.is_stopped = true; self.percent = self.calculate_progress(); - self.update(&mut &state.db_pool).await?; + self.update(&state.db_pool).await?; state.games().get(&game_id).unwrap().do_send(cancel_task!(self)); @@ -269,7 +269,7 @@ impl Conquest { is_successful: false, is_over: false, }; - conquest.insert(&mut &server.state.db_pool).await?; + conquest.insert(&server.state.db_pool).await?; server.ws_broadcast(&protocol::Message::new( protocol::Action::ConquestStarted, @@ -287,10 +287,10 @@ impl Conquest { let fleets = system.retrieve_orbiting_fleets(&server.state.db_pool).await?.values().cloned().collect(); self.is_over = true; - self.update(&mut &server.state.db_pool).await?; + self.update(&server.state.db_pool).await?; system.player = Some(self.player.clone()); - system.update(&mut &server.state.db_pool).await?; + system.update(&server.state.db_pool).await?; server.ws_broadcast(&protocol::Message::new( protocol::Action::SystemConquerred, diff --git a/src/game/fleet/combat/round.rs b/src/game/fleet/combat/round.rs index 5f07201..26bf83c 100644 --- a/src/game/fleet/combat/round.rs +++ b/src/game/fleet/combat/round.rs @@ -147,7 +147,7 @@ fn fire(attacker: &FleetSquadron, defender: &FleetSquadron) -> (u16, u16) { let defender_model = defender.category.to_data(); let mut rng = thread_rng(); - let percent = rng.gen_range(attacker_model.precision as f64 / 2.0, attacker_model.precision as f64); + let percent = rng.gen_range((attacker_model.precision as f64 / 2.0)..(attacker_model.precision as f64)); let quantity = attacker.quantity as f64 * percent / 100.0; let damage = (quantity * attacker_model.damage as f64 * attack_coeff).ceil() as u16; diff --git a/src/game/fleet/fleet.rs b/src/game/fleet/fleet.rs index 89c3bde..a9de937 100644 --- a/src/game/fleet/fleet.rs +++ b/src/game/fleet/fleet.rs @@ -18,7 +18,7 @@ use crate::{ ws::protocol, AppState }; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{PgRow, PgQueryResult}, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; use std::collections::HashMap; @@ -48,7 +48,7 @@ impl From for Uuid { fn from(fid: FleetID) -> Self { fid.0 } } -impl<'a> FromRow<'a, PgRow<'a>> for Fleet { +impl<'a> FromRow<'a, PgRow> for Fleet { fn from_row(row: &PgRow) -> std::result::Result { Ok(Fleet { id: row.try_get("id").map(FleetID)?, @@ -97,17 +97,17 @@ impl Fleet { .map_err(ServerError::from) } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO fleet__fleets(id, system_id, player_id) VALUES($1, $2, $3)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.system)) .bind(Uuid::from(self.player)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE fleet__fleets SET system_id=$1, destination_id=$2, destination_arrival_date=$3, player_id=$4, is_destroyed=$5 WHERE id=$6") .bind(Uuid::from(self.system)) .bind(self.destination_system.map(Uuid::from)) @@ -115,14 +115,14 @@ impl Fleet { .bind(Uuid::from(self.player)) .bind(self.is_destroyed) .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("DELETE FROM fleet__fleets WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } pub fn get_strength(&self) -> u32 { @@ -136,7 +136,8 @@ impl Fleet { #[post("/")] pub async fn create_fleet(state: web::Data, info: web::Path<(GameID,SystemID)>, claims: Claims) -> Result { - let system = System::find(info.1, &state.db_pool).await?; + let (game_id, system_id) = info.into_inner(); + let system = System::find(system_id, &state.db_pool).await?; if system.player != Some(claims.pid) { return Err(InternalError::AccessDenied.into()); @@ -155,7 +156,7 @@ pub async fn create_fleet(state: web::Data, info: web::Path<(GameID,Sy tx.commit().await?; let games = state.games(); - let game = games.get(&info.0).cloned().ok_or(InternalError::GameUnknown)?; + let game = games.get(&game_id).cloned().ok_or(InternalError::GameUnknown)?; game.do_send(protocol::Message::new( protocol::Action::FleetCreated, fleet.clone(), @@ -170,10 +171,12 @@ pub async fn donate( info: web::Path<(GameID,SystemID,FleetID,)>, claims: Claims ) -> Result { + let (game_id, system_id, fleet_id) = info.into_inner(); + let (s, f, sg, p) = futures::join!( - System::find(info.1, &state.db_pool), - Fleet::find(&info.2, &state.db_pool), - FleetSquadron::find_by_fleet(info.2, &state.db_pool), + System::find(system_id, &state.db_pool), + Fleet::find(&fleet_id, &state.db_pool), + FleetSquadron::find_by_fleet(fleet_id, &state.db_pool), Player::find(claims.pid, &state.db_pool) ); let system = s?; @@ -193,7 +196,7 @@ pub async fn donate( fleet.player = other_player.id; - fleet.update(&mut &state.db_pool).await?; + fleet.update(&state.db_pool).await?; #[derive(Serialize)] pub struct FleetTransferData{ diff --git a/src/game/fleet/formation.rs b/src/game/fleet/formation.rs index af1ed20..df86447 100644 --- a/src/game/fleet/formation.rs +++ b/src/game/fleet/formation.rs @@ -4,7 +4,7 @@ use std::str::FromStr; use std::fmt; #[derive(Debug, Serialize, Deserialize, Copy, Clone, Hash, Eq, PartialEq, sqlx::Type)] -#[sqlx(rename = "VARCHAR")] +#[sqlx(type_name = "VARCHAR")] #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum FleetFormation { diff --git a/src/game/fleet/squadron.rs b/src/game/fleet/squadron.rs index 92ae76a..deea96b 100644 --- a/src/game/fleet/squadron.rs +++ b/src/game/fleet/squadron.rs @@ -28,7 +28,7 @@ use crate::{ AppState }; use futures::executor::block_on; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; use futures::join; @@ -55,7 +55,7 @@ pub struct SquadronAssignmentData { pub quantity: usize } -impl<'a> FromRow<'a, PgRow<'a>> for FleetSquadron { +impl<'a> FromRow<'a, PgRow> for FleetSquadron { fn from_row(row: &PgRow) -> std::result::Result { Ok(FleetSquadron { id: row.try_get("id").map(FleetSquadronID)?, @@ -98,46 +98,46 @@ impl FleetSquadron { .fetch_optional(db_pool).await.map_err(ServerError::from) } - pub async fn insert(&self, exec: &mut E) -> Result + pub async fn insert<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO fleet__squadrons (id, fleet_id, category, formation, quantity) VALUES($1, $2, $3, $4, $5)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.fleet)) .bind(self.category) .bind(self.formation) .bind(self.quantity as i32) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result + pub async fn update<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE fleet__squadrons SET fleet_id = $2, category = $3, formation = $4, quantity = $5 WHERE id = $1") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.fleet)) .bind(self.category) .bind(self.formation) .bind(self.quantity as i32) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("DELETE FROM fleet__squadrons WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn assign( + pub async fn assign<'a, E>( fleet_squadron: Option, fid: FleetID, formation: FleetFormation, category: ShipModelCategory, quantity: u16, - exec: &mut E + exec: E ) -> Result<()> - where E: Executor { + where E: Executor<'a, Database = Postgres> { if fleet_squadron.is_none() && quantity > 0 { let fs = FleetSquadron{ id: FleetSquadronID(Uuid::new_v4()), @@ -146,16 +146,16 @@ impl FleetSquadron { quantity: quantity as u16, category: category.clone(), }; - fs.insert(&mut *exec).await?; + fs.insert(exec).await?; } else if fleet_squadron.is_some() && quantity > 0 { let mut fs = fleet_squadron.unwrap(); if fs.category != category { return Err(InternalError::Conflict.into()); } fs.quantity = quantity; - fs.update(&mut *exec).await?; + fs.update(exec).await?; } else if fleet_squadron.is_some() { - fleet_squadron.unwrap().remove(&mut *exec).await?; + fleet_squadron.unwrap().remove(exec).await?; } Ok(()) } @@ -169,7 +169,7 @@ impl FleetSquadron { if let Some(fs) = fleet_squadron.clone() { quantity += fs.quantity; } - FleetSquadron::assign(fleet_squadron, fid, formation, category, quantity, &mut db_pool).await + FleetSquadron::assign(fleet_squadron, fid, formation, category, quantity, db_pool).await } } @@ -180,18 +180,19 @@ pub async fn assign_ships( json_data: web::Json, claims: Claims ) -> Result { + let (game_id, system_id, fleet_id) = info.into_inner(); let (g, s, f, p, sq, fs) = join!( - Game::find(info.0, &state.db_pool), - System::find(info.1, &state.db_pool), - Fleet::find(&info.2, &state.db_pool), + Game::find(game_id, &state.db_pool), + System::find(system_id, &state.db_pool), + Fleet::find(&fleet_id, &state.db_pool), Player::find(claims.pid.clone(), &state.db_pool), Squadron::find_by_system_and_category( - info.1, + system_id, json_data.category, &state.db_pool ), FleetSquadron::find_by_fleet_and_formation( - info.2, + fleet_id, json_data.formation, &state.db_pool ) @@ -259,7 +260,7 @@ pub async fn assign_ships( if let Some(sq) = ship_queue { let data = sq.clone(); - state.games().get(&info.0).unwrap().do_send(task!(sq -> move |gs: &GameServer| block_on(sq.produce(gs)))); + state.games().get(&game_id).unwrap().do_send(task!(sq -> move |gs: &GameServer| block_on(sq.produce(gs)))); return Ok(HttpResponse::Created().json(data)); } Ok(HttpResponse::NoContent().finish()) diff --git a/src/game/fleet/travel.rs b/src/game/fleet/travel.rs index 9904db7..7c99146 100644 --- a/src/game/fleet/travel.rs +++ b/src/game/fleet/travel.rs @@ -92,12 +92,14 @@ pub async fn travel( json_data: web::Json, claims: Claims ) -> Result { + let (game_id, system_id, fleet_id) = info.into_inner(); + let (ds, g, s, f, sg, p) = futures::join!( System::find(json_data.destination_system_id, &state.db_pool), - Game::find(info.0, &state.db_pool), - System::find(info.1, &state.db_pool), - Fleet::find(&info.2, &state.db_pool), - FleetSquadron::find_by_fleet(info.2, &state.db_pool), + Game::find(game_id, &state.db_pool), + System::find(system_id, &state.db_pool), + Fleet::find(&fleet_id, &state.db_pool), + FleetSquadron::find_by_fleet(fleet_id, &state.db_pool), Player::find(claims.pid, &state.db_pool) ); @@ -130,9 +132,9 @@ pub async fn travel( game.game_speed.into_travel_speed() )).into() ); - fleet.update(&mut &state.db_pool).await?; + fleet.update(&state.db_pool).await?; let games = state.games(); - let game = games.get(&info.0).cloned().ok_or(InternalError::GameUnknown)?; + let game = games.get(&game_id).cloned().ok_or(InternalError::GameUnknown)?; if let Some(mut conquest) = Conquest::find_current_by_system(&system.id, &state.db_pool).await? { let count = Fleet::count_stationed_by_system(&system.id, &state.db_pool).await?; @@ -159,7 +161,7 @@ pub async fn process_fleet_arrival(server: &GameServer, fleet_id: FleetID) -> Re }; fleet.change_system(&destination_system); - fleet.update(&mut &server.state.db_pool).await?; + fleet.update(&server.state.db_pool).await?; let outcome = resolve_arrival_outcome(&destination_system, &server, fleet, &player, system_owner).await?; diff --git a/src/game/game/game.rs b/src/game/game/game.rs index 1edef30..5a12565 100644 --- a/src/game/game/game.rs +++ b/src/game/game/game.rs @@ -22,7 +22,7 @@ use crate::{ ws::client::ClientSession, AppState, }; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Error, Executor, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Error, Executor, Postgres}; use sqlx_core::row::Row; pub const GAME_START_WALLET: usize = 200; @@ -43,7 +43,7 @@ impl From for Uuid { fn from(gid: GameID) -> Self { gid.0 } } -impl<'a> FromRow<'a, PgRow<'a>> for Game { +impl<'a> FromRow<'a, PgRow> for Game { fn from_row(row: &PgRow) -> std::result::Result { let id : Uuid = row.try_get("id")?; @@ -63,27 +63,27 @@ impl Game { .fetch_one(db_pool).await.map_err(ServerError::if_row_not_found(InternalError::GameUnknown)) } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO game__games(id, game_speed, map_size) VALUES($1, $2, $3)") .bind(Uuid::from(self.id)) .bind(self.game_speed) .bind(self.map_size) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(game: Game, db_pool: &PgPool) -> Result { + pub async fn update(game: Game, db_pool: &PgPool) -> Result { sqlx::query("UPDATE game__games SET victory_points = $2 WHERE id = $1") .bind(Uuid::from(game.id)) .bind(game.victory_points) .execute(db_pool).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("DELETE FROM game__games WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } } @@ -113,15 +113,19 @@ pub async fn create_game(lobby: &Lobby, state: web::Data, clients: Has } #[get("/{id}/players/")] -pub async fn get_players(state: web::Data, info: web::Path<(GameID,)>) -> Result { - Ok(HttpResponse::Ok().json(Player::find_by_game(info.0, &state.db_pool).await?)) +pub async fn get_players(state: web::Data, info: web::Path) -> Result { + let game_id = info.into_inner(); + + Ok(HttpResponse::Ok().json(Player::find_by_game(game_id, &state.db_pool).await?)) } #[delete("/{id}/players/")] -pub async fn leave_game(state:web::Data, claims: Claims, info: web::Path<(GameID,)>) +pub async fn leave_game(state:web::Data, claims: Claims, info: web::Path) -> Result { - let game = Game::find(info.0, &state.db_pool).await?; + let game_id = info.into_inner(); + + let game = Game::find(game_id, &state.db_pool).await?; let mut player = Player::find(claims.pid, &state.db_pool).await?; if player.game != Some(game.id) { diff --git a/src/game/game/option.rs b/src/game/game/option.rs index abff04a..865cc09 100644 --- a/src/game/game/option.rs +++ b/src/game/game/option.rs @@ -3,7 +3,7 @@ use galaxy_rs::GalaxyBuilder; #[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, sqlx::Type)] -#[sqlx(rename = "VARCHAR")] +#[sqlx(type_name = "VARCHAR")] #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum GameOptionSpeed { @@ -13,7 +13,7 @@ pub enum GameOptionSpeed { } #[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, sqlx::Type)] -#[sqlx(rename = "VARCHAR")] +#[sqlx(type_name = "VARCHAR")] #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum GameOptionMapSize { diff --git a/src/game/game/server.rs b/src/game/game/server.rs index 8f96989..b02542a 100644 --- a/src/game/game/server.rs +++ b/src/game/game/server.rs @@ -307,11 +307,13 @@ impl GameServer { self.tasks.insert(task_name.clone(), ctx.run_later( duration, move |this, ctx| { - let result = closure(this, ctx).map_err(ServerError::from); - this.remove_task(&task_name); - if result.is_err() { - println!("{:?}", result.err()); - } + Arbiter::spawn_fn(move || { + let result = closure(this, ctx).map_err(ServerError::from); + this.remove_task(&task_name); + if result.is_err() { + println!("{:?}", result.err()); + } + }); } )); } diff --git a/src/game/lobby.rs b/src/game/lobby.rs index 7ecc243..7035161 100644 --- a/src/game/lobby.rs +++ b/src/game/lobby.rs @@ -18,7 +18,7 @@ use crate::{ }; use std::sync::{Arc, RwLock}; use std::collections::{HashMap}; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; use futures::join; @@ -48,7 +48,7 @@ pub struct LobbyOptionsPatch { pub game_speed: Option, } -impl<'a> FromRow<'a, PgRow<'a>> for Lobby { +impl<'a> FromRow<'a, PgRow> for Lobby { fn from_row(row: &PgRow) -> std::result::Result { let id : Uuid = row.try_get("id")?; let owner_id : Uuid = row.try_get("owner_id")?; @@ -118,31 +118,31 @@ impl Lobby { .fetch_one(db_pool).await.map_err(ServerError::if_row_not_found(InternalError::LobbyUnknown)) } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO lobby__lobbies(id, owner_id, game_speed, map_size) VALUES($1, $2, $3, $4)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.owner)) .bind(self.game_speed) .bind(self.map_size) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE lobby__lobbies SET owner_id = $2, game_speed = $3, map_size = $4 WHERE id = $1") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.owner)) .bind(self.game_speed) .bind(self.map_size) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor{ + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres>{ sqlx::query("DELETE FROM lobby__lobbies WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } } @@ -237,8 +237,9 @@ pub async fn get_lobbies(state: web::Data) -> Result { #[allow(clippy::eval_order_dependence)] #[get("/{id}")] -pub async fn get_lobby(state: web::Data, info: web::Path<(LobbyID,)>) -> Result { - let lobby = Lobby::find(info.0, &state.db_pool).await?; +pub async fn get_lobby(state: web::Data, info: web::Path) -> Result { + let lobby_id = info.into_inner(); + let lobby = Lobby::find(lobby_id, &state.db_pool).await?; #[derive(Serialize)] struct LobbyData{ @@ -303,22 +304,20 @@ pub async fn create_lobby(state: web::Data, claims: Claims) -> Result< #[patch("/{id}/")] pub async fn update_lobby_options( state: web::Data, - info: web::Path<(LobbyID,)>, + info: web::Path, data: web::Json, claims: Claims ) -> Result { - let mut lobby = Lobby::find(info.0, &state.db_pool).await?; + let lobby_id = info.into_inner(); + let mut lobby = Lobby::find(lobby_id, &state.db_pool).await?; if lobby.owner != claims.pid.clone() { return Err(InternalError::AccessDenied.into()); } - println!("{:?}", data); lobby.game_speed = data.game_speed.clone().map_or(GameOptionSpeed::Medium, |gs| gs); lobby.map_size = data.map_size.clone().map_or(GameOptionMapSize::Medium, |ms| ms); - println!("{:?}", lobby.game_speed.clone()); - println!("{:?}", lobby.map_size.clone()); let mut tx = state.db_pool.begin().await?; lobby.update(&mut tx).await?; @@ -335,12 +334,13 @@ pub async fn update_lobby_options( } #[post("/{id}/launch/")] -pub async fn launch_game(state: web::Data, claims:Claims, info: web::Path<(LobbyID,)>) +pub async fn launch_game(state: web::Data, claims:Claims, info: web::Path) -> Result { + let lobby_id = info.into_inner(); let mut games = state.games_mut(); - let lobby = Lobby::find(info.0, &state.db_pool).await?; + let lobby = Lobby::find(lobby_id, &state.db_pool).await?; if lobby.owner != claims.pid.clone() { return Err(InternalError::AccessDenied.into()); @@ -367,10 +367,11 @@ pub async fn launch_game(state: web::Data, claims:Claims, info: web::P } #[delete("/{id}/players/")] -pub async fn leave_lobby(state:web::Data, claims:Claims, info:web::Path<(LobbyID,)>) +pub async fn leave_lobby(state:web::Data, claims:Claims, info:web::Path) -> Result { - let mut lobby = Lobby::find(info.0, &state.db_pool).await?; + let lobby_id = info.into_inner(); + let mut lobby = Lobby::find(lobby_id, &state.db_pool).await?; let mut player = Player::find(claims.pid, &state.db_pool).await?; if player.lobby != Some(lobby.id) { @@ -396,10 +397,11 @@ pub async fn leave_lobby(state:web::Data, claims:Claims, info:web::Pat } #[post("/{id}/players/")] -pub async fn join_lobby(info: web::Path<(LobbyID,)>, state: web::Data, claims: Claims) +pub async fn join_lobby(info: web::Path, state: web::Data, claims: Claims) -> Result { - let lobby = Lobby::find(info.0, &state.db_pool).await?; + let lobby_id = info.into_inner(); + let lobby = Lobby::find(lobby_id, &state.db_pool).await?; let mut player = Player::find(claims.pid, &state.db_pool).await?; if player.lobby.is_some() { return Err(InternalError::AlreadyInLobby.into()); diff --git a/src/game/player.rs b/src/game/player.rs index 79dc4a1..cf68d5b 100644 --- a/src/game/player.rs +++ b/src/game/player.rs @@ -1,7 +1,7 @@ use actix_web::{web, get, patch, post, HttpResponse}; use serde::{Deserialize, Serialize}; use uuid::Uuid; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, Executor, FromRow, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, Executor, FromRow, Error, Postgres}; use sqlx_core::row::Row; use crate::{ AppState, @@ -47,7 +47,7 @@ impl From for Uuid { fn from(pid: PlayerID) -> Self { pid.0 } } -impl<'a> FromRow<'a, PgRow<'a>> for Player { +impl<'a> FromRow<'a, PgRow> for Player { fn from_row(row: &PgRow) -> std::result::Result { Ok(Player { id: row.try_get::("id").ok().map(PlayerID).unwrap(), @@ -144,25 +144,25 @@ impl Player { .map_err(ServerError::from) } - pub async fn transfer_from_lobby_to_game(lid: &LobbyID, gid: &GameID, db_pool: &PgPool) -> std::result::Result { + pub async fn transfer_from_lobby_to_game(lid: &LobbyID, gid: &GameID, db_pool: &PgPool) -> std::result::Result { sqlx::query("UPDATE player__players SET lobby_id = NULL, game_id = $1 WHERE lobby_id = $2") .bind(Uuid::from(gid.clone())) .bind(Uuid::from(lid.clone())) .execute(db_pool).await } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO player__players (id, wallet, is_ready, is_connected) VALUES($1, $2, $3, $4)") .bind(Uuid::from(self.id)) .bind(self.wallet as i32) .bind(self.ready) .bind(self.is_connected) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE player__players SET username = $1, game_id = $2, lobby_id = $3, @@ -179,7 +179,7 @@ impl Player { .bind(self.ready) .bind(self.is_connected) .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } } @@ -281,15 +281,17 @@ pub async fn update_current_player(state: web::Data, json_data: web::J pub async fn get_faction_members(state: web::Data, info: web::Path<(GameID, FactionID)>) -> Result { - Ok(HttpResponse::Ok().json(Player::find_by_game_and_faction(info.0, info.1, &state.db_pool).await?)) + let (game_id, faction_id) = info.into_inner(); + Ok(HttpResponse::Ok().json(Player::find_by_game_and_faction(game_id, faction_id, &state.db_pool).await?)) } #[patch("/players/{player_id}/money/")] pub async fn transfer_money(state: web::Data, info: web::Path<(GameID, FactionID, PlayerID)>, data: web::Json, claims: auth::Claims) -> Result { + let (game_id, faction_id, player_id) = info.into_inner(); let mut current_player = Player::find(claims.pid, &state.db_pool).await?; - let mut other_player = Player::find(info.2, &state.db_pool).await?; + let mut other_player = Player::find(player_id, &state.db_pool).await?; if current_player.faction != other_player.faction { return Err(InternalError::Conflict.into()); diff --git a/src/game/ship/model.rs b/src/game/ship/model.rs index e1ca95c..b8ce721 100644 --- a/src/game/ship/model.rs +++ b/src/game/ship/model.rs @@ -22,7 +22,7 @@ pub struct ShipModel { } #[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, sqlx::Type)] -#[sqlx(rename = "VARCHAR")] +#[sqlx(type_name = "VARCHAR")] #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum ShipModelCategory { diff --git a/src/game/ship/queue.rs b/src/game/ship/queue.rs index d36f132..4e9d835 100644 --- a/src/game/ship/queue.rs +++ b/src/game/ship/queue.rs @@ -1,5 +1,5 @@ use actix_web::{get, post, web, HttpResponse}; -use sqlx::{PgPool, Executor, postgres::{PgRow, PgQueryAs}, FromRow, Error, Postgres}; +use sqlx::{PgPool, Executor, postgres::{ PgRow, PgQueryResult }, FromRow, Error, Postgres}; use sqlx_core::row::Row; use serde::{Serialize, Deserialize}; use uuid::Uuid; @@ -63,7 +63,7 @@ impl From for Uuid { fn from(sqid: ShipQueueID) -> Self { sqid.0 } } -impl<'a> FromRow<'a, PgRow<'a>> for ShipQueue { +impl<'a> FromRow<'a, PgRow> for ShipQueue { fn from_row(row: &PgRow) -> std::result::Result { Ok(ShipQueue { id: row.try_get("id").map(ShipQueueID)?, @@ -115,8 +115,8 @@ impl ShipQueue { Ok(count.0 as u32) } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO system__ship_queues (id, system_id, category, quantity, assigned_fleet, created_at, started_at, finished_at) VALUES($1, $2, $3, $4, $5, $6, $7, $8)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.system)) @@ -126,14 +126,14 @@ impl ShipQueue { .bind(self.created_at) .bind(self.started_at) .bind(self.finished_at) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("DELETE FROM system__ship_queues WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } pub async fn produce(&self, server: &GameServer) -> Result<()> { @@ -227,9 +227,11 @@ pub async fn add_ship_queue( json_data: web::Json, claims: Claims ) -> Result { + let (game_id, system_id) = info.into_inner(); + let (g, s, p) = join!( - Game::find(info.0, &state.db_pool), - System::find(info.1, &state.db_pool), + Game::find(game_id, &state.db_pool), + System::find(system_id, &state.db_pool), Player::find(claims.pid, &state.db_pool), ); let game = g?; @@ -251,7 +253,7 @@ pub async fn add_ship_queue( ).await?.unwrap(); let sq = ship_queue.clone(); - state.games().get(&info.0).unwrap().do_send(task!(sq -> move |gs: &GameServer| block_on(sq.produce(gs)))); + state.games().get(&game_id).unwrap().do_send(task!(sq -> move |gs: &GameServer| block_on(sq.produce(gs)))); Ok(HttpResponse::Created().json(ship_queue)) } @@ -260,8 +262,10 @@ pub async fn add_ship_queue( pub async fn get_ship_queues(state: web::Data, info: web::Path<(GameID, SystemID)>, claims: Claims) -> Result { + let (_, system_id) = info.into_inner(); + let (s, p) = futures::join!( - System::find(info.1, &state.db_pool), + System::find(system_id, &state.db_pool), Player::find(claims.pid, &state.db_pool), ); let system = s?; diff --git a/src/game/ship/squadron.rs b/src/game/ship/squadron.rs index 9cec98f..e69a86b 100644 --- a/src/game/ship/squadron.rs +++ b/src/game/ship/squadron.rs @@ -1,5 +1,5 @@ use actix_web::{get, web, HttpResponse}; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; use serde::{Serialize, Deserialize}; use uuid::Uuid; @@ -33,7 +33,7 @@ impl From for Uuid { fn from(sid: SquadronID) -> Self { sid.0 } } -impl<'a> FromRow<'a, PgRow<'a>> for Squadron { +impl<'a> FromRow<'a, PgRow> for Squadron { fn from_row(row: &PgRow) -> std::result::Result { Ok(Squadron { id: row.try_get("id").map(SquadronID)?, @@ -58,49 +58,49 @@ impl Squadron { .fetch_optional(db_pool).await.map_err(ServerError::from) } - pub async fn insert(&self, exec: &mut E) -> Result + pub async fn insert<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO map__system_squadrons (id, system_id, category, quantity) VALUES($1, $2, $3, $4)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.system)) .bind(self.category) .bind(self.quantity as i32) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result + pub async fn update<'a, E>(&self, exec: E) -> Result where - E: Executor { + E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE map__system_squadrons SET system_id = $2, category = $3, quantity = $4 WHERE id = $1") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.system)) .bind(self.category) .bind(self.quantity as i32) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn remove(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn remove<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("DELETE FROM map__system_squadrons WHERE id = $1") .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn assign( + pub async fn assign<'a, E>( squadron: Option, system: SystemID, category: ShipModelCategory, quantity: i32, - exec: &mut E + exec: E ) -> Result<()> - where E: Executor { + where E: Executor<'a, Database = Postgres> { if let Some(mut s) = squadron { if quantity > 0 { s.quantity = quantity as u16; - s.update(&mut *exec).await?; + s.update(exec).await?; } else { - s.remove(&mut *exec).await?; + s.remove(exec).await?; } } else if quantity > 0 { let s = Squadron{ @@ -109,7 +109,7 @@ impl Squadron { quantity: quantity as u16, category, }; - s.insert(&mut *exec).await?; + s.insert(exec).await?; } Ok(()) } @@ -123,7 +123,7 @@ impl Squadron { if let Some(sq) = squadron.clone() { quantity += sq.quantity as i32; } - Squadron::assign(squadron, system, category, quantity, &mut db_pool).await + Squadron::assign(squadron, system, category, quantity, db_pool).await } } diff --git a/src/game/system/building.rs b/src/game/system/building.rs index 1567b35..405c0f1 100644 --- a/src/game/system/building.rs +++ b/src/game/system/building.rs @@ -2,7 +2,7 @@ use actix_web::{get, post, web, HttpResponse}; use serde::{Serialize, Deserialize}; use uuid::Uuid; use chrono::{DateTime, Duration, Utc}; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; use futures::executor::block_on; use crate::{ @@ -37,7 +37,7 @@ pub struct Building { } #[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, sqlx::Type)] -#[sqlx(rename = "VARCHAR")] +#[sqlx(type_name = "VARCHAR")] #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum BuildingStatus { @@ -46,7 +46,7 @@ pub enum BuildingStatus { } #[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, sqlx::Type)] -#[sqlx(rename = "VARCHAR")] +#[sqlx(type_name = "VARCHAR")] #[sqlx(rename_all = "snake_case")] #[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))] pub enum BuildingKind { @@ -84,7 +84,7 @@ impl GameServerTask for Building { } } -impl<'a> FromRow<'a, PgRow<'a>> for Building { +impl<'a> FromRow<'a, PgRow> for Building { fn from_row(row: &PgRow) -> std::result::Result { Ok(Building { id: row.try_get("id").map(BuildingID)?, @@ -174,8 +174,8 @@ impl Building { Ok(count.0 as u32) } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO map__system_buildings (id, system_id, kind, status, created_at, built_at) VALUES($1, $2, $3, $4, $5, $6)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.system)) @@ -183,15 +183,15 @@ impl Building { .bind(self.status) .bind(self.created_at) .bind(self.built_at) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE map__system_buildings SET status = $2 WHERE id = $1") .bind(Uuid::from(self.id)) .bind(self.status) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } async fn construct(&mut self, server: &GameServer) -> Result<()> { @@ -229,8 +229,10 @@ pub async fn create_building( ) -> Result { - let game = Game::find(info.0, &state.db_pool).await?; - let system = System::find(info.1.clone(), &state.db_pool).await?; + let (game_id, system_id) = info.into_inner(); + + let game = Game::find(game_id, &state.db_pool).await?; + let system = System::find(system_id.clone(), &state.db_pool).await?; let mut player = Player::find(claims.pid, &state.db_pool).await?; if system.player != Some(player.id) { @@ -245,7 +247,7 @@ pub async fn create_building( let building_data = data.kind.to_data(); player.spend(building_data.cost as usize)?; - let building = Building::new(info.1.clone(), data.kind, building_data, game.game_speed); + let building = Building::new(system_id.clone(), data.kind, building_data, game.game_speed); let mut tx = state.db_pool.begin().await?; player.update(&mut tx).await?; @@ -253,7 +255,7 @@ pub async fn create_building( tx.commit().await?; let mut b = building.clone(); - state.games().get(&info.0).unwrap().do_send(task!(building -> move |gs: &GameServer| block_on(b.construct(gs)))); + state.games().get(&game_id).unwrap().do_send(task!(building -> move |gs: &GameServer| block_on(b.construct(gs)))); Ok(HttpResponse::Created().json(building)) } diff --git a/src/game/system/system.rs b/src/game/system/system.rs index 1b96482..585532f 100644 --- a/src/game/system/system.rs +++ b/src/game/system/system.rs @@ -26,7 +26,7 @@ use crate::{ }, }; use galaxy_rs::{Point, DataPoint}; -use sqlx::{PgPool, postgres::{PgRow, PgQueryAs}, FromRow, Executor, Error, Postgres}; +use sqlx::{PgPool, postgres::{ PgRow, PgQueryResult }, FromRow, Executor, Error, Postgres}; use sqlx_core::row::Row; use rand::{prelude::*, distributions::{Distribution, Uniform}}; @@ -102,7 +102,7 @@ impl From for i16 { } } -impl<'a> FromRow<'a, PgRow<'a>> for Coordinates { +impl<'a> FromRow<'a, PgRow> for Coordinates { fn from_row(row: &PgRow) -> std::result::Result { Ok(Coordinates{ x: row.try_get("coord_x")?, @@ -111,7 +111,7 @@ impl<'a> FromRow<'a, PgRow<'a>> for Coordinates { } } -impl<'a> FromRow<'a, PgRow<'a>> for System { +impl<'a> FromRow<'a, PgRow> for System { fn from_row(row: &PgRow) -> std::result::Result { let id : Uuid = row.try_get("id")?; let game_id : Uuid = row.try_get("game_id")?; @@ -131,7 +131,7 @@ impl<'a> FromRow<'a, PgRow<'a>> for System { } } -impl<'a> FromRow<'a, PgRow<'a>> for SystemKind { +impl<'a> FromRow<'a, PgRow> for SystemKind { fn from_row(row: &PgRow) -> std::result::Result { Ok(match row.try_get::("kind")? { 1 => Self::BaseSystem, @@ -141,7 +141,7 @@ impl<'a> FromRow<'a, PgRow<'a>> for SystemKind { } } -impl<'a> FromRow<'a, PgRow<'a>> for SystemDominion { +impl<'a> FromRow<'a, PgRow> for SystemDominion { fn from_row(row: &PgRow) -> std::result::Result { let id : i32 = row.try_get("faction_id")?; @@ -198,8 +198,8 @@ impl System { count.0 as u32 } - pub async fn insert(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn insert<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("INSERT INTO map__systems (id, game_id, player_id, kind, coord_x, coord_y, is_unreachable) VALUES($1, $2, $3, $4, $5, $6, $7)") .bind(Uuid::from(self.id)) .bind(Uuid::from(self.game)) @@ -208,16 +208,16 @@ impl System { .bind(self.coordinates.x) .bind(self.coordinates.y) .bind(self.unreachable) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } - pub async fn update(&self, exec: &mut E) -> Result - where E: Executor { + pub async fn update<'a, E>(&self, exec: E) -> Result + where E: Executor<'a, Database = Postgres> { sqlx::query("UPDATE map__systems SET player_id = $1, is_unreachable = $2 WHERE id = $3") .bind(self.player.map(Uuid::from)) .bind(self.unreachable) .bind(Uuid::from(self.id)) - .execute(&mut *exec).await.map_err(ServerError::from) + .execute(exec).await.map_err(ServerError::from) } pub async fn insert_all<'a, I>(systems_iter: I, pool:&PgPool) -> Result @@ -272,8 +272,8 @@ pub async fn generate_systems(gid: GameID, map_size: GameOptionMapSize) -> Resul if nb_victory_systems == 0 { // We ensure that there is at least on victory system let coord_random = Coordinates::polar( - rng.gen_range(0_f64, 0.2_f64.powi(2)).sqrt(), - rng.gen_range( - std::f64::consts::PI, std::f64::consts::PI) + rng.gen_range(0_f64..0.2_f64.powi(2)).sqrt(), + rng.gen_range((- std::f64::consts::PI)..std::f64::consts::PI) ); system_list.iter_mut() .map(|el| { @@ -303,7 +303,7 @@ fn generate_system(gid: &GameID, x: f64, y: f64, probability: f64, rng: &mut imp } fn generate_system_kind(x: f64, y: f64, probability: f64, rng: &mut impl rand::Rng) -> (SystemKind, f64) { - let rand: f64 = rng.gen_range((x.abs() + y.abs()) / 2.0, x.abs() + y.abs() + 1.0); + let rand: f64 = rng.gen_range(((x.abs() + y.abs()) / 2.0)..(x.abs() + y.abs() + 1.0)); if rand <= probability { return (SystemKind::VictorySystem, 0.5); @@ -377,16 +377,17 @@ pub async fn assign_systems(players: &Vec, galaxy:&mut Vec) -> R #[allow(clippy::needless_lifetimes)] // false positive async fn find_place<'a>( - Coordinates { x:xmin, y:ymin }: &Coordinates, - Coordinates { x:xmax, y:ymax }: &Coordinates, + Coordinates { x: xmin, y: ymin }: &Coordinates, + Coordinates { x: xmax, y: ymax }: &Coordinates, galaxy: & 'a mut Vec ) -> Option<& 'a mut System> { let mut rng = thread_rng(); - let final_x: f64 = rng.gen_range(xmin, xmax); - let final_y: f64 = rng.gen_range(ymin, ymax); - let final_coord = Coordinates { x:final_x, y:final_y }; + let final_coord = Coordinates { + x: *rng.gen_range(xmin..xmax), + y: *rng.gen_range(ymin..ymax) + }; let mut min_dist = std::f64::MAX; let mut idx = None; @@ -403,14 +404,16 @@ async fn find_place<'a>( #[allow(clippy::eval_order_dependence)] // false positive ? #[get("/")] -pub async fn get_systems(state: web::Data, info: web::Path<(GameID,)>, pagination: web::Query) +pub async fn get_systems(state: web::Data, info: web::Path, pagination: web::Query) -> Result { + let game_id = info.into_inner(); + Ok(new_paginated_response( pagination.limit, pagination.page, - System::count(info.0.clone(), &state.db_pool).await.into(), - System::find_all(&info.0, pagination.limit, (pagination.page - 1) * pagination.limit, &state.db_pool).await?, + System::count(game_id.clone(), &state.db_pool).await.into(), + System::find_all(&game_id, pagination.limit, (pagination.page - 1) * pagination.limit, &state.db_pool).await?, )) } diff --git a/src/lib/error.rs b/src/lib/error.rs index 3e2f36b..c3cb96d 100644 --- a/src/lib/error.rs +++ b/src/lib/error.rs @@ -3,7 +3,7 @@ use actix_web::{http::StatusCode, Error as ActixWebError, ResponseError, HttpRes use actix_web_actors::ws::ProtocolError; use actix::MailboxError; use std::fmt::{Display, Formatter, Error as FmtError}; -use sqlx_core::{Error as SqlxError}; +use sqlx_core::error::{Error as SqlxError}; use serde::Serialize; use uuid::{Error as UuidError}; diff --git a/src/main.rs b/src/main.rs index 8b7c178..23af56a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -209,7 +209,7 @@ fn config(cfg: &mut web::ServiceConfig) { .service(player::login) .service(web::resource("/ws/").to(ws::client::entrypoint)); } - + fn get_env(key: &str, default: &str) -> String { match env::var_os(key) { Some(val) => val.into_string().unwrap(), @@ -218,7 +218,7 @@ fn get_env(key: &str, default: &str) -> String { } async fn create_pool() -> Result { - let result = PgPool::new(&format!( + let result = PgPool::connect(&format!( "postgres://{}:{}@{}/{}", &get_env("POSTGRES_USER", "kalaxia"), &get_env("POSTGRES_PASSWORD", "kalaxia"), diff --git a/src/ws/client.rs b/src/ws/client.rs index ab57fd4..c549929 100644 --- a/src/ws/client.rs +++ b/src/ws/client.rs @@ -1,5 +1,5 @@ use std::time::{Duration, Instant}; -use actix::*; +use actix::{Actor, Handler, StreamHandler, Running}; use actix_web::{web, HttpRequest, HttpResponse}; use actix_web_actors::ws; use futures::executor::block_on; @@ -98,6 +98,30 @@ impl ClientSession { } } +impl ClientSession { + /// helper method that sends ping to client every second. + /// + /// also this method checks heartbeats from client + #[allow(clippy::unused_self)] + fn hb(&self, ctx: &mut ws::WebsocketContext) { + ctx.run_interval(HEARTBEAT_INTERVAL, |act, ctx| { + // check client heartbeats + if Instant::now().duration_since(act.hb) > CLIENT_TIMEOUT { + // heartbeat timed out + println!("Websocket Client heartbeat failed, disconnecting!"); + + // stop actor + ctx.stop(); + + // don't try to send a ping + return; + } + + ctx.ping(b""); + }); + } +} + impl Actor for ClientSession { type Context = ws::WebsocketContext; @@ -166,27 +190,3 @@ impl StreamHandler> for Clie }; } } - -impl ClientSession { - /// helper method that sends ping to client every second. - /// - /// also this method checks heartbeats from client - #[allow(clippy::unused_self)] - fn hb(&self, ctx: &mut ws::WebsocketContext) { - ctx.run_interval(HEARTBEAT_INTERVAL, |act, ctx| { - // check client heartbeats - if Instant::now().duration_since(act.hb) > CLIENT_TIMEOUT { - // heartbeat timed out - println!("Websocket Client heartbeat failed, disconnecting!"); - - // stop actor - ctx.stop(); - - // don't try to send a ping - return; - } - - ctx.ping(b""); - }); - } -}