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 (29)
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 4
[[package]] [[package]]
name = "adler" name = "adler"
...@@ -35,8 +35,8 @@ version = "0.1.57" ...@@ -35,8 +35,8 @@ version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
] ]
...@@ -49,11 +49,11 @@ dependencies = [ ...@@ -49,11 +49,11 @@ dependencies = [
"futures-io", "futures-io",
"futures-util", "futures-util",
"log", "log",
"pin-project-lite 0.2.9", "pin-project-lite",
"tokio 1.21.2", "tokio",
"tokio-rustls", "tokio-rustls 0.23.4",
"tungstenite", "tungstenite",
"webpki-roots", "webpki-roots 0.22.5",
] ]
[[package]] [[package]]
...@@ -68,6 +68,12 @@ version = "0.13.0" ...@@ -68,6 +68,12 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]] [[package]]
name = "bigdecimal" name = "bigdecimal"
version = "0.1.2" version = "0.1.2"
...@@ -85,6 +91,12 @@ version = "1.3.2" ...@@ -85,6 +91,12 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
version = "0.10.3" version = "0.10.3"
...@@ -106,12 +118,6 @@ version = "1.4.3" ...@@ -106,12 +118,6 @@ version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "bytes"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.2.1" version = "1.2.1"
...@@ -120,22 +126,23 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" ...@@ -120,22 +126,23 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db"
[[package]] [[package]]
name = "cat-disruptor-6500" name = "cat-disruptor-6500"
version = "0.1.2" version = "0.3.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bigdecimal", "bigdecimal",
"diesel", "diesel",
"dotenv", "dotenv",
"itertools", "itertools",
"ollama-rs",
"phf", "phf",
"png", "png",
"rand 0.8.5", "rand 0.8.5",
"reqwest 0.10.10", "reqwest",
"rusttype", "rusttype",
"serde", "serde",
"serde_json", "serde_json",
"serenity", "serenity",
"tokio 1.21.2", "tokio",
"toml", "toml",
"xbasic", "xbasic",
] ]
...@@ -146,12 +153,6 @@ version = "1.0.73" ...@@ -146,12 +153,6 @@ version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.0" version = "1.0.0"
...@@ -189,7 +190,7 @@ version = "1.3.2" ...@@ -189,7 +190,7 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
] ]
[[package]] [[package]]
...@@ -202,6 +203,55 @@ dependencies = [ ...@@ -202,6 +203,55 @@ dependencies = [
"typenum", "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]] [[package]]
name = "deflate" name = "deflate"
version = "0.8.6" version = "0.8.6"
...@@ -214,14 +264,15 @@ dependencies = [ ...@@ -214,14 +264,15 @@ dependencies = [
[[package]] [[package]]
name = "diesel" name = "diesel"
version = "1.4.8" version = "2.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d" checksum = "ccf1bedf64cdb9643204a36dd15b19a6ce8e7aa7f7b105868e9f1fad5ffa7d12"
dependencies = [ dependencies = [
"bigdecimal", "bigdecimal",
"bitflags", "bitflags 2.6.0",
"byteorder", "byteorder",
"diesel_derives", "diesel_derives",
"itoa",
"num-bigint", "num-bigint",
"num-integer", "num-integer",
"num-traits 0.2.15", "num-traits 0.2.15",
...@@ -230,13 +281,24 @@ dependencies = [ ...@@ -230,13 +281,24 @@ dependencies = [
[[package]] [[package]]
name = "diesel_derives" name = "diesel_derives"
version = "1.4.1" version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "diesel_table_macro_syntax",
"quote 1.0.21", "dsl_auto_type",
"syn 1.0.102", "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]] [[package]]
...@@ -255,6 +317,20 @@ version = "0.15.0" ...@@ -255,6 +317,20 @@ version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" 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]] [[package]]
name = "either" name = "either"
version = "1.8.0" version = "1.8.0"
...@@ -267,9 +343,15 @@ version = "0.8.31" ...@@ -267,9 +343,15 @@ version = "0.8.31"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
dependencies = [ 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]] [[package]]
name = "fastrand" name = "fastrand"
version = "1.8.0" version = "1.8.0"
...@@ -319,22 +401,6 @@ dependencies = [ ...@@ -319,22 +401,6 @@ dependencies = [
"percent-encoding", "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]] [[package]]
name = "futures" name = "futures"
version = "0.3.24" version = "0.3.24"
...@@ -371,6 +437,17 @@ version = "0.3.24" ...@@ -371,6 +437,17 @@ version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" 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]] [[package]]
name = "futures-sink" name = "futures-sink"
version = "0.3.24" version = "0.3.24"
...@@ -392,10 +469,11 @@ dependencies = [ ...@@ -392,10 +469,11 @@ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-io", "futures-io",
"futures-macro",
"futures-sink", "futures-sink",
"futures-task", "futures-task",
"memchr", "memchr",
"pin-project-lite 0.2.9", "pin-project-lite",
"pin-utils", "pin-utils",
"slab", "slab",
] ]
...@@ -416,7 +494,7 @@ version = "0.1.16" ...@@ -416,7 +494,7 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"libc", "libc",
"wasi 0.9.0+wasi-snapshot-preview1", "wasi 0.9.0+wasi-snapshot-preview1",
] ]
...@@ -427,18 +505,18 @@ version = "0.2.7" ...@@ -427,18 +505,18 @@ version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"libc", "libc",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.0+wasi-snapshot-preview1",
] ]
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.2.7" version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9"
dependencies = [ dependencies = [
"bytes 0.5.6", "bytes",
"fnv", "fnv",
"futures-core", "futures-core",
"futures-sink", "futures-sink",
...@@ -446,36 +524,28 @@ dependencies = [ ...@@ -446,36 +524,28 @@ dependencies = [
"http", "http",
"indexmap", "indexmap",
"slab", "slab",
"tokio 0.2.25", "tokio",
"tokio-util 0.3.1", "tokio-util",
"tracing", "tracing",
"tracing-futures",
] ]
[[package]] [[package]]
name = "h2" name = "hashbrown"
version = "0.3.14" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
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",
]
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.12.3" version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index" 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]] [[package]]
name = "hermit-abi" name = "hermit-abi"
...@@ -492,19 +562,9 @@ version = "0.2.8" ...@@ -492,19 +562,9 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [ dependencies = [
"bytes 1.2.1", "bytes",
"fnv", "fnv",
"itoa 1.0.4", "itoa",
]
[[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",
] ]
[[package]] [[package]]
...@@ -513,9 +573,9 @@ version = "0.4.5" ...@@ -513,9 +573,9 @@ version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [ dependencies = [
"bytes 1.2.1", "bytes",
"http", "http",
"pin-project-lite 0.2.9", "pin-project-lite",
] ]
[[package]] [[package]]
...@@ -524,12 +584,6 @@ version = "1.8.0" ...@@ -524,12 +584,6 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "httpdate"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47"
[[package]] [[package]]
name = "httpdate" name = "httpdate"
version = "1.0.2" version = "1.0.2"
...@@ -538,77 +592,60 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" ...@@ -538,77 +592,60 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.13.10" version = "0.14.28"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
dependencies = [ dependencies = [
"bytes 0.5.6", "bytes",
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2 0.2.7", "h2",
"http", "http",
"http-body 0.3.1", "http-body",
"httparse", "httparse",
"httpdate 0.3.2", "httpdate",
"itoa 0.4.8", "itoa",
"pin-project", "pin-project-lite",
"socket2 0.3.19", "socket2",
"tokio 0.2.25", "tokio",
"tower-service", "tower-service",
"tracing", "tracing",
"want", "want",
] ]
[[package]] [[package]]
name = "hyper" name = "hyper-rustls"
version = "0.14.20" version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [ dependencies = [
"bytes 1.2.1",
"futures-channel",
"futures-core",
"futures-util", "futures-util",
"h2 0.3.14",
"http", "http",
"http-body 0.4.5", "hyper",
"httparse", "rustls 0.21.7",
"httpdate 1.0.2", "tokio",
"itoa 1.0.4", "tokio-rustls 0.24.1",
"pin-project-lite 0.2.9",
"socket2 0.4.7",
"tokio 1.21.2",
"tower-service",
"tracing",
"want",
] ]
[[package]] [[package]]
name = "hyper-rustls" name = "hyper-tls"
version = "0.23.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [ dependencies = [
"http", "bytes",
"hyper 0.14.20", "hyper",
"rustls", "native-tls",
"tokio 1.21.2", "tokio",
"tokio-rustls", "tokio-native-tls",
] ]
[[package]] [[package]]
name = "hyper-tls" name = "ident_case"
version = "0.4.3" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
dependencies = [
"bytes 0.5.6",
"hyper 0.13.10",
"native-tls",
"tokio 0.2.25",
"tokio-tls",
]
[[package]] [[package]]
name = "idna" name = "idna"
...@@ -622,12 +659,12 @@ dependencies = [ ...@@ -622,12 +659,12 @@ dependencies = [
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "1.9.1" version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
dependencies = [ dependencies = [
"autocfg", "equivalent",
"hashbrown", "hashbrown 0.14.3",
] ]
[[package]] [[package]]
...@@ -636,16 +673,7 @@ version = "0.1.12" ...@@ -636,16 +673,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
]
[[package]]
name = "iovec"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
dependencies = [
"libc",
] ]
[[package]] [[package]]
...@@ -663,12 +691,6 @@ dependencies = [ ...@@ -663,12 +691,6 @@ dependencies = [
"either", "either",
] ]
[[package]]
name = "itoa"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.4" version = "1.0.4"
...@@ -684,16 +706,6 @@ dependencies = [ ...@@ -684,16 +706,6 @@ dependencies = [
"wasm-bindgen", "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]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
...@@ -722,7 +734,7 @@ version = "0.4.17" ...@@ -722,7 +734,7 @@ version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
] ]
[[package]] [[package]]
...@@ -765,25 +777,6 @@ dependencies = [ ...@@ -765,25 +777,6 @@ dependencies = [
"adler", "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]] [[package]]
name = "mio" name = "mio"
version = "0.8.4" version = "0.8.4"
...@@ -793,19 +786,7 @@ dependencies = [ ...@@ -793,19 +786,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys", "windows-sys 0.36.1",
]
[[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",
] ]
[[package]] [[package]]
...@@ -826,17 +807,6 @@ dependencies = [ ...@@ -826,17 +807,6 @@ dependencies = [
"tempfile", "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]] [[package]]
name = "nodrop" name = "nodrop"
version = "0.1.14" version = "0.1.14"
...@@ -912,6 +882,17 @@ dependencies = [ ...@@ -912,6 +882,17 @@ dependencies = [
"libc", "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]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.15.0" version = "1.15.0"
...@@ -924,8 +905,8 @@ version = "0.10.42" ...@@ -924,8 +905,8 @@ version = "0.10.42"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13"
dependencies = [ dependencies = [
"bitflags", "bitflags 1.3.2",
"cfg-if 1.0.0", "cfg-if",
"foreign-types", "foreign-types",
"libc", "libc",
"once_cell", "once_cell",
...@@ -939,8 +920,8 @@ version = "0.1.0" ...@@ -939,8 +920,8 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
] ]
...@@ -998,11 +979,11 @@ version = "0.9.3" ...@@ -998,11 +979,11 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"libc", "libc",
"redox_syscall", "redox_syscall",
"smallvec", "smallvec",
"windows-sys", "windows-sys 0.36.1",
] ]
[[package]] [[package]]
...@@ -1041,8 +1022,8 @@ dependencies = [ ...@@ -1041,8 +1022,8 @@ dependencies = [
"phf_generator", "phf_generator",
"phf_shared", "phf_shared",
"proc-macro-hack", "proc-macro-hack",
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
] ]
...@@ -1055,32 +1036,6 @@ dependencies = [ ...@@ -1055,32 +1036,6 @@ dependencies = [
"siphasher", "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]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.9" version = "0.2.9"
...@@ -1105,7 +1060,7 @@ version = "0.16.8" ...@@ -1105,7 +1060,7 @@ version = "0.16.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6"
dependencies = [ dependencies = [
"bitflags", "bitflags 1.3.2",
"crc32fast", "crc32fast",
"deflate", "deflate",
"miniz_oxide 0.3.7", "miniz_oxide 0.3.7",
...@@ -1143,9 +1098,9 @@ dependencies = [ ...@@ -1143,9 +1098,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.46" version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
...@@ -1161,11 +1116,11 @@ dependencies = [ ...@@ -1161,11 +1116,11 @@ dependencies = [
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.21" version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
] ]
[[package]] [[package]]
...@@ -1255,7 +1210,7 @@ version = "0.2.16" ...@@ -1255,7 +1210,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [ dependencies = [
"bitflags", "bitflags 1.3.2",
] ]
[[package]] [[package]]
...@@ -1264,84 +1219,53 @@ version = "0.5.3" ...@@ -1264,84 +1219,53 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [ dependencies = [
"winapi 0.3.9", "winapi",
] ]
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.10.10" version = "0.11.23"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
dependencies = [ dependencies = [
"base64", "base64 0.21.7",
"bytes 0.5.6", "bytes",
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2",
"http", "http",
"http-body 0.3.1", "http-body",
"hyper 0.13.10", "hyper",
"hyper-rustls",
"hyper-tls", "hyper-tls",
"ipnet", "ipnet",
"js-sys", "js-sys",
"lazy_static",
"log", "log",
"mime", "mime",
"mime_guess", "mime_guess",
"native-tls", "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", "once_cell",
"percent-encoding", "percent-encoding",
"pin-project-lite 0.2.9", "pin-project-lite",
"rustls", "rustls 0.21.7",
"rustls-pemfile", "rustls-pemfile",
"serde", "serde",
"serde_json", "serde_json",
"serde_urlencoded", "serde_urlencoded",
"tokio 1.21.2", "system-configuration",
"tokio-rustls", "tokio",
"tokio-util 0.7.4", "tokio-native-tls",
"tokio-rustls 0.24.1",
"tokio-util",
"tower-service", "tower-service",
"url", "url",
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",
"wasm-streams",
"web-sys", "web-sys",
"webpki-roots", "webpki-roots 0.25.3",
"winreg 0.10.1", "winreg",
] ]
[[package]] [[package]]
...@@ -1356,7 +1280,7 @@ dependencies = [ ...@@ -1356,7 +1280,7 @@ dependencies = [
"spin", "spin",
"untrusted", "untrusted",
"web-sys", "web-sys",
"winapi 0.3.9", "winapi",
] ]
[[package]] [[package]]
...@@ -1371,13 +1295,35 @@ dependencies = [ ...@@ -1371,13 +1295,35 @@ dependencies = [
"webpki", "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]] [[package]]
name = "rustls-pemfile" name = "rustls-pemfile"
version = "1.0.1" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
dependencies = [ 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]] [[package]]
...@@ -1404,7 +1350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -1404,7 +1350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"windows-sys", "windows-sys 0.36.1",
] ]
[[package]] [[package]]
...@@ -1429,7 +1375,7 @@ version = "2.7.0" ...@@ -1429,7 +1375,7 @@ version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
dependencies = [ dependencies = [
"bitflags", "bitflags 1.3.2",
"core-foundation", "core-foundation",
"core-foundation-sys", "core-foundation-sys",
"libc", "libc",
...@@ -1448,9 +1394,9 @@ dependencies = [ ...@@ -1448,9 +1394,9 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.145" version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
...@@ -1467,22 +1413,22 @@ dependencies = [ ...@@ -1467,22 +1413,22 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.145" version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 2.0.48",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.85" version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
dependencies = [ dependencies = [
"itoa 1.0.4", "itoa",
"ryu", "ryu",
"serde", "serde",
] ]
...@@ -1494,7 +1440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -1494,7 +1440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"itoa 1.0.4", "itoa",
"ryu", "ryu",
"serde", "serde",
] ]
...@@ -1507,22 +1453,24 @@ checksum = "82fd5e7b5858ad96e99d440138f34f5b98e1b959ebcd3a1036203b30e78eb788" ...@@ -1507,22 +1453,24 @@ checksum = "82fd5e7b5858ad96e99d440138f34f5b98e1b959ebcd3a1036203b30e78eb788"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"async-tungstenite", "async-tungstenite",
"base64", "base64 0.13.0",
"bitflags", "bitflags 1.3.2",
"bytes 1.2.1", "bytes",
"cfg-if 1.0.0", "cfg-if",
"dashmap",
"flate2", "flate2",
"futures", "futures",
"mime", "mime",
"mime_guess", "mime_guess",
"parking_lot",
"percent-encoding", "percent-encoding",
"reqwest 0.11.12", "reqwest",
"serde", "serde",
"serde-value", "serde-value",
"serde_json", "serde_json",
"static_assertions", "static_assertions",
"time", "time",
"tokio 1.21.2", "tokio",
"tracing", "tracing",
"typemap_rev", "typemap_rev",
"url", "url",
...@@ -1534,7 +1482,7 @@ version = "0.10.0" ...@@ -1534,7 +1482,7 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"cpufeatures", "cpufeatures",
"digest", "digest",
] ]
...@@ -1569,17 +1517,6 @@ version = "1.10.0" ...@@ -1569,17 +1517,6 @@ version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 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]] [[package]]
name = "socket2" name = "socket2"
version = "0.4.7" version = "0.4.7"
...@@ -1587,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -1587,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
dependencies = [ dependencies = [
"libc", "libc",
"winapi 0.3.9", "winapi",
] ]
[[package]] [[package]]
...@@ -1620,6 +1557,12 @@ dependencies = [ ...@@ -1620,6 +1557,12 @@ dependencies = [
"byteorder", "byteorder",
] ]
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]] [[package]]
name = "syn" name = "syn"
version = "0.15.44" version = "0.15.44"
...@@ -1637,23 +1580,55 @@ version = "1.0.102" ...@@ -1637,23 +1580,55 @@ version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "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", "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]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.3.0" version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"fastrand", "fastrand",
"libc", "libc",
"redox_syscall", "redox_syscall",
"remove_dir_all", "remove_dir_all",
"winapi 0.3.9", "winapi",
] ]
[[package]] [[package]]
...@@ -1671,8 +1646,8 @@ version = "1.0.37" ...@@ -1671,8 +1646,8 @@ version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
] ]
...@@ -1682,7 +1657,7 @@ version = "0.3.15" ...@@ -1682,7 +1657,7 @@ version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c"
dependencies = [ dependencies = [
"itoa 1.0.4", "itoa",
"libc", "libc",
"num_threads", "num_threads",
"serde", "serde",
...@@ -1703,23 +1678,6 @@ version = "0.1.0" ...@@ -1703,23 +1678,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 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]] [[package]]
name = "tokio" name = "tokio"
version = "1.21.2" version = "1.21.2"
...@@ -1727,17 +1685,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -1727,17 +1685,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"bytes 1.2.1", "bytes",
"libc", "libc",
"memchr", "memchr",
"mio 0.8.4", "mio",
"num_cpus", "num_cpus",
"parking_lot", "parking_lot",
"pin-project-lite 0.2.9", "pin-project-lite",
"signal-hook-registry", "signal-hook-registry",
"socket2 0.4.7", "socket2",
"tokio-macros", "tokio-macros",
"winapi 0.3.9", "winapi",
] ]
[[package]] [[package]]
...@@ -1746,44 +1704,40 @@ version = "1.8.0" ...@@ -1746,44 +1704,40 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
] ]
[[package]] [[package]]
name = "tokio-rustls" name = "tokio-native-tls"
version = "0.23.4" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
dependencies = [ dependencies = [
"rustls", "native-tls",
"tokio 1.21.2", "tokio",
"webpki",
] ]
[[package]] [[package]]
name = "tokio-tls" name = "tokio-rustls"
version = "0.3.1" version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
dependencies = [ dependencies = [
"native-tls", "rustls 0.20.6",
"tokio 0.2.25", "tokio",
"webpki",
] ]
[[package]] [[package]]
name = "tokio-util" name = "tokio-rustls"
version = "0.3.1" version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [ dependencies = [
"bytes 0.5.6", "rustls 0.21.7",
"futures-core", "tokio",
"futures-sink",
"log",
"pin-project-lite 0.1.12",
"tokio 0.2.25",
] ]
[[package]] [[package]]
...@@ -1792,11 +1746,11 @@ version = "0.7.4" ...@@ -1792,11 +1746,11 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
dependencies = [ dependencies = [
"bytes 1.2.1", "bytes",
"futures-core", "futures-core",
"futures-sink", "futures-sink",
"pin-project-lite 0.2.9", "pin-project-lite",
"tokio 1.21.2", "tokio",
"tracing", "tracing",
] ]
...@@ -1821,9 +1775,9 @@ version = "0.1.37" ...@@ -1821,9 +1775,9 @@ version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"log", "log",
"pin-project-lite 0.2.9", "pin-project-lite",
"tracing-attributes", "tracing-attributes",
"tracing-core", "tracing-core",
] ]
...@@ -1834,8 +1788,8 @@ version = "0.1.23" ...@@ -1834,8 +1788,8 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
] ]
...@@ -1848,16 +1802,6 @@ dependencies = [ ...@@ -1848,16 +1802,6 @@ dependencies = [
"once_cell", "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]] [[package]]
name = "try-lock" name = "try-lock"
version = "0.2.3" version = "0.2.3"
...@@ -1870,14 +1814,14 @@ version = "0.17.3" ...@@ -1870,14 +1814,14 @@ version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0"
dependencies = [ dependencies = [
"base64", "base64 0.13.0",
"byteorder", "byteorder",
"bytes 1.2.1", "bytes",
"http", "http",
"httparse", "httparse",
"log", "log",
"rand 0.8.5", "rand 0.8.5",
"rustls", "rustls 0.20.6",
"sha-1", "sha-1",
"thiserror", "thiserror",
"url", "url",
...@@ -2012,9 +1956,7 @@ version = "0.2.83" ...@@ -2012,9 +1956,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"serde",
"serde_json",
"wasm-bindgen-macro", "wasm-bindgen-macro",
] ]
...@@ -2027,8 +1969,8 @@ dependencies = [ ...@@ -2027,8 +1969,8 @@ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
"once_cell", "once_cell",
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
...@@ -2039,7 +1981,7 @@ version = "0.4.33" ...@@ -2039,7 +1981,7 @@ version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if",
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
"web-sys", "web-sys",
...@@ -2051,7 +1993,7 @@ version = "0.2.83" ...@@ -2051,7 +1993,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
dependencies = [ dependencies = [
"quote 1.0.21", "quote 1.0.35",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
] ]
...@@ -2061,8 +2003,8 @@ version = "0.2.83" ...@@ -2061,8 +2003,8 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [ dependencies = [
"proc-macro2 1.0.46", "proc-macro2 1.0.76",
"quote 1.0.21", "quote 1.0.35",
"syn 1.0.102", "syn 1.0.102",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
...@@ -2074,6 +2016,19 @@ version = "0.2.83" ...@@ -2074,6 +2016,19 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" 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]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.60" version = "0.3.60"
...@@ -2104,10 +2059,10 @@ dependencies = [ ...@@ -2104,10 +2059,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "winapi" name = "webpki-roots"
version = "0.2.8" version = "0.25.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
[[package]] [[package]]
name = "winapi" name = "winapi"
...@@ -2119,12 +2074,6 @@ dependencies = [ ...@@ -2119,12 +2074,6 @@ dependencies = [
"winapi-x86_64-pc-windows-gnu", "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]] [[package]]
name = "winapi-i686-pc-windows-gnu" name = "winapi-i686-pc-windows-gnu"
version = "0.4.0" version = "0.4.0"
...@@ -2143,37 +2092,97 @@ version = "0.36.1" ...@@ -2143,37 +2092,97 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [ dependencies = [
"windows_aarch64_msvc", "windows_aarch64_msvc 0.36.1",
"windows_i686_gnu", "windows_i686_gnu 0.36.1",
"windows_i686_msvc", "windows_i686_msvc 0.36.1",
"windows_x86_64_gnu", "windows_x86_64_gnu 0.36.1",
"windows_x86_64_msvc", "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]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 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]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.36.1" version = "0.36.1"
...@@ -2181,31 +2190,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -2181,31 +2190,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]] [[package]]
name = "winreg" name = "windows_x86_64_msvc"
version = "0.7.0" version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
dependencies = [
"winapi 0.3.9",
]
[[package]] [[package]]
name = "winreg" name = "winreg"
version = "0.10.1" version = "0.50.0"
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"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [ dependencies = [
"winapi 0.2.8", "cfg-if",
"winapi-build", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
......
[package] [package]
name = "cat-disruptor-6500" name = "cat-disruptor-6500"
version = "0.1.2" version = "0.3.0"
authors = ["Stephen <stephen@stephendownward.ca>"] authors = ["Stephen <wemaster@scd31.com>"]
edition = "2018" edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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"] } tokio = {version = "1.21", features = ["full", "time"] }
phf = { version = "0.8", features = ["macros"] } phf = { version = "0.8", features = ["macros"] }
toml = "0.5" toml = "0.5"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
xbasic = "0.3.1" xbasic = "0.3.1"
png = "0.16" png = "0.16"
diesel = { version = "1.4", features = ["postgres", "numeric"] } diesel = { version = "2", features = ["postgres", "numeric"] }
dotenv = "0.15.0" dotenv = "0.15.0"
bigdecimal = "0.1.2" bigdecimal = "0.1.2"
reqwest = { version = "0.10", features = ["json"] } reqwest = { version = "0.11", features = ["json"] }
serde_json = "1.0" serde_json = "1.0"
rusttype = "0.4.3" rusttype = "0.4.3"
rand = "0.8" rand = "0.8"
itertools = "0.10" itertools = "0.10"
anyhow = "1.0" anyhow = "1.0"
ollama-rs = "0.1.5"
...@@ -2,6 +2,21 @@ ...@@ -2,6 +2,21 @@
A Discord bot that reacts to certain messages with certain emojis. More importantly, it also lets you write code! 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: ## Commands:
!START - start the interpreter !START - start the interpreter
...@@ -70,4 +85,4 @@ The interpreter can execute arbitrary code safely - it includes CPU and memory l ...@@ -70,4 +85,4 @@ The interpreter can execute arbitrary code safely - it includes CPU and memory l
It even does graphics! It even does graphics!
![Example session](example.png) ![Example session](example.png)
use serde::Deserialize; 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)] #[derive(Deserialize)]
pub struct Config { pub struct Config {
pub(crate) token: String, pub(crate) token: String,
pub(crate) llama: Option<LlamaConfig>,
} }
pub fn get_conf() -> Config { pub fn get_conf() -> Config {
......
...@@ -10,7 +10,7 @@ pub struct HorseHandler; ...@@ -10,7 +10,7 @@ pub struct HorseHandler;
#[async_trait] #[async_trait]
impl LineHandler for HorseHandler { impl LineHandler for HorseHandler {
async fn message(&self, ctx: &Context, msg: &Message) { async fn message(&self, ctx: &Context, msg: &Message) {
let reaction = match ReactionType::from_str("🐎") { let reaction = match ReactionType::from_str("🐴") {
Ok(x) => x, Ok(x) => x,
Err(_) => return, Err(_) => return,
}; };
......
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 horse;
mod joke; mod joke;
mod llama;
mod react; mod react;
mod starboard; mod starboard;
mod sus; mod sus;
mod xbasic; mod xbasic;
use crate::config::LlamaConfig;
use crate::handlers::horse::HorseHandler; use crate::handlers::horse::HorseHandler;
use crate::handlers::joke::*; use crate::handlers::joke::*;
use crate::handlers::react::*; use crate::handlers::react::*;
...@@ -22,6 +24,8 @@ use std::env; ...@@ -22,6 +24,8 @@ use std::env;
use std::sync::Arc; use std::sync::Arc;
use tokio::sync::Mutex; use tokio::sync::Mutex;
use self::llama::LlamaHandler;
#[async_trait] #[async_trait]
pub(crate) trait LineHandler: Send + Sync { pub(crate) trait LineHandler: Send + Sync {
async fn message(&self, ctx: &Context, msg: &Message) { async fn message(&self, ctx: &Context, msg: &Message) {
...@@ -35,7 +39,8 @@ pub(crate) trait LineHandler: Send + Sync { ...@@ -35,7 +39,8 @@ pub(crate) trait LineHandler: Send + Sync {
#[async_trait] #[async_trait]
pub(crate) trait ReactionHandler: Send + Sync { pub(crate) trait ReactionHandler: Send + Sync {
async fn reaction(&self, _ctx: &Context, reaction: &Reaction); async fn reaction_add(&self, ctx: &Context, reaction: &Reaction);
async fn reaction_del(&self, ctx: &Context, reaction: &Reaction);
} }
pub(crate) struct Dispatcher { pub(crate) struct Dispatcher {
...@@ -53,7 +58,13 @@ impl EventHandler for Dispatcher { ...@@ -53,7 +58,13 @@ impl EventHandler for Dispatcher {
async fn reaction_add(&self, ctx: Context, reaction: Reaction) { async fn reaction_add(&self, ctx: Context, reaction: Reaction) {
for r in &self.reacts { for r in &self.reacts {
r.reaction(&ctx, &reaction).await; r.reaction_add(&ctx, &reaction).await;
}
}
async fn reaction_remove(&self, ctx: Context, reaction: Reaction) {
for r in &self.reacts {
r.reaction_del(&ctx, &reaction).await;
} }
} }
...@@ -62,18 +73,24 @@ impl EventHandler for Dispatcher { ...@@ -62,18 +73,24 @@ impl EventHandler for Dispatcher {
} }
} }
impl Default for Dispatcher { impl Dispatcher {
fn default() -> Self { pub fn new(llama_config: Option<LlamaConfig>) -> Self {
let conn = Arc::new(Mutex::new(establish_connection())); 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 { Self {
handlers: vec![ handlers,
Box::new(XbasicHandler::new(conn.clone())),
Box::new(JokeHandler::default()),
Box::new(ReactHandler::default()),
Box::new(SusHandler::default()),
Box::new(HorseHandler::default()),
],
reacts: vec![Box::new(StarboardHandler::new(conn))], reacts: vec![Box::new(StarboardHandler::new(conn))],
} }
} }
......
...@@ -23,7 +23,7 @@ fn map_lookup(msg: &str) -> Option<&'static str> { ...@@ -23,7 +23,7 @@ fn map_lookup(msg: &str) -> Option<&'static str> {
// We lose the O(1) benefits of the hashmap // We lose the O(1) benefits of the hashmap
// But whatever. It doesn't need to be fast // But whatever. It doesn't need to be fast
for (k, v) in EMOJI_MAP.entries() { for (k, v) in EMOJI_MAP.entries() {
if &msg == k || msg == format!("{}s", k) { if &msg == k || msg == format!("{k}s") {
return Some(v); return Some(v);
} }
} }
...@@ -56,12 +56,12 @@ impl LineHandler for ReactHandler { ...@@ -56,12 +56,12 @@ impl LineHandler for ReactHandler {
let reaction_type = match ReactionType::from_str(r) { let reaction_type = match ReactionType::from_str(r) {
Ok(x) => x, Ok(x) => x,
Err(x) => { Err(x) => {
println!("Could not react: {}", x); eprintln!("Could not react: {x}");
return; return;
} }
}; };
if let Err(e) = msg.react(&ctx, reaction_type).await { if let Err(e) = msg.react(&ctx, reaction_type).await {
println!("Error reacting: {}", e); eprintln!("Error reacting: {e}");
} }
} }
} }
......
...@@ -7,35 +7,46 @@ use anyhow::Context as AnyhowContext; ...@@ -7,35 +7,46 @@ use anyhow::Context as AnyhowContext;
use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive}; use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive};
use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl}; use diesel::{ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl};
use serenity::async_trait; use serenity::async_trait;
use serenity::model::prelude::{ChannelId, EmojiId, GuildId, Message, Reaction, ReactionType}; use serenity::builder::CreateEmbed;
use serenity::model::prelude::{
ChannelId, Emoji, EmojiId, Message, MessageReaction, Reaction, ReactionType,
};
use serenity::prelude::*; use serenity::prelude::*;
use std::ops::DerefMut;
use std::sync::Arc; use std::sync::Arc;
use tokio::sync::Mutex; use tokio::sync::Mutex;
pub struct StarboardHandler { #[derive(Clone)]
pub struct SingleMessageHandler {
conn: Arc<Mutex<PgConnection>>, conn: Arc<Mutex<PgConnection>>,
server_settings: ServerSetting,
reaction_count: u64,
msg: Message,
emoji: Emoji,
name: String,
image: Option<String>,
} }
impl StarboardHandler { impl SingleMessageHandler {
pub fn new(conn: Arc<Mutex<PgConnection>>) -> Self { pub async fn handle_reaction(
Self { conn } conn: Arc<Mutex<PgConnection>>,
} ctx: &Context,
reaction: &Reaction,
async fn handle_reaction(&self, ctx: &Context, reaction: &Reaction) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let guild = match reaction.channel_id.to_channel(ctx).await?.guild() { let guild = match reaction.channel_id.to_channel(ctx).await?.guild() {
Some(x) => x, Some(x) => x,
None => return Ok(()), None => return Ok(()),
}; };
// get corresponding guild settings // get corresponding guild settings
let gs: Vec<ServerSetting> = server_settings::dsl::server_settings let mut gs: Vec<ServerSetting> = server_settings::dsl::server_settings
.filter( .filter(
schema::server_settings::columns::guild_id schema::server_settings::columns::guild_id
.eq(BigDecimal::from_u64(guild.guild_id.0).unwrap()), .eq(BigDecimal::from_u64(guild.guild_id.0).unwrap()),
) )
.limit(1) .limit(1)
.get_results(&*self.conn.lock().await)?; .get_results(conn.lock().await.deref_mut())?;
let gs = match gs.first() { let gs = match gs.pop() {
Some(x) => x, Some(x) => x,
None => return Ok(()), None => return Ok(()),
}; };
...@@ -45,13 +56,92 @@ impl StarboardHandler { ...@@ -45,13 +56,92 @@ impl StarboardHandler {
.context("Could not convert emoji id to u64")?, .context("Could not convert emoji id to u64")?,
); );
if Self::emoji_match(&reaction.emoji, emoji) { let msg = reaction.message(ctx).await?;
let msg = reaction.message(ctx).await?;
for mr in &msg.reactions { // reaction from event handler must match
if Self::emoji_match(&mr.reaction_type, emoji) { // otherwise we'll update the repost (and add an "edited"
self.handle_matching_reaction(ctx, gs, mr.count, &msg, &guild.guild_id) // to the message)
.await?; // whenever someone reacts with any reaction
break; if !Self::emoji_match(&reaction.emoji, emoji) {
return Ok(());
}
let reaction_count = Self::find_emoji_match(msg.reactions.iter(), emoji);
let guild_id = guild.guild_id;
let emoji = guild_id
.emoji(ctx, emoji)
.await
.context("Could not get emoji from guild")?;
let name = msg
.author
.nick_in(ctx, guild_id)
.await
.unwrap_or_else(|| msg.author.tag());
let image = msg
.attachments
.iter()
.filter(|a| a.width.is_some())
.map(|a| &a.url)
.next()
.cloned();
let handler = Self {
conn,
server_settings: gs,
reaction_count,
msg,
emoji,
name,
image,
};
handler.process_match(ctx).await?;
Ok(())
}
async fn process_match(&self, ctx: &Context) -> anyhow::Result<()> {
let original_id = BigDecimal::from(self.msg.id.0);
diesel::insert_into(starboard_mappings::dsl::starboard_mappings)
.values(starboard_mappings::columns::original_id.eq(&original_id))
.returning(starboard_mappings::columns::repost_id)
.on_conflict_do_nothing()
.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.deref_mut())?;
let repost_id: &Option<BigDecimal> =
repost_id.first().context("Insert of mapping failed")?;
match repost_id {
Some(id) => {
self.edit_existing_starboard_message(
ctx,
id.to_u64()
.context("Could not convert repost message id to a u64")?,
)
.await?;
}
None => {
if self.reaction_count >= self.server_settings.starboard_threshold as u64 {
// post to repost
let repost = self.post_new_starboard_message(ctx).await?;
// update the DB
let repost_id = BigDecimal::from_u64(repost);
diesel::update(
starboard_mappings::dsl::starboard_mappings
.filter(starboard_mappings::columns::original_id.eq(original_id)),
)
.set(starboard_mappings::columns::repost_id.eq(repost_id))
.execute(self.conn.lock().await.deref_mut())?;
} }
} }
} }
...@@ -59,83 +149,64 @@ impl StarboardHandler { ...@@ -59,83 +149,64 @@ impl StarboardHandler {
Ok(()) Ok(())
} }
async fn handle_matching_reaction( async fn post_new_starboard_message(&self, ctx: &Context) -> anyhow::Result<u64> {
let repost = ChannelId(
self.server_settings
.starboard_channel
.to_u64()
.context("Could not convert starboard channel to a u64")?,
)
.send_message(ctx, |m| m.embed(|e| self.clone().starboard_message(e)))
.await?;
Ok(repost.id.0)
}
async fn edit_existing_starboard_message(
&self, &self,
ctx: &Context, ctx: &Context,
gs: &ServerSetting, message_id: u64,
count: u64,
msg: &Message,
guild: &GuildId,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
if count >= gs.starboard_threshold as u64 { let channel_id = ChannelId(
let original_id = BigDecimal::from(msg.id.0); self.server_settings
diesel::insert_into(starboard_mappings::dsl::starboard_mappings) .starboard_channel
.values(starboard_mappings::columns::original_id.eq(&original_id)) .to_u64()
.returning(starboard_mappings::columns::repost_id) .context("Could not convert starboard channel to a u64")?,
.on_conflict_do_nothing() );
.execute(&*self.conn.lock().await)?;
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)?;
let repost_id: &Option<BigDecimal> =
repost_id.get(0).context("Insert of mapping failed")?;
if repost_id.is_none() {
// post to repost channel
let name = msg
.author
.nick_in(&ctx, guild)
.await
.unwrap_or_else(|| msg.author.tag());
let image = msg
.attachments
.iter()
.filter(|a| a.width.is_some())
.map(|a| &a.url)
.next();
let repost = ChannelId(
gs.starboard_channel
.to_u64()
.context("Could not convert starboard channel to a u64")?,
)
.send_message(ctx, |m| {
m.embed(|e| {
let mut e = e
.description(format!(
"[Jump to source]({})\n{}",
msg.link(),
msg.content
))
.author(|a| a.name(&name).icon_url(msg.author.face()))
.timestamp(&msg.timestamp);
if let Some(url) = image {
e = e.image(url);
}
e
})
})
.await?;
// update the DB let mut msg = channel_id.message(ctx, message_id).await?;
let repost_id = BigDecimal::from_u64(repost.id.0); msg.edit(ctx, |m| m.embed(|e| self.clone().starboard_message(e)))
diesel::update( .await?;
starboard_mappings::dsl::starboard_mappings
.filter(starboard_mappings::columns::original_id.eq(original_id)), Ok(())
) }
.set(starboard_mappings::columns::repost_id.eq(repost_id))
.execute(&*self.conn.lock().await)?; fn starboard_message(self, e: &mut CreateEmbed) -> &mut CreateEmbed {
let mut e = e
.description(format!(
"[Jump to source]({})\n{}",
self.msg.link(),
self.msg.content
))
.title(format!("{} {}", self.reaction_count, self.emoji))
.author(|a| a.name(&self.name).icon_url(self.msg.author.face()))
.timestamp(self.msg.timestamp);
if let Some(url) = self.image {
e = e.image(url);
}
e
}
fn find_emoji_match<'a, I: Iterator<Item = &'a MessageReaction>>(iter: I, em: EmojiId) -> u64 {
for mr in iter {
if Self::emoji_match(&mr.reaction_type, em) {
return mr.count;
} }
} }
Ok(()) 0
} }
fn emoji_match(rt: &ReactionType, em: EmojiId) -> bool { fn emoji_match(rt: &ReactionType, em: EmojiId) -> bool {
...@@ -143,11 +214,31 @@ impl StarboardHandler { ...@@ -143,11 +214,31 @@ impl StarboardHandler {
} }
} }
pub struct StarboardHandler {
conn: Arc<Mutex<PgConnection>>,
}
impl StarboardHandler {
pub fn new(conn: Arc<Mutex<PgConnection>>) -> Self {
Self { conn }
}
async fn handle_reaction(&self, ctx: &Context, reaction: &Reaction) -> anyhow::Result<()> {
SingleMessageHandler::handle_reaction(self.conn.clone(), ctx, reaction).await
}
}
#[async_trait] #[async_trait]
impl ReactionHandler for StarboardHandler { impl ReactionHandler for StarboardHandler {
async fn reaction(&self, ctx: &Context, reaction: &Reaction) { async fn reaction_add(&self, ctx: &Context, reaction: &Reaction) {
if let Err(e) = self.handle_reaction(ctx, reaction).await {
eprintln!("Error in starboard: {e:?}");
}
}
async fn reaction_del(&self, ctx: &Context, reaction: &Reaction) {
if let Err(e) = self.handle_reaction(ctx, reaction).await { 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> { ...@@ -35,7 +35,7 @@ impl<'a> WrappingLayoutIter<'a> {
} }
} }
impl<'a> Iterator for WrappingLayoutIter<'a> { impl Iterator for WrappingLayoutIter<'_> {
type Item = Vec<(i32, i32, f32)>; type Item = Vec<(i32, i32, f32)>;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
......
...@@ -7,8 +7,9 @@ use serenity::async_trait; ...@@ -7,8 +7,9 @@ use serenity::async_trait;
use serenity::model::channel::{AttachmentType, Message, ReactionType}; use serenity::model::channel::{AttachmentType, Message, ReactionType};
use serenity::model::id::UserId; use serenity::model::id::UserId;
use serenity::prelude::*; use serenity::prelude::*;
use std::borrow::{Borrow, Cow}; use std::borrow::Cow;
use std::collections::HashMap; use std::collections::HashMap;
use std::ops::DerefMut;
use std::str::FromStr; use std::str::FromStr;
use std::sync::Arc; use std::sync::Arc;
use tokio::sync::Mutex; use tokio::sync::Mutex;
...@@ -106,7 +107,7 @@ impl XbasicHandler { ...@@ -106,7 +107,7 @@ impl XbasicHandler {
if let Some(name) = line.strip_prefix("PUB ") { if let Some(name) = line.strip_prefix("PUB ") {
if self.publish_program(name, msg, ctx).await.is_none() { if self.publish_program(name, msg, ctx).await.is_none() {
msg.channel_id msg.channel_id
.say(&ctx, format!("Could not publish {}.", name)) .say(&ctx, format!("Could not publish {name}."))
.await .await
.unwrap(); .unwrap();
} }
...@@ -115,7 +116,7 @@ impl XbasicHandler { ...@@ -115,7 +116,7 @@ impl XbasicHandler {
if let Some(name) = line.strip_prefix("UNPUB ") { if let Some(name) = line.strip_prefix("UNPUB ") {
if self.unpublish_program(name, msg, ctx).await.is_none() { if self.unpublish_program(name, msg, ctx).await.is_none() {
msg.channel_id msg.channel_id
.say(&ctx, &format!("Could not unpublish {}.", name)) .say(&ctx, &format!("Could not unpublish {name}."))
.await .await
.unwrap(); .unwrap();
} }
...@@ -126,7 +127,7 @@ impl XbasicHandler { ...@@ -126,7 +127,7 @@ impl XbasicHandler {
Ok(id) => { Ok(id) => {
if self.load_published_program(msg, ctx, id).await.is_none() { if self.load_published_program(msg, ctx, id).await.is_none() {
msg.channel_id msg.channel_id
.say(&ctx, format!("Could not load {}.", id)) .say(&ctx, format!("Could not load {id}."))
.await .await
.unwrap(); .unwrap();
} }
...@@ -182,7 +183,7 @@ impl XbasicHandler { ...@@ -182,7 +183,7 @@ impl XbasicHandler {
async fn list_saved_programs(&self, msg: &Message, ctx: &Context) -> Option<()> { async fn list_saved_programs(&self, msg: &Message, ctx: &Context) -> Option<()> {
let program_names = 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 msg.channel_id
.say( .say(
&ctx, &ctx,
...@@ -200,7 +201,7 @@ impl XbasicHandler { ...@@ -200,7 +201,7 @@ impl XbasicHandler {
async fn list_published_programs(&self, msg: &Message, ctx: &Context) -> Option<()> { async fn list_published_programs(&self, msg: &Message, ctx: &Context) -> Option<()> {
let program_names: Vec<String> = 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() .iter()
.map(|row| format!("{}\t{}", row.0, row.1)) .map(|row| format!("{}\t{}", row.0, row.1))
.collect(); .collect();
...@@ -220,10 +221,15 @@ impl XbasicHandler { ...@@ -220,10 +221,15 @@ impl XbasicHandler {
} }
async fn publish_program(&self, name: &str, msg: &Message, ctx: &Context) -> Option<()> { 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 msg.channel_id
.say(&ctx, format!("Published {}.", name)) .say(&ctx, format!("Published {name}."))
.await .await
.unwrap(); .unwrap();
...@@ -232,14 +238,14 @@ impl XbasicHandler { ...@@ -232,14 +238,14 @@ impl XbasicHandler {
async fn unpublish_program(&self, name: &str, msg: &Message, ctx: &Context) -> Option<()> { async fn unpublish_program(&self, name: &str, msg: &Message, ctx: &Context) -> Option<()> {
Program::set_program_published( Program::set_program_published(
self.conn.lock().await.borrow(), self.conn.lock().await.deref_mut(),
name, name,
msg.author.id, msg.author.id,
false, false,
)?; )?;
msg.channel_id msg.channel_id
.say(&ctx, format!("Unpublished {}.", name)) .say(&ctx, format!("Unpublished {name}."))
.await .await
.unwrap(); .unwrap();
...@@ -248,10 +254,10 @@ impl XbasicHandler { ...@@ -248,10 +254,10 @@ impl XbasicHandler {
async fn load_published_program(&self, msg: &Message, ctx: &Context, id: i32) -> Option<()> { async fn load_published_program(&self, msg: &Message, ctx: &Context, id: i32) -> Option<()> {
let name = get_user_programs!(self, &msg.author.id) 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 msg.channel_id
.say(&ctx, format!("Loaded {} (\"{}\") into memory.", id, name)) .say(&ctx, format!("Loaded {id} (\"{name}\") into memory."))
.await .await
.unwrap(); .unwrap();
...@@ -273,14 +279,14 @@ impl XbasicHandler { ...@@ -273,14 +279,14 @@ impl XbasicHandler {
async fn interpreter_load(&self, name: &str, msg: &Message, ctx: &Context) { async fn interpreter_load(&self, name: &str, msg: &Message, ctx: &Context) {
let result = get_user_programs!(self, &msg.author.id).load_program( let result = get_user_programs!(self, &msg.author.id).load_program(
&*self.conn.lock().await, self.conn.lock().await.deref_mut(),
msg.author.id, msg.author.id,
name, name,
); );
match result { match result {
Some(_) => { Some(_) => {
msg.channel_id msg.channel_id
.say(&ctx, format!("Loaded {} into memory.", name)) .say(&ctx, format!("Loaded {name} into memory."))
.await .await
.unwrap(); .unwrap();
} }
...@@ -295,14 +301,14 @@ impl XbasicHandler { ...@@ -295,14 +301,14 @@ impl XbasicHandler {
async fn interpreter_save(&self, name: &str, msg: &Message, ctx: &Context) { async fn interpreter_save(&self, name: &str, msg: &Message, ctx: &Context) {
let result = get_user_programs!(self, &msg.author.id).save_program( let result = get_user_programs!(self, &msg.author.id).save_program(
&*self.conn.lock().await, self.conn.lock().await.deref_mut(),
msg.author.id, msg.author.id,
name, name,
); );
match result { match result {
Some(_) => { Some(_) => {
msg.channel_id msg.channel_id
.say(&ctx, format!("Saved as {}", name)) .say(&ctx, format!("Saved as {name}"))
.await .await
.unwrap(); .unwrap();
} }
...@@ -345,11 +351,8 @@ impl XbasicHandler { ...@@ -345,11 +351,8 @@ impl XbasicHandler {
let green = args[3].clone().into_decimal() as u8; let green = args[3].clone().into_decimal() as u8;
let blue = args[4].clone().into_decimal() as u8; let blue = args[4].clone().into_decimal() as u8;
match &mut io.frame { if let Some(fb) = &mut io.frame {
Some(fb) => { fb.set_pixel(x, y, red, green, blue, 255);
fb.set_pixel(x, y, red, green, blue, 255);
}
None => {}
} }
ExprValue::Decimal(0.0) ExprValue::Decimal(0.0)
...@@ -358,7 +361,7 @@ impl XbasicHandler { ...@@ -358,7 +361,7 @@ impl XbasicHandler {
let mut xb = xbb.build(); 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 { let errors = if xb.error_handler.had_errors || xb.error_handler.had_runtime_error {
Some(xb.error_handler.errors.join("\n")) Some(xb.error_handler.errors.join("\n"))
......
...@@ -25,10 +25,10 @@ async fn main() { ...@@ -25,10 +25,10 @@ async fn main() {
.union(GatewayIntents::GUILD_MESSAGE_REACTIONS) .union(GatewayIntents::GUILD_MESSAGE_REACTIONS)
.union(GatewayIntents::MESSAGE_CONTENT), .union(GatewayIntents::MESSAGE_CONTENT),
) )
.event_handler(Dispatcher::default()) .event_handler(Dispatcher::new(config.llama))
.await .await
.expect("Error creating client"); .expect("Error creating client");
if let Err(e) = client.start().await { if let Err(e) = client.start().await {
eprintln!("Client error: {}", e); eprintln!("Client error: {e}");
} }
} }
use crate::schema::user_programs; use crate::schema::user_programs;
use bigdecimal::BigDecimal; use bigdecimal::BigDecimal;
#[derive(Queryable)]
pub struct UserProgram {
pub id: i32,
pub discord_user_id: u64,
pub name: String,
pub code: String,
}
#[derive(Insertable)] #[derive(Insertable)]
#[table_name = "user_programs"] #[diesel(table_name = user_programs)]
pub struct NewUserProgram<'a> { pub struct NewUserProgram<'a> {
pub discord_user_id: BigDecimal, pub discord_user_id: BigDecimal,
pub name: &'a str, pub name: &'a str,
pub code: &'a str, pub code: &'a str,
} }
#[derive(Queryable)] #[derive(Clone, Queryable)]
pub struct ServerSetting { pub struct ServerSetting {
#[allow(dead_code)]
pub id: i32, pub id: i32,
#[allow(dead_code)]
pub guild_id: BigDecimal, pub guild_id: BigDecimal,
pub starboard_threshold: i32, pub starboard_threshold: i32,
pub starboard_emoji_id: BigDecimal, pub starboard_emoji_id: BigDecimal,
......
...@@ -18,7 +18,7 @@ impl Program { ...@@ -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 user_programs
.filter(columns::discord_user_id.eq(BigDecimal::from_u64(*user_id.as_u64()).unwrap())) .filter(columns::discord_user_id.eq(BigDecimal::from_u64(*user_id.as_u64()).unwrap()))
.select(columns::name) .select(columns::name)
...@@ -26,7 +26,7 @@ impl Program { ...@@ -26,7 +26,7 @@ impl Program {
.ok() .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 user_programs
.filter(columns::published.eq(1)) .filter(columns::published.eq(1))
.select((columns::id, columns::name)) .select((columns::id, columns::name))
...@@ -34,7 +34,7 @@ impl Program { ...@@ -34,7 +34,7 @@ impl Program {
.ok() .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 let program: Vec<(String, String)> = user_programs
.filter(columns::id.eq(id).and(columns::published.eq(1))) .filter(columns::id.eq(id).and(columns::published.eq(1)))
.limit(1) .limit(1)
...@@ -55,7 +55,7 @@ impl Program { ...@@ -55,7 +55,7 @@ impl Program {
} }
pub fn set_program_published( pub fn set_program_published(
conn: &PgConnection, conn: &mut PgConnection,
name: &str, name: &str,
user_id: UserId, user_id: UserId,
published: bool, published: bool,
...@@ -67,7 +67,7 @@ impl Program { ...@@ -67,7 +67,7 @@ impl Program {
.and(columns::name.eq(name)), .and(columns::name.eq(name)),
), ),
) )
.set(columns::published.eq(if published { 1 } else { 0 })) .set(columns::published.eq(i32::from(published)))
.execute(conn) .execute(conn)
.ok()? == 1 .ok()? == 1
{ {
...@@ -99,7 +99,7 @@ impl Program { ...@@ -99,7 +99,7 @@ impl Program {
.join("\n") .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 code = self.stringy_line_nums();
let new_program = NewUserProgram { let new_program = NewUserProgram {
discord_user_id: BigDecimal::from_u64(*user_id.as_u64()).unwrap(), discord_user_id: BigDecimal::from_u64(*user_id.as_u64()).unwrap(),
...@@ -118,7 +118,12 @@ impl Program { ...@@ -118,7 +118,12 @@ impl Program {
Some(()) 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 let code: Vec<String> = user_programs
.filter( .filter(
columns::discord_user_id columns::discord_user_id
......