Compare commits
3 commits
61f3883611
...
99f145eb32
Author | SHA1 | Date | |
---|---|---|---|
![]() |
99f145eb32 | ||
![]() |
9d49e44b49 | ||
![]() |
4a119cd5a3 |
6 changed files with 625 additions and 0 deletions
394
Cargo.lock
generated
394
Cargo.lock
generated
|
@ -111,6 +111,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
<<<<<<< HEAD
|
||||
"axum-core",
|
||||
"bitflags 1.3.2",
|
||||
"bytes",
|
||||
"futures-util",
|
||||
"http",
|
||||
"http-body",
|
||||
"hyper",
|
||||
"itoa",
|
||||
"matchit",
|
||||
"memchr",
|
||||
"mime",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rustversion",
|
||||
"serde",
|
||||
"sync_wrapper",
|
||||
"tower",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "axum-core"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"futures-util",
|
||||
"http",
|
||||
"http-body",
|
||||
"mime",
|
||||
"rustversion",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
"axum-core 0.3.4",
|
||||
"bitflags 1.3.2",
|
||||
"bytes",
|
||||
|
@ -201,6 +240,7 @@ dependencies = [
|
|||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
>>>>>>> deke/ipertesto
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -225,12 +265,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "base64"
|
||||
version = "0.22.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -367,6 +411,9 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "core-foundation"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -383,6 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "cpufeatures"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -490,7 +538,11 @@ dependencies = [
|
|||
"serde_json",
|
||||
"sha256",
|
||||
"tokio",
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
"tower 0.5.2",
|
||||
>>>>>>> deke/ipertesto
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
@ -502,6 +554,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "encoding_rs"
|
||||
version = "0.8.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -511,6 +566,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "equivalent"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -527,6 +583,23 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
name = "flate2"
|
||||
version = "1.0.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "fastrand"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -571,6 +644,7 @@ checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
|
|||
dependencies = [
|
||||
"percent-encoding",
|
||||
]
|
||||
>>>>>>> deke/ipertesto
|
||||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
|
@ -686,6 +760,36 @@ dependencies = [
|
|||
"futures-core",
|
||||
"futures-sink",
|
||||
"futures-util",
|
||||
<<<<<<< HEAD
|
||||
"http",
|
||||
"indexmap 2.7.1",
|
||||
"slab",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.15.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||
|
||||
[[package]]
|
||||
name = "hdrhistogram"
|
||||
version = "7.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d"
|
||||
dependencies = [
|
||||
"base64",
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
"http 0.2.12",
|
||||
"indexmap 2.7.1",
|
||||
"slab",
|
||||
|
@ -732,6 +836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
>>>>>>> deke/ipertesto
|
||||
"byteorder",
|
||||
"flate2",
|
||||
"nom",
|
||||
|
@ -762,6 +867,92 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
name = "http-body"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httparse"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a"
|
||||
|
||||
[[package]]
|
||||
name = "httpdate"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||
|
||||
[[package]]
|
||||
name = "humantime"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "0.14.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
"http-body",
|
||||
"httparse",
|
||||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project-lite",
|
||||
"socket2",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
"want",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-timeout"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
|
||||
dependencies = [
|
||||
"hyper",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tokio-io-timeout",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"hashbrown 0.12.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.15.2",
|
||||
]
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "http"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1097,6 +1288,7 @@ name = "ipnet"
|
|||
version = "2.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
|
||||
>>>>>>> deke/ipertesto
|
||||
|
||||
[[package]]
|
||||
name = "is_terminal_polyfill"
|
||||
|
@ -1194,12 +1386,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "matchit"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "memchr"
|
||||
version = "2.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1239,6 +1435,9 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "native-tls"
|
||||
version = "0.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1256,6 +1455,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1300,6 +1500,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "openssl"
|
||||
version = "0.10.71"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1344,6 +1547,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "overload"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1425,12 +1629,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "pkg-config"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1557,6 +1765,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
"bitflags",
|
||||
=======
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1659,8 +1871,53 @@ dependencies = [
|
|||
"libc",
|
||||
"untrusted",
|
||||
"windows-sys 0.52.0",
|
||||
>>>>>>> deke/ipertesto
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
"regex-automata 0.4.9",
|
||||
"regex-syntax 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
|
||||
dependencies = [
|
||||
"regex-syntax 0.6.29",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.4.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
"regex-syntax 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.24"
|
||||
|
@ -1681,6 +1938,9 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "rustls"
|
||||
version = "0.23.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1720,6 +1980,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "rustversion"
|
||||
version = "1.0.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1857,12 +2118,16 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "signal-hook"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -1946,6 +2211,17 @@ dependencies = [
|
|||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.95"
|
||||
|
@ -1964,6 +2240,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
name = "thread_local"
|
||||
version = "1.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "sync_wrapper"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -2036,6 +2322,7 @@ checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
|
|||
dependencies = [
|
||||
"displaydoc",
|
||||
"zerovec",
|
||||
>>>>>>> deke/ipertesto
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2079,6 +2366,98 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
name = "tokio-stream"
|
||||
version = "0.1.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tonic"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"axum",
|
||||
"base64",
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
"http-body",
|
||||
"hyper",
|
||||
"hyper-timeout",
|
||||
"percent-encoding",
|
||||
"pin-project",
|
||||
"prost",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tower",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower"
|
||||
version = "0.4.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"indexmap 1.9.3",
|
||||
"pin-project",
|
||||
"pin-project-lite",
|
||||
"rand 0.8.5",
|
||||
"slab",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower-layer"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
|
||||
|
||||
[[package]]
|
||||
name = "tower-service"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
|
||||
dependencies = [
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "tokio-native-tls"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -2205,6 +2584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
|
||||
dependencies = [
|
||||
"log",
|
||||
>>>>>>> deke/ipertesto
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
|
@ -2320,12 +2700,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
name = "vcpkg"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
>>>>>>> deke/ipertesto
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
@ -2573,6 +2957,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
"bitflags",
|
||||
=======
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2609,6 +2997,7 @@ dependencies = [
|
|||
"quote",
|
||||
"syn 2.0.95",
|
||||
"synstructure",
|
||||
>>>>>>> deke/ipertesto
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2650,6 +3039,10 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.95",
|
||||
<<<<<<< HEAD
|
||||
||||||| 45f9b5b
|
||||
"syn",
|
||||
=======
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2699,4 +3092,5 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.95",
|
||||
>>>>>>> deke/ipertesto
|
||||
]
|
||||
|
|
11
Cargo.toml
11
Cargo.toml
|
@ -24,7 +24,13 @@ http-body-util = "0.1"
|
|||
hyper-util = { version = "0.1", features = ["full"] }
|
||||
rand = "0.9.0-beta.1"
|
||||
clap = "4.5.23"
|
||||
<<<<<<< HEAD
|
||||
tokio = { version = "1.42.0", features = ["full", "tracing"] }
|
||||
||||||| 45f9b5b
|
||||
tokio = { version = "1.42.0", features = ["full"] }
|
||||
=======
|
||||
tokio = { version = "1.42.0", features = ["full","tracing"] }
|
||||
>>>>>>> deke/ipertesto
|
||||
console-subscriber = "0.1.5"
|
||||
anyhow = "1.0.95"
|
||||
serde_json = "1.0.135"
|
||||
|
@ -34,3 +40,8 @@ petname = "2.0.2"
|
|||
crossterm = "0.28.1"
|
||||
tracing = "0.1.41"
|
||||
tracing-subscriber = "0.3.19"
|
||||
<<<<<<< HEAD
|
||||
|
||||
||||||| 45f9b5b
|
||||
=======
|
||||
>>>>>>> deke/ipertesto
|
||||
|
|
|
@ -8,6 +8,7 @@ use crossterm::{
|
|||
disable_raw_mode, enable_raw_mode, Clear, ClearType, EnableLineWrap, EnterAlternateScreen
|
||||
}
|
||||
};
|
||||
use tokio::io::{self, AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
const HELP: &str = r#"CIAOTERPIA
|
||||
atm posso fare questo:
|
||||
|
@ -24,17 +25,56 @@ fn create_message_player(player: &Player) -> anyhow::Result<Message, anyhow::Err
|
|||
)
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
let (mut rd, mut wr) = io::split(client.stream);
|
||||
||||||| 45f9b5b
|
||||
// tokio::task::spawn(async move {
|
||||
client.send_message(Message::new(&local_address.to_string(), MessageKind::Test, "test json").unwrap()).await.expect("failed to write to socket");
|
||||
=======
|
||||
async fn delete_player(player: &Player, client: reqwest::Client, addr: &str) -> anyhow::Result<()> {
|
||||
let player_id = &player.name;
|
||||
let response = client
|
||||
.get([&addr, "/delete/", &player_id].concat())
|
||||
.send().await;
|
||||
>>>>>>> deke/ipertesto
|
||||
|
||||
<<<<<<< HEAD
|
||||
let mut buf: Vec<u8> = Vec::with_capacity(4);
|
||||
let mut message_reader = MessageReader::new();
|
||||
||||||| 45f9b5b
|
||||
// let (mut rd, mut wr) = client.stream.split();
|
||||
=======
|
||||
if let Err(e) = &response {
|
||||
println!("{e}\n");
|
||||
return Ok(())
|
||||
}
|
||||
>>>>>>> deke/ipertesto
|
||||
|
||||
<<<<<<< HEAD
|
||||
loop {
|
||||
match rd.read_exact(&mut buf).await {
|
||||
Ok(0) => {
|
||||
println!("connection closed by server");
|
||||
continue;
|
||||
},
|
||||
Ok(n) => {
|
||||
let mut buf = Vec::with_capacity(n);
|
||||
rd.read_exact(&mut buf).await?;
|
||||
let message = message_reader.read(&buf)?;
|
||||
println!("{:?}", message);
|
||||
},
|
||||
Err(e) => eprintln!("failed reading from socket: {}", e),
|
||||
}
|
||||
}
|
||||
||||||| 45f9b5b
|
||||
// let mut message_reader = MessageReader::new();
|
||||
|
||||
// 'handler: loop {
|
||||
// let mut buffer = vec![];
|
||||
// if tokio::io::copy(&mut rd, &mut buffer).await.is_err() {
|
||||
// println!("failed to copy");
|
||||
// }
|
||||
=======
|
||||
println!("{}", response?.text().await?);
|
||||
|
||||
Ok(())
|
||||
|
@ -109,6 +149,63 @@ pub async fn main() -> anyhow::Result<()> {
|
|||
|
||||
handle_terminal(&player, &mut stdout, client.clone(), &addr).await?;
|
||||
disable_raw_mode()?;
|
||||
>>>>>>> deke/ipertesto
|
||||
|
||||
<<<<<<< HEAD
|
||||
// loop {
|
||||
// let n = rd.read_exact(&mut buf).await.expect("fallito lettura");
|
||||
|
||||
// if n == 0 {
|
||||
// break;
|
||||
// }
|
||||
|
||||
// let message = message_reader.read(&buf)?;
|
||||
// println!("GOT {:?}", message);
|
||||
|
||||
// let response = match &message.message_kind {
|
||||
// MessageKind::Test => Message::new(&local_address.to_string(), MessageKind::Test, "risposta")?.as_bytes_vec()?,
|
||||
// MessageKind::Move => todo!(),
|
||||
// MessageKind::CreatePlayer => todo!(),
|
||||
// MessageKind::CreateLobby => todo!(),
|
||||
// };
|
||||
|
||||
// wr.write_all(&response.as_bytes()).await?;
|
||||
|
||||
// buf.clear();
|
||||
// message_reader.buffer.clear();
|
||||
// break;
|
||||
// }
|
||||
|
||||
// disable_raw_mode()?;
|
||||
|
||||
||||||| 45f9b5b
|
||||
|
||||
// let message = message_reader.read(&buffer).expect("failed to read from socket");
|
||||
// println!("{:?}", message);
|
||||
|
||||
// break 'handler;
|
||||
// }
|
||||
// });
|
||||
// client.send_message(Message::new(&local_address.to_string(), MessageKind::Test, "test json").unwrap()).await?;
|
||||
|
||||
// let (mut rd, mut wr) = client.stream.split();
|
||||
|
||||
// let mut message_reader = MessageReader::new();
|
||||
|
||||
// 'handler: loop {
|
||||
// let mut buffer = vec![];
|
||||
// if tokio::io::copy(&mut rd, &mut buffer).await.is_err() {
|
||||
// println!("failed to copy");
|
||||
// }
|
||||
|
||||
// let message = message_reader.read(&buffer)?;
|
||||
// println!("{:?}", message);
|
||||
|
||||
// break 'handler;
|
||||
// }
|
||||
|
||||
// disable_raw_mode()?;
|
||||
=======
|
||||
>>>>>>> deke/ipertesto
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@ use lib::server::Server;
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
console_subscriber::init();
|
||||
// tracing::subscriber::set_global_default(subscriber)?;
|
||||
|
||||
let mut server = Server::new("127.0.0.1", 8080);
|
||||
server.run().await?;
|
||||
Ok(())
|
||||
|
|
|
@ -7,6 +7,8 @@ pub struct Message {
|
|||
pub from: String,
|
||||
pub message_kind: MessageKind,
|
||||
pub content: String,
|
||||
// placeholder for the future
|
||||
// pub previous: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
@ -42,6 +44,18 @@ impl Message {
|
|||
|
||||
Ok(message)
|
||||
}
|
||||
|
||||
pub fn as_bytes_vec(&self) -> anyhow::Result<Vec<u8>> {
|
||||
let message_json = self.encode()?;
|
||||
let message_bytes: &[u8] = message_json.as_bytes();
|
||||
let bytes_length: u32 = message_bytes.len() as u32;
|
||||
|
||||
let mut buffer = Vec::new();
|
||||
buffer.extend(bytes_length.to_be_bytes());
|
||||
buffer.extend(message_bytes);
|
||||
|
||||
Ok(buffer)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Message {
|
||||
|
|
106
src/server.rs
106
src/server.rs
|
@ -1,8 +1,21 @@
|
|||
<<<<<<< HEAD
|
||||
use tokio::{io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}, net::{tcp::WriteHalf, TcpListener}, sync::mpsc};
|
||||
use tokio::sync::broadcast;
|
||||
use std::{collections::HashMap, net::SocketAddr};
|
||||
use tokio::net::TcpStream;
|
||||
use crate::{message::{Message, MessageKind}, message_read::MessageReader, server};
|
||||
||||||| 45f9b5b
|
||||
use tokio::{io::{AsyncReadExt, AsyncWriteExt, BufReader}, net::{tcp::WriteHalf, TcpListener}};
|
||||
use std::net::SocketAddr;
|
||||
use crate::{message::{Message, MessageKind}, message_read::MessageReader, server};
|
||||
=======
|
||||
use tokio::net::TcpListener;
|
||||
use crate::router::App;
|
||||
|
||||
use axum::routing::{get, post};
|
||||
>>>>>>> deke/ipertesto
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Server {
|
||||
pub host: String,
|
||||
pub port: u16,
|
||||
|
@ -16,7 +29,40 @@ impl Server {
|
|||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
async fn process_connection(mut stream: TcpStream, addr: SocketAddr) -> anyhow::Result<()> {
|
||||
let (mut rd, mut wr) = stream.split();
|
||||
|
||||
let message = Message::new(&addr.to_string(), MessageKind::Test, "risposta")?.as_bytes_vec()?;
|
||||
wr.write_all(&message).await?;
|
||||
|
||||
let mut message_reader = MessageReader::new();
|
||||
let mut buf = Vec::with_capacity(4);
|
||||
|
||||
match rd.read_exact(&mut buf).await {
|
||||
Ok(0) => {
|
||||
println!("connection closed by client");
|
||||
return Ok(())
|
||||
},
|
||||
Ok(n) => {
|
||||
let mut buf = Vec::with_capacity(n);
|
||||
rd.read_exact(&mut buf).await?;
|
||||
let message = message_reader.read(&buf).expect("fallito lettura buffer");
|
||||
println!("{:?}", message);
|
||||
},
|
||||
Err(e) => eprintln!("failed reading from socket: {}", e),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
#[tracing::instrument]
|
||||
||||||| 45f9b5b
|
||||
#[allow(unreachable_code)]
|
||||
=======
|
||||
|
||||
>>>>>>> deke/ipertesto
|
||||
pub async fn run(&mut self) -> anyhow::Result<()> {
|
||||
let listener = TcpListener::bind(format!(
|
||||
"{}:{}",
|
||||
|
@ -25,6 +71,65 @@ impl Server {
|
|||
)).await?;
|
||||
println!("Server is running on {}:{}", self.host, self.port);
|
||||
|
||||
<<<<<<< HEAD
|
||||
// let mut db = HashMap::new();
|
||||
|
||||
loop {
|
||||
match listener.accept().await {
|
||||
Ok((stream, addr)) => {
|
||||
println!("connected to: {}", addr);
|
||||
tokio::spawn(async move {
|
||||
Self::process_connection(stream, addr).await;
|
||||
});
|
||||
},
|
||||
Err(e) => eprintln!("error connecting: {}", e)
|
||||
}
|
||||
}
|
||||
|
||||
||||||| 45f9b5b
|
||||
loop {
|
||||
let (mut socket, addr) = listener.accept().await?;
|
||||
println!("Connection received from {}", addr);
|
||||
|
||||
tokio::task::spawn(async move {
|
||||
let mut message_reader = MessageReader::new();
|
||||
|
||||
|
||||
let (mut rd, mut wr) = socket.split();
|
||||
let mut bufread = BufReader::new(&mut rd);
|
||||
|
||||
'handler: loop {
|
||||
let mut buffer = vec![];
|
||||
let _bytes_read = match bufread.read_to_end(&mut buffer).await {
|
||||
Ok(0) => {
|
||||
println!("connection closed by client");
|
||||
break 'handler;
|
||||
},
|
||||
Ok(_n) => {
|
||||
let message = message_reader.read(&buffer).expect("failed to parse message");
|
||||
println!("{:?}", message); },
|
||||
Err(e) => {
|
||||
eprintln!("error reading from stream: {}", e);
|
||||
break 'handler;
|
||||
},
|
||||
};
|
||||
// if tokio::io::copy(&mut rd, &mut buffer).await.is_err() {
|
||||
// eprintln!("failed to copy");
|
||||
// }
|
||||
|
||||
// let message = message_reader.read(&buffer)?;
|
||||
// println!("{:?}", message);
|
||||
|
||||
// let local_address = &rd.local_addr()?;
|
||||
// let message_client = Message::new(&local_address.to_string(), MessageKind::Test, "toto test")?;
|
||||
// wr.write_all(&message_client.encode()?.as_bytes()).await?;
|
||||
}
|
||||
|
||||
Ok::<(), anyhow::Error>(())
|
||||
});
|
||||
}
|
||||
|
||||
=======
|
||||
let app = App::new();
|
||||
|
||||
let router = app.router
|
||||
|
@ -36,6 +141,7 @@ impl Server {
|
|||
|
||||
axum::serve(listener, router).await.unwrap();
|
||||
|
||||
>>>>>>> deke/ipertesto
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue