Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • stephen/cat-disruptor-6500
  • roygbyte/cat-disruptor-6500
  • tinyconan/cat-disruptor-6500
3 results
Show changes
Commits on Source (25)
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "adler"
......@@ -35,8 +35,8 @@ version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
......@@ -49,11 +49,11 @@ dependencies = [
"futures-io",
"futures-util",
"log",
"pin-project-lite 0.2.9",
"tokio 1.21.2",
"tokio-rustls",
"pin-project-lite",
"tokio",
"tokio-rustls 0.23.4",
"tungstenite",
"webpki-roots",
"webpki-roots 0.22.5",
]
[[package]]
......@@ -68,6 +68,12 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "bigdecimal"
version = "0.1.2"
......@@ -85,6 +91,12 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "block-buffer"
version = "0.10.3"
......@@ -106,12 +118,6 @@ version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "bytes"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "bytes"
version = "1.2.1"
......@@ -120,22 +126,23 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db"
[[package]]
name = "cat-disruptor-6500"
version = "0.1.2"
version = "0.3.0"
dependencies = [
"anyhow",
"bigdecimal",
"diesel",
"dotenv",
"itertools",
"ollama-rs",
"phf",
"png",
"rand 0.8.5",
"reqwest 0.10.10",
"reqwest",
"rusttype",
"serde",
"serde_json",
"serenity",
"tokio 1.21.2",
"tokio",
"toml",
"xbasic",
]
......@@ -146,12 +153,6 @@ version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cfg-if"
version = "1.0.0"
......@@ -189,7 +190,7 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
......@@ -202,6 +203,55 @@ dependencies = [
"typenum",
]
[[package]]
name = "darling"
version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989"
dependencies = [
"darling_core",
"darling_macro",
]
[[package]]
name = "darling_core"
version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5"
dependencies = [
"fnv",
"ident_case",
"proc-macro2 1.0.76",
"quote 1.0.35",
"strsim",
"syn 2.0.48",
]
[[package]]
name = "darling_macro"
version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core",
"quote 1.0.35",
"syn 2.0.48",
]
[[package]]
name = "dashmap"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
dependencies = [
"cfg-if",
"hashbrown 0.12.3",
"lock_api",
"once_cell",
"parking_lot_core",
"serde",
]
[[package]]
name = "deflate"
version = "0.8.6"
......@@ -214,14 +264,15 @@ dependencies = [
[[package]]
name = "diesel"
version = "1.4.8"
version = "2.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d"
checksum = "ccf1bedf64cdb9643204a36dd15b19a6ce8e7aa7f7b105868e9f1fad5ffa7d12"
dependencies = [
"bigdecimal",
"bitflags",
"bitflags 2.6.0",
"byteorder",
"diesel_derives",
"itoa",
"num-bigint",
"num-integer",
"num-traits 0.2.15",
......@@ -230,13 +281,24 @@ dependencies = [
[[package]]
name = "diesel_derives"
version = "1.4.1"
version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"syn 1.0.102",
"diesel_table_macro_syntax",
"dsl_auto_type",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 2.0.48",
]
[[package]]
name = "diesel_table_macro_syntax"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25"
dependencies = [
"syn 2.0.48",
]
[[package]]
......@@ -255,6 +317,20 @@ version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dsl_auto_type"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5d9abe6314103864cc2d8901b7ae224e0ab1a103a0a416661b4097b0779b607"
dependencies = [
"darling",
"either",
"heck",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 2.0.48",
]
[[package]]
name = "either"
version = "1.8.0"
......@@ -267,9 +343,15 @@ version = "0.8.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
name = "equivalent"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "fastrand"
version = "1.8.0"
......@@ -319,22 +401,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
dependencies = [
"bitflags",
"fuchsia-zircon-sys",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "futures"
version = "0.3.24"
......@@ -371,6 +437,17 @@ version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68"
[[package]]
name = "futures-macro"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17"
dependencies = [
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
[[package]]
name = "futures-sink"
version = "0.3.24"
......@@ -392,10 +469,11 @@ dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project-lite 0.2.9",
"pin-project-lite",
"pin-utils",
"slab",
]
......@@ -416,7 +494,7 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
......@@ -427,18 +505,18 @@ version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
name = "h2"
version = "0.2.7"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535"
checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9"
dependencies = [
"bytes 0.5.6",
"bytes",
"fnv",
"futures-core",
"futures-sink",
......@@ -446,36 +524,28 @@ dependencies = [
"http",
"indexmap",
"slab",
"tokio 0.2.25",
"tokio-util 0.3.1",
"tokio",
"tokio-util",
"tracing",
"tracing-futures",
]
[[package]]
name = "h2"
version = "0.3.14"
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be"
dependencies = [
"bytes 1.2.1",
"fnv",
"futures-core",
"futures-sink",
"futures-util",
"http",
"indexmap",
"slab",
"tokio 1.21.2",
"tokio-util 0.7.4",
"tracing",
]
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
version = "0.12.3"
version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
......@@ -492,19 +562,9 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [
"bytes 1.2.1",
"bytes",
"fnv",
"itoa 1.0.4",
]
[[package]]
name = "http-body"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b"
dependencies = [
"bytes 0.5.6",
"http",
"itoa",
]
[[package]]
......@@ -513,9 +573,9 @@ version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
"bytes 1.2.1",
"bytes",
"http",
"pin-project-lite 0.2.9",
"pin-project-lite",
]
[[package]]
......@@ -524,12 +584,6 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "httpdate"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47"
[[package]]
name = "httpdate"
version = "1.0.2"
......@@ -538,77 +592,60 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "hyper"
version = "0.13.10"
version = "0.14.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb"
checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
dependencies = [
"bytes 0.5.6",
"bytes",
"futures-channel",
"futures-core",
"futures-util",
"h2 0.2.7",
"h2",
"http",
"http-body 0.3.1",
"http-body",
"httparse",
"httpdate 0.3.2",
"itoa 0.4.8",
"pin-project",
"socket2 0.3.19",
"tokio 0.2.25",
"httpdate",
"itoa",
"pin-project-lite",
"socket2",
"tokio",
"tower-service",
"tracing",
"want",
]
[[package]]
name = "hyper"
version = "0.14.20"
name = "hyper-rustls"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac"
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [
"bytes 1.2.1",
"futures-channel",
"futures-core",
"futures-util",
"h2 0.3.14",
"http",
"http-body 0.4.5",
"httparse",
"httpdate 1.0.2",
"itoa 1.0.4",
"pin-project-lite 0.2.9",
"socket2 0.4.7",
"tokio 1.21.2",
"tower-service",
"tracing",
"want",
"hyper",
"rustls 0.21.7",
"tokio",
"tokio-rustls 0.24.1",
]
[[package]]
name = "hyper-rustls"
version = "0.23.0"
name = "hyper-tls"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"http",
"hyper 0.14.20",
"rustls",
"tokio 1.21.2",
"tokio-rustls",
"bytes",
"hyper",
"native-tls",
"tokio",
"tokio-native-tls",
]
[[package]]
name = "hyper-tls"
version = "0.4.3"
name = "ident_case"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed"
dependencies = [
"bytes 0.5.6",
"hyper 0.13.10",
"native-tls",
"tokio 0.2.25",
"tokio-tls",
]
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
......@@ -622,12 +659,12 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.9.1"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
dependencies = [
"autocfg",
"hashbrown",
"equivalent",
"hashbrown 0.14.3",
]
[[package]]
......@@ -636,16 +673,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
"cfg-if 1.0.0",
]
[[package]]
name = "iovec"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
dependencies = [
"libc",
"cfg-if",
]
[[package]]
......@@ -663,12 +691,6 @@ dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "itoa"
version = "1.0.4"
......@@ -684,16 +706,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
dependencies = [
"winapi 0.2.8",
"winapi-build",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
......@@ -722,7 +734,7 @@ version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
......@@ -765,25 +777,6 @@ dependencies = [
"adler",
]
[[package]]
name = "mio"
version = "0.6.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4"
dependencies = [
"cfg-if 0.1.10",
"fuchsia-zircon",
"fuchsia-zircon-sys",
"iovec",
"kernel32-sys",
"libc",
"log",
"miow",
"net2",
"slab",
"winapi 0.2.8",
]
[[package]]
name = "mio"
version = "0.8.4"
......@@ -793,19 +786,7 @@ dependencies = [
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys",
]
[[package]]
name = "miow"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
dependencies = [
"kernel32-sys",
"net2",
"winapi 0.2.8",
"ws2_32-sys",
"windows-sys 0.36.1",
]
[[package]]
......@@ -826,17 +807,6 @@ dependencies = [
"tempfile",
]
[[package]]
name = "net2"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae"
dependencies = [
"cfg-if 0.1.10",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "nodrop"
version = "0.1.14"
......@@ -912,6 +882,17 @@ dependencies = [
"libc",
]
[[package]]
name = "ollama-rs"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb57402b9ed5e0c239459eafba74c28306687354bf6876a6c9e9ce7de39867f"
dependencies = [
"reqwest",
"serde",
"serde_json",
]
[[package]]
name = "once_cell"
version = "1.15.0"
......@@ -924,8 +905,8 @@ version = "0.10.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13"
dependencies = [
"bitflags",
"cfg-if 1.0.0",
"bitflags 1.3.2",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
......@@ -939,8 +920,8 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
......@@ -998,11 +979,11 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-sys",
"windows-sys 0.36.1",
]
[[package]]
......@@ -1041,8 +1022,8 @@ dependencies = [
"phf_generator",
"phf_shared",
"proc-macro-hack",
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
......@@ -1055,32 +1036,6 @@ dependencies = [
"siphasher",
]
[[package]]
name = "pin-project"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"syn 1.0.102",
]
[[package]]
name = "pin-project-lite"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777"
[[package]]
name = "pin-project-lite"
version = "0.2.9"
......@@ -1105,7 +1060,7 @@ version = "0.16.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"crc32fast",
"deflate",
"miniz_oxide 0.3.7",
......@@ -1143,9 +1098,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.46"
version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
dependencies = [
"unicode-ident",
]
......@@ -1161,11 +1116,11 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.21"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2 1.0.46",
"proc-macro2 1.0.76",
]
[[package]]
......@@ -1255,7 +1210,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
......@@ -1264,84 +1219,53 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
"winapi 0.3.9",
"winapi",
]
[[package]]
name = "reqwest"
version = "0.10.10"
version = "0.11.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c"
checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
dependencies = [
"base64",
"bytes 0.5.6",
"base64 0.21.7",
"bytes",
"encoding_rs",
"futures-core",
"futures-util",
"h2",
"http",
"http-body 0.3.1",
"hyper 0.13.10",
"http-body",
"hyper",
"hyper-rustls",
"hyper-tls",
"ipnet",
"js-sys",
"lazy_static",
"log",
"mime",
"mime_guess",
"native-tls",
"percent-encoding",
"pin-project-lite 0.2.9",
"serde",
"serde_json",
"serde_urlencoded",
"tokio 0.2.25",
"tokio-tls",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"winreg 0.7.0",
]
[[package]]
name = "reqwest"
version = "0.11.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc"
dependencies = [
"base64",
"bytes 1.2.1",
"encoding_rs",
"futures-core",
"futures-util",
"h2 0.3.14",
"http",
"http-body 0.4.5",
"hyper 0.14.20",
"hyper-rustls",
"ipnet",
"js-sys",
"log",
"mime",
"mime_guess",
"once_cell",
"percent-encoding",
"pin-project-lite 0.2.9",
"rustls",
"pin-project-lite",
"rustls 0.21.7",
"rustls-pemfile",
"serde",
"serde_json",
"serde_urlencoded",
"tokio 1.21.2",
"tokio-rustls",
"tokio-util 0.7.4",
"system-configuration",
"tokio",
"tokio-native-tls",
"tokio-rustls 0.24.1",
"tokio-util",
"tower-service",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
"wasm-streams",
"web-sys",
"webpki-roots",
"winreg 0.10.1",
"webpki-roots 0.25.3",
"winreg",
]
[[package]]
......@@ -1356,7 +1280,7 @@ dependencies = [
"spin",
"untrusted",
"web-sys",
"winapi 0.3.9",
"winapi",
]
[[package]]
......@@ -1371,13 +1295,35 @@ dependencies = [
"webpki",
]
[[package]]
name = "rustls"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8"
dependencies = [
"log",
"ring",
"rustls-webpki",
"sct",
]
[[package]]
name = "rustls-pemfile"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
dependencies = [
"base64",
"base64 0.13.0",
]
[[package]]
name = "rustls-webpki"
version = "0.101.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe"
dependencies = [
"ring",
"untrusted",
]
[[package]]
......@@ -1404,7 +1350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
dependencies = [
"lazy_static",
"windows-sys",
"windows-sys 0.36.1",
]
[[package]]
......@@ -1429,7 +1375,7 @@ version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation",
"core-foundation-sys",
"libc",
......@@ -1448,9 +1394,9 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.145"
version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b"
checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
dependencies = [
"serde_derive",
]
......@@ -1467,22 +1413,22 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.145"
version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c"
checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"syn 1.0.102",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 2.0.48",
]
[[package]]
name = "serde_json"
version = "1.0.85"
version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
dependencies = [
"itoa 1.0.4",
"itoa",
"ryu",
"serde",
]
......@@ -1494,7 +1440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa 1.0.4",
"itoa",
"ryu",
"serde",
]
......@@ -1507,22 +1453,24 @@ checksum = "82fd5e7b5858ad96e99d440138f34f5b98e1b959ebcd3a1036203b30e78eb788"
dependencies = [
"async-trait",
"async-tungstenite",
"base64",
"bitflags",
"bytes 1.2.1",
"cfg-if 1.0.0",
"base64 0.13.0",
"bitflags 1.3.2",
"bytes",
"cfg-if",
"dashmap",
"flate2",
"futures",
"mime",
"mime_guess",
"parking_lot",
"percent-encoding",
"reqwest 0.11.12",
"reqwest",
"serde",
"serde-value",
"serde_json",
"static_assertions",
"time",
"tokio 1.21.2",
"tokio",
"tracing",
"typemap_rev",
"url",
......@@ -1534,7 +1482,7 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"cpufeatures",
"digest",
]
......@@ -1569,17 +1517,6 @@ version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "socket2"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
dependencies = [
"cfg-if 1.0.0",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "socket2"
version = "0.4.7"
......@@ -1587,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
dependencies = [
"libc",
"winapi 0.3.9",
"winapi",
]
[[package]]
......@@ -1620,6 +1557,12 @@ dependencies = [
"byteorder",
]
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "0.15.44"
......@@ -1637,23 +1580,55 @@ version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
dependencies = [
"proc-macro2 1.0.76",
"quote 1.0.35",
"unicode-ident",
]
[[package]]
name = "system-configuration"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"system-configuration-sys",
]
[[package]]
name = "system-configuration-sys"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "tempfile"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"fastrand",
"libc",
"redox_syscall",
"remove_dir_all",
"winapi 0.3.9",
"winapi",
]
[[package]]
......@@ -1671,8 +1646,8 @@ version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
......@@ -1682,7 +1657,7 @@ version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c"
dependencies = [
"itoa 1.0.4",
"itoa",
"libc",
"num_threads",
"serde",
......@@ -1703,23 +1678,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "0.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092"
dependencies = [
"bytes 0.5.6",
"fnv",
"futures-core",
"iovec",
"lazy_static",
"memchr",
"mio 0.6.23",
"pin-project-lite 0.1.12",
"slab",
]
[[package]]
name = "tokio"
version = "1.21.2"
......@@ -1727,17 +1685,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099"
dependencies = [
"autocfg",
"bytes 1.2.1",
"bytes",
"libc",
"memchr",
"mio 0.8.4",
"mio",
"num_cpus",
"parking_lot",
"pin-project-lite 0.2.9",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.4.7",
"socket2",
"tokio-macros",
"winapi 0.3.9",
"winapi",
]
[[package]]
......@@ -1746,44 +1704,40 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
[[package]]
name = "tokio-rustls"
version = "0.23.4"
name = "tokio-native-tls"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
dependencies = [
"rustls",
"tokio 1.21.2",
"webpki",
"native-tls",
"tokio",
]
[[package]]
name = "tokio-tls"
version = "0.3.1"
name = "tokio-rustls"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
dependencies = [
"native-tls",
"tokio 0.2.25",
"rustls 0.20.6",
"tokio",
"webpki",
]
[[package]]
name = "tokio-util"
version = "0.3.1"
name = "tokio-rustls"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
"bytes 0.5.6",
"futures-core",
"futures-sink",
"log",
"pin-project-lite 0.1.12",
"tokio 0.2.25",
"rustls 0.21.7",
"tokio",
]
[[package]]
......@@ -1792,11 +1746,11 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
dependencies = [
"bytes 1.2.1",
"bytes",
"futures-core",
"futures-sink",
"pin-project-lite 0.2.9",
"tokio 1.21.2",
"pin-project-lite",
"tokio",
"tracing",
]
......@@ -1821,9 +1775,9 @@ version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"log",
"pin-project-lite 0.2.9",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
......@@ -1834,8 +1788,8 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
]
......@@ -1848,16 +1802,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "tracing-futures"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
dependencies = [
"pin-project",
"tracing",
]
[[package]]
name = "try-lock"
version = "0.2.3"
......@@ -1870,14 +1814,14 @@ version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0"
dependencies = [
"base64",
"base64 0.13.0",
"byteorder",
"bytes 1.2.1",
"bytes",
"http",
"httparse",
"log",
"rand 0.8.5",
"rustls",
"rustls 0.20.6",
"sha-1",
"thiserror",
"url",
......@@ -2012,9 +1956,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [
"cfg-if 1.0.0",
"serde",
"serde_json",
"cfg-if",
"wasm-bindgen-macro",
]
......@@ -2027,8 +1969,8 @@ dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
"wasm-bindgen-shared",
]
......@@ -2039,7 +1981,7 @@ version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
......@@ -2051,7 +1993,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
dependencies = [
"quote 1.0.21",
"quote 1.0.35",
"wasm-bindgen-macro-support",
]
......@@ -2061,8 +2003,8 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [
"proc-macro2 1.0.46",
"quote 1.0.21",
"proc-macro2 1.0.76",
"quote 1.0.35",
"syn 1.0.102",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
......@@ -2074,6 +2016,19 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
[[package]]
name = "wasm-streams"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7"
dependencies = [
"futures-util",
"js-sys",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "web-sys"
version = "0.3.60"
......@@ -2104,10 +2059,10 @@ dependencies = [
]
[[package]]
name = "winapi"
version = "0.2.8"
name = "webpki-roots"
version = "0.25.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
[[package]]
name = "winapi"
......@@ -2119,12 +2074,6 @@ dependencies = [
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
......@@ -2143,37 +2092,97 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_msvc",
"windows_aarch64_msvc 0.36.1",
"windows_i686_gnu 0.36.1",
"windows_i686_msvc 0.36.1",
"windows_x86_64_gnu 0.36.1",
"windows_x86_64_msvc 0.36.1",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.48.5",
"windows_i686_gnu 0.48.5",
"windows_i686_msvc 0.48.5",
"windows_x86_64_gnu 0.48.5",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.48.5",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_i686_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_x86_64_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_msvc"
version = "0.36.1"
......@@ -2181,31 +2190,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "winreg"
version = "0.7.0"
name = "windows_x86_64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
dependencies = [
"winapi 0.3.9",
]
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "winreg"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "ws2_32-sys"
version = "0.2.1"
version = "0.50.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [
"winapi 0.2.8",
"winapi-build",
"cfg-if",
"windows-sys 0.48.0",
]
[[package]]
......
[package]
name = "cat-disruptor-6500"
version = "0.1.2"
authors = ["Stephen <stephen@stephendownward.ca>"]
version = "0.3.0"
authors = ["Stephen <wemaster@scd31.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serenity = {version = "0.11", default-features = false, features = ["client", "gateway", "rustls_backend", "model", "static_assertions"] }
serenity = {version = "0.11", default-features = false, features = ["client", "gateway", "rustls_backend", "model", "static_assertions", "cache"] }
tokio = {version = "1.21", features = ["full", "time"] }
phf = { version = "0.8", features = ["macros"] }
toml = "0.5"
serde = { version = "1.0", features = ["derive"] }
xbasic = "0.3.1"
png = "0.16"
diesel = { version = "1.4", features = ["postgres", "numeric"] }
diesel = { version = "2", features = ["postgres", "numeric"] }
dotenv = "0.15.0"
bigdecimal = "0.1.2"
reqwest = { version = "0.10", features = ["json"] }
reqwest = { version = "0.11", features = ["json"] }
serde_json = "1.0"
rusttype = "0.4.3"
rand = "0.8"
itertools = "0.10"
anyhow = "1.0"
ollama-rs = "0.1.5"
......@@ -2,6 +2,21 @@
A Discord bot that reacts to certain messages with certain emojis. More importantly, it also lets you write code!
## Install
- Setup PostgreSQL
- Install via package manager `apt install postgresql`. Also get `libpq-dev` if you don't want a miserable life.
- `sudo su postgres` to login to default database user
- `createdb cat_disruptor_6500` to create the database
- `psql` and then `ALTER ROLE postgres WITH PASSWORD 'password';`
- Update the database environment variable (`DATABASE_URL=postgres://postgres:password@localhost/cat_disruptor_6500`)
- Create a new [Discord bot](https://discord.com/developers/applications)
- Enable all Privileged Gateway Intents
- Go to OAuth2 menu, URL generator, click "bot" and "administrator"
- Open link to add bot to server
- Create a `config.toml` file in project directory with `token=<your discord bot token>`
- Generate token on your bot page
## Commands:
!START - start the interpreter
......@@ -70,4 +85,4 @@ The interpreter can execute arbitrary code safely - it includes CPU and memory l
It even does graphics!
![Example session](example.png)
![Example session](example.png)
use serde::Deserialize;
use std::fs;
use std::{
collections::{HashMap, HashSet},
fs,
};
#[derive(Deserialize)]
pub struct LlamaConfig {
pub(crate) address: String,
pub(crate) port: u16,
pub(crate) models: HashMap<String, String>,
#[serde(default)]
pub(crate) channels: HashSet<u64>,
}
#[derive(Deserialize)]
pub struct Config {
pub(crate) token: String,
pub(crate) llama: Option<LlamaConfig>,
}
pub fn get_conf() -> Config {
......
use super::LineHandler;
use crate::config::LlamaConfig;
use anyhow::{anyhow, Context as _};
use itertools::Itertools;
use ollama_rs::{
generation::completion::{request::GenerationRequest, GenerationContext},
Ollama,
};
use serenity::{
async_trait,
http::Typing,
model::prelude::{Message, MessageId},
prelude::*,
};
use std::{
collections::{HashMap, HashSet},
sync::Arc,
};
pub struct LlamaHandler {
ollama: Ollama,
contexts: Arc<Mutex<HashMap<MessageId, (String, GenerationContext)>>>,
models: HashMap<String, String>,
channel_ids: HashSet<u64>,
}
impl LlamaHandler {
pub fn new(lc: LlamaConfig) -> Self {
Self {
ollama: Ollama::new(lc.address, lc.port),
contexts: Arc::new(Mutex::new(HashMap::new())),
models: lc.models,
channel_ids: lc.channels,
}
}
async fn call_llama(
&self,
model: &str,
prompt: &str,
context: Option<GenerationContext>,
) -> anyhow::Result<(String, GenerationContext)> {
let mut req = GenerationRequest::new(model.into(), prompt.into());
if let Some(c) = context {
req = req.context(c);
}
let resp = self
.ollama
.generate(req)
.await
.map_err(|x| anyhow!("{x}"))?;
let context = resp.final_data.context("Missing final data")?.context;
Ok((resp.response, context))
}
async fn list_models(&self, ctx: &Context, msg: &Message) {
let people = self
.models
.keys()
.map(|x| format!("- {x}"))
.collect::<Vec<_>>()
.join("\n");
if let Err(e) = msg
.reply(ctx, format!("Available models:\n{}", people))
.await
{
eprintln!("{:?}", e);
}
}
async fn reply(
&self,
ctx: &Context,
msg: &Message,
model: &str,
txt: &str,
context: Option<GenerationContext>,
) {
if txt.is_empty() {
return;
}
let _typing = try_or_log(|| Typing::start(ctx.http.clone(), msg.channel_id.0));
let resp = self.call_llama(model, txt, context).await;
let (resp, context) =
match resp {
Ok(x) => x,
Err(e) => {
eprintln!("{e:?}");
if let Err(e) = msg.reply(
ctx,
"Could not communicate with Llama. Check the server logs for more details.",
).await {
eprintln!("{e:?}");
};
return;
}
};
let resp = if resp.is_empty() {
"[No response]"
} else {
&resp
};
// discord messages are limited to 2000 codepoints
let chunks: Vec<String> = resp
.chars()
.chunks(2000)
.into_iter()
.map(|chunk| chunk.collect())
.collect();
let mut first = true;
for chunk in chunks {
let res = if first {
msg.reply(ctx, chunk).await
} else {
msg.channel_id.send_message(ctx, |m| m.content(chunk)).await
};
first = false;
match res {
Ok(x) => {
self.contexts
.lock()
.await
.insert(x.id, (model.to_string(), context.clone()));
}
Err(e) => {
eprintln!("{e:?}");
break;
}
}
}
}
}
#[async_trait]
impl LineHandler for LlamaHandler {
async fn message(&self, ctx: &Context, msg: &Message) {
if !self.channel_ids.contains(&msg.channel_id.0) {
return;
}
let txt = &msg.content;
if let Some(p) = &msg.referenced_message {
let x = {
let l = self.contexts.lock().await;
l.get(&p.id).cloned()
};
if let Some((model, context)) = x {
self.reply(ctx, msg, &model, txt, Some(context)).await;
return;
}
}
if txt.starts_with("!people") {
self.list_models(ctx, msg).await;
return;
}
for (name, model) in &self.models {
if let Some(txt) = txt.strip_prefix(&format!("!{name} ")) {
self.reply(ctx, msg, model, txt, None).await;
return;
}
}
}
}
fn try_or_log<T, E: std::fmt::Debug, F: Fn() -> Result<T, E>>(f: F) -> Result<T, E> {
let res = f();
if let Err(e) = res.as_ref() {
eprintln!("{e:?}");
}
res
}
mod horse;
mod joke;
mod llama;
mod react;
mod starboard;
mod sus;
mod xbasic;
use crate::config::LlamaConfig;
use crate::handlers::horse::HorseHandler;
use crate::handlers::joke::*;
use crate::handlers::react::*;
......@@ -22,6 +24,8 @@ use std::env;
use std::sync::Arc;
use tokio::sync::Mutex;
use self::llama::LlamaHandler;
#[async_trait]
pub(crate) trait LineHandler: Send + Sync {
async fn message(&self, ctx: &Context, msg: &Message) {
......@@ -69,18 +73,24 @@ impl EventHandler for Dispatcher {
}
}
impl Default for Dispatcher {
fn default() -> Self {
impl Dispatcher {
pub fn new(llama_config: Option<LlamaConfig>) -> Self {
let conn = Arc::new(Mutex::new(establish_connection()));
let mut handlers: Vec<Box<dyn LineHandler>> = vec![
Box::new(XbasicHandler::new(conn.clone())),
Box::<JokeHandler>::default(),
Box::<ReactHandler>::default(),
Box::<SusHandler>::default(),
Box::<HorseHandler>::default(),
];
if let Some(lc) = llama_config {
handlers.push(Box::new(LlamaHandler::new(lc)));
}
Self {
handlers: vec![
Box::new(XbasicHandler::new(conn.clone())),
Box::new(JokeHandler::default()),
Box::new(ReactHandler::default()),
Box::new(SusHandler::default()),
Box::new(HorseHandler::default()),
],
handlers,
reacts: vec![Box::new(StarboardHandler::new(conn))],
}
}
......
......@@ -23,7 +23,7 @@ fn map_lookup(msg: &str) -> Option<&'static str> {
// We lose the O(1) benefits of the hashmap
// But whatever. It doesn't need to be fast
for (k, v) in EMOJI_MAP.entries() {
if &msg == k || msg == format!("{}s", k) {
if &msg == k || msg == format!("{k}s") {
return Some(v);
}
}
......@@ -56,12 +56,12 @@ impl LineHandler for ReactHandler {
let reaction_type = match ReactionType::from_str(r) {
Ok(x) => x,
Err(x) => {
println!("Could not react: {}", x);
eprintln!("Could not react: {x}");
return;
}
};
if let Err(e) = msg.react(&ctx, reaction_type).await {
println!("Error reacting: {}", e);
eprintln!("Error reacting: {e}");
}
}
}
......
......@@ -12,6 +12,7 @@ use serenity::model::prelude::{
ChannelId, Emoji, EmojiId, Message, MessageReaction, Reaction, ReactionType,
};
use serenity::prelude::*;
use std::ops::DerefMut;
use std::sync::Arc;
use tokio::sync::Mutex;
......@@ -44,7 +45,7 @@ impl SingleMessageHandler {
.eq(BigDecimal::from_u64(guild.guild_id.0).unwrap()),
)
.limit(1)
.get_results(&*conn.lock().await)?;
.get_results(conn.lock().await.deref_mut())?;
let gs = match gs.pop() {
Some(x) => x,
None => return Ok(()),
......@@ -108,16 +109,16 @@ impl SingleMessageHandler {
.values(starboard_mappings::columns::original_id.eq(&original_id))
.returning(starboard_mappings::columns::repost_id)
.on_conflict_do_nothing()
.execute(&*self.conn.lock().await)?;
.execute(self.conn.lock().await.deref_mut())?;
let repost_id = starboard_mappings::dsl::starboard_mappings
.filter(starboard_mappings::columns::original_id.eq(&original_id))
.select(starboard_mappings::columns::repost_id)
.limit(1)
.get_results(&*self.conn.lock().await)?;
.get_results(self.conn.lock().await.deref_mut())?;
let repost_id: &Option<BigDecimal> =
repost_id.get(0).context("Insert of mapping failed")?;
repost_id.first().context("Insert of mapping failed")?;
match repost_id {
Some(id) => {
......@@ -140,7 +141,7 @@ impl SingleMessageHandler {
.filter(starboard_mappings::columns::original_id.eq(original_id)),
)
.set(starboard_mappings::columns::repost_id.eq(repost_id))
.execute(&*self.conn.lock().await)?;
.execute(self.conn.lock().await.deref_mut())?;
}
}
}
......@@ -189,7 +190,7 @@ impl SingleMessageHandler {
))
.title(format!("{} {}", self.reaction_count, self.emoji))
.author(|a| a.name(&self.name).icon_url(self.msg.author.face()))
.timestamp(&self.msg.timestamp);
.timestamp(self.msg.timestamp);
if let Some(url) = self.image {
e = e.image(url);
......@@ -231,13 +232,13 @@ impl StarboardHandler {
impl ReactionHandler for StarboardHandler {
async fn reaction_add(&self, ctx: &Context, reaction: &Reaction) {
if let Err(e) = self.handle_reaction(ctx, reaction).await {
eprintln!("Error in starboard: {:?}", e);
eprintln!("Error in starboard: {e:?}");
}
}
async fn reaction_del(&self, ctx: &Context, reaction: &Reaction) {
if let Err(e) = self.handle_reaction(ctx, reaction).await {
eprintln!("Error in starboard: {:?}", e);
eprintln!("Error in starboard: {e:?}");
}
}
}
......@@ -35,7 +35,7 @@ impl<'a> WrappingLayoutIter<'a> {
}
}
impl<'a> Iterator for WrappingLayoutIter<'a> {
impl Iterator for WrappingLayoutIter<'_> {
type Item = Vec<(i32, i32, f32)>;
fn next(&mut self) -> Option<Self::Item> {
......
......@@ -7,8 +7,9 @@ use serenity::async_trait;
use serenity::model::channel::{AttachmentType, Message, ReactionType};
use serenity::model::id::UserId;
use serenity::prelude::*;
use std::borrow::{Borrow, Cow};
use std::borrow::Cow;
use std::collections::HashMap;
use std::ops::DerefMut;
use std::str::FromStr;
use std::sync::Arc;
use tokio::sync::Mutex;
......@@ -106,7 +107,7 @@ impl XbasicHandler {
if let Some(name) = line.strip_prefix("PUB ") {
if self.publish_program(name, msg, ctx).await.is_none() {
msg.channel_id
.say(&ctx, format!("Could not publish {}.", name))
.say(&ctx, format!("Could not publish {name}."))
.await
.unwrap();
}
......@@ -115,7 +116,7 @@ impl XbasicHandler {
if let Some(name) = line.strip_prefix("UNPUB ") {
if self.unpublish_program(name, msg, ctx).await.is_none() {
msg.channel_id
.say(&ctx, &format!("Could not unpublish {}.", name))
.say(&ctx, &format!("Could not unpublish {name}."))
.await
.unwrap();
}
......@@ -126,7 +127,7 @@ impl XbasicHandler {
Ok(id) => {
if self.load_published_program(msg, ctx, id).await.is_none() {
msg.channel_id
.say(&ctx, format!("Could not load {}.", id))
.say(&ctx, format!("Could not load {id}."))
.await
.unwrap();
}
......@@ -182,7 +183,7 @@ impl XbasicHandler {
async fn list_saved_programs(&self, msg: &Message, ctx: &Context) -> Option<()> {
let program_names =
Program::list_programs_by_user(self.conn.lock().await.borrow(), msg.author.id)?;
Program::list_programs_by_user(self.conn.lock().await.deref_mut(), msg.author.id)?;
msg.channel_id
.say(
&ctx,
......@@ -200,7 +201,7 @@ impl XbasicHandler {
async fn list_published_programs(&self, msg: &Message, ctx: &Context) -> Option<()> {
let program_names: Vec<String> =
Program::list_published_programs(self.conn.lock().await.borrow())?
Program::list_published_programs(self.conn.lock().await.deref_mut())?
.iter()
.map(|row| format!("{}\t{}", row.0, row.1))
.collect();
......@@ -220,10 +221,15 @@ impl XbasicHandler {
}
async fn publish_program(&self, name: &str, msg: &Message, ctx: &Context) -> Option<()> {
Program::set_program_published(self.conn.lock().await.borrow(), name, msg.author.id, true)?;
Program::set_program_published(
self.conn.lock().await.deref_mut(),
name,
msg.author.id,
true,
)?;
msg.channel_id
.say(&ctx, format!("Published {}.", name))
.say(&ctx, format!("Published {name}."))
.await
.unwrap();
......@@ -232,14 +238,14 @@ impl XbasicHandler {
async fn unpublish_program(&self, name: &str, msg: &Message, ctx: &Context) -> Option<()> {
Program::set_program_published(
self.conn.lock().await.borrow(),
self.conn.lock().await.deref_mut(),
name,
msg.author.id,
false,
)?;
msg.channel_id
.say(&ctx, format!("Unpublished {}.", name))
.say(&ctx, format!("Unpublished {name}."))
.await
.unwrap();
......@@ -248,10 +254,10 @@ impl XbasicHandler {
async fn load_published_program(&self, msg: &Message, ctx: &Context, id: i32) -> Option<()> {
let name = get_user_programs!(self, &msg.author.id)
.load_published_program(self.conn.lock().await.borrow(), id)?;
.load_published_program(self.conn.lock().await.deref_mut(), id)?;
msg.channel_id
.say(&ctx, format!("Loaded {} (\"{}\") into memory.", id, name))
.say(&ctx, format!("Loaded {id} (\"{name}\") into memory."))
.await
.unwrap();
......@@ -273,14 +279,14 @@ impl XbasicHandler {
async fn interpreter_load(&self, name: &str, msg: &Message, ctx: &Context) {
let result = get_user_programs!(self, &msg.author.id).load_program(
&*self.conn.lock().await,
self.conn.lock().await.deref_mut(),
msg.author.id,
name,
);
match result {
Some(_) => {
msg.channel_id
.say(&ctx, format!("Loaded {} into memory.", name))
.say(&ctx, format!("Loaded {name} into memory."))
.await
.unwrap();
}
......@@ -295,14 +301,14 @@ impl XbasicHandler {
async fn interpreter_save(&self, name: &str, msg: &Message, ctx: &Context) {
let result = get_user_programs!(self, &msg.author.id).save_program(
&*self.conn.lock().await,
self.conn.lock().await.deref_mut(),
msg.author.id,
name,
);
match result {
Some(_) => {
msg.channel_id
.say(&ctx, format!("Saved as {}", name))
.say(&ctx, format!("Saved as {name}"))
.await
.unwrap();
}
......@@ -345,11 +351,8 @@ impl XbasicHandler {
let green = args[3].clone().into_decimal() as u8;
let blue = args[4].clone().into_decimal() as u8;
match &mut io.frame {
Some(fb) => {
fb.set_pixel(x, y, red, green, blue, 255);
}
None => {}
if let Some(fb) = &mut io.frame {
fb.set_pixel(x, y, red, green, blue, 255);
}
ExprValue::Decimal(0.0)
......@@ -358,7 +361,7 @@ impl XbasicHandler {
let mut xb = xbb.build();
let _ = xb.run(&format!("{}\n", code));
let _ = xb.run(&format!("{code}\n"));
let errors = if xb.error_handler.had_errors || xb.error_handler.had_runtime_error {
Some(xb.error_handler.errors.join("\n"))
......
......@@ -25,10 +25,10 @@ async fn main() {
.union(GatewayIntents::GUILD_MESSAGE_REACTIONS)
.union(GatewayIntents::MESSAGE_CONTENT),
)
.event_handler(Dispatcher::default())
.event_handler(Dispatcher::new(config.llama))
.await
.expect("Error creating client");
if let Err(e) = client.start().await {
eprintln!("Client error: {}", e);
eprintln!("Client error: {e}");
}
}
use crate::schema::user_programs;
use bigdecimal::BigDecimal;
#[derive(Queryable)]
pub struct UserProgram {
pub id: i32,
pub discord_user_id: u64,
pub name: String,
pub code: String,
}
#[derive(Insertable)]
#[table_name = "user_programs"]
#[diesel(table_name = user_programs)]
pub struct NewUserProgram<'a> {
pub discord_user_id: BigDecimal,
pub name: &'a str,
......@@ -19,7 +11,9 @@ pub struct NewUserProgram<'a> {
#[derive(Clone, Queryable)]
pub struct ServerSetting {
#[allow(dead_code)]
pub id: i32,
#[allow(dead_code)]
pub guild_id: BigDecimal,
pub starboard_threshold: i32,
pub starboard_emoji_id: BigDecimal,
......
......@@ -18,7 +18,7 @@ impl Program {
}
}
pub fn list_programs_by_user(conn: &PgConnection, user_id: UserId) -> Option<Vec<String>> {
pub fn list_programs_by_user(conn: &mut PgConnection, user_id: UserId) -> Option<Vec<String>> {
user_programs
.filter(columns::discord_user_id.eq(BigDecimal::from_u64(*user_id.as_u64()).unwrap()))
.select(columns::name)
......@@ -26,7 +26,7 @@ impl Program {
.ok()
}
pub fn list_published_programs(conn: &PgConnection) -> Option<Vec<(i32, String)>> {
pub fn list_published_programs(conn: &mut PgConnection) -> Option<Vec<(i32, String)>> {
user_programs
.filter(columns::published.eq(1))
.select((columns::id, columns::name))
......@@ -34,7 +34,7 @@ impl Program {
.ok()
}
pub fn load_published_program(&mut self, conn: &PgConnection, id: i32) -> Option<String> {
pub fn load_published_program(&mut self, conn: &mut PgConnection, id: i32) -> Option<String> {
let program: Vec<(String, String)> = user_programs
.filter(columns::id.eq(id).and(columns::published.eq(1)))
.limit(1)
......@@ -55,7 +55,7 @@ impl Program {
}
pub fn set_program_published(
conn: &PgConnection,
conn: &mut PgConnection,
name: &str,
user_id: UserId,
published: bool,
......@@ -67,7 +67,7 @@ impl Program {
.and(columns::name.eq(name)),
),
)
.set(columns::published.eq(if published { 1 } else { 0 }))
.set(columns::published.eq(i32::from(published)))
.execute(conn)
.ok()? == 1
{
......@@ -99,7 +99,7 @@ impl Program {
.join("\n")
}
pub fn save_program(&self, conn: &PgConnection, user_id: UserId, name: &str) -> Option<()> {
pub fn save_program(&self, conn: &mut PgConnection, user_id: UserId, name: &str) -> Option<()> {
let code = self.stringy_line_nums();
let new_program = NewUserProgram {
discord_user_id: BigDecimal::from_u64(*user_id.as_u64()).unwrap(),
......@@ -118,7 +118,12 @@ impl Program {
Some(())
}
pub fn load_program(&mut self, conn: &PgConnection, user_id: UserId, name: &str) -> Option<()> {
pub fn load_program(
&mut self,
conn: &mut PgConnection,
user_id: UserId,
name: &str,
) -> Option<()> {
let code: Vec<String> = user_programs
.filter(
columns::discord_user_id
......
table! {
server_settings (id) {
id -> Int4,
guild_id -> Numeric,
starboard_threshold -> Int4,
starboard_emoji_id -> Numeric,
starboard_channel -> Numeric,
}
server_settings (id) {
id -> Int4,
guild_id -> Numeric,
starboard_threshold -> Int4,
starboard_emoji_id -> Numeric,
starboard_channel -> Numeric,
}
}
table! {
starboard_mappings (original_id) {
original_id -> Numeric,
repost_id -> Nullable<Numeric>,
}
starboard_mappings (original_id) {
original_id -> Numeric,
repost_id -> Nullable<Numeric>,
}
}
table! {
user_programs (id) {
id -> Int4,
discord_user_id -> Numeric,
name -> Varchar,
code -> Text,
published -> Int4,
}
user_programs (id) {
id -> Int4,
discord_user_id -> Numeric,
name -> Varchar,
code -> Text,
published -> Int4,
}
}
allow_tables_to_appear_in_same_query!(
server_settings,
starboard_mappings,
user_programs,
);
allow_tables_to_appear_in_same_query!(server_settings, starboard_mappings, user_programs,);