diff --git a/Cargo.lock b/Cargo.lock index e3e1ec2e..3f3a3565 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.3.4", + "getrandom 0.3.3", "once_cell", "version_check", "zerocopy", @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -46,6 +46,21 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anes" version = "0.1.6" @@ -54,15 +69,15 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.14" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "approx" @@ -84,12 +99,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.9.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" -dependencies = [ - "rustversion", -] +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arcstr" @@ -110,13 +122,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.89" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -136,15 +148,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.8.8" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" dependencies = [ "axum-core", "bytes", @@ -161,7 +173,8 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", - "serde_core", + "rustversion", + "serde", "serde_json", "serde_path_to_error", "serde_urlencoded", @@ -175,9 +188,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" dependencies = [ "bytes", "futures-core", @@ -186,12 +199,25 @@ dependencies = [ "http-body-util", "mime", "pin-project-lite", + "rustversion", "sync_wrapper", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -200,9 +226,15 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.11.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -227,9 +259,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdd35008169921d80bc60d3d0ab416eecb028c4cd653352907921d95084790be" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" dependencies = [ "hybrid-array", ] @@ -241,15 +273,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969a9ba84b0ff843813e7249eed1678d9b6607ce5a3b8f0a47af3fcf7978e6e" dependencies = [ "ahash", - "base64", + "base64 0.22.1", "bitvec", - "getrandom 0.2.17", - "getrandom 0.3.4", + "getrandom 0.2.16", + "getrandom 0.3.3", "hex", - "indexmap", + "indexmap 2.9.0", "js-sys", "once_cell", - "rand 0.9.4", + "rand 0.9.1", "serde", "serde_bytes", "serde_json", @@ -264,26 +296,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3f109694c4f45353972af96bf97d8a057f82e2d6e496457f4d135b9867a518c" dependencies = [ "ahash", - "base64", + "base64 0.22.1", "bitvec", - "getrandom 0.3.4", + "getrandom 0.3.3", "hex", - "indexmap", + "indexmap 2.9.0", "js-sys", - "rand 0.9.4", + "rand 0.9.1", "serde", "serde_bytes", "simdutf8", - "thiserror", + "thiserror 2.0.18", "time", "uuid", ] [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" [[package]] name = "byteorder" @@ -293,9 +325,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" dependencies = [ "serde", ] @@ -318,19 +350,18 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.60" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ - "find-msvc-tools", "shlex", ] [[package]] name = "cfg-if" -version = "1.0.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "cfg_aliases" @@ -340,13 +371,26 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" dependencies = [ "cfg-if", "cpufeatures 0.3.0", - "rand_core 0.10.0", + "rand_core 0.10.1", +] + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-link 0.1.1", ] [[package]] @@ -378,18 +422,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.0" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.6.0" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstyle", "clap_lex", @@ -397,9 +441,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "1.1.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "cmov" @@ -409,14 +453,14 @@ checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" [[package]] name = "codspeed" -version = "4.4.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b684e94583e85a5ca7e1a6454a89d76a5121240f2fb67eb564129d9bafdb9db0" +checksum = "57af92d1db7f6871b7e82c79cd87f2501db66f36b0eab924be6ea83dd6b2f3f3" dependencies = [ "anyhow", "cc", "colored", - "getrandom 0.2.17", + "getrandom 0.2.16", "glob", "libc", "nix", @@ -427,9 +471,9 @@ dependencies = [ [[package]] name = "codspeed-criterion-compat" -version = "4.4.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e65444156eb73ad7f57618188f8d4a281726d133ef55b96d1dcff89528609ab" +checksum = "1d31ae2e9ab23c29fa13bdfa06d012524176f5c0f4e25ec262cd829d947ebc5e" dependencies = [ "clap", "codspeed", @@ -440,9 +484,9 @@ dependencies = [ [[package]] name = "codspeed-criterion-compat-walltime" -version = "4.4.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96389aaa4bbb872ea4924dc0335b2bb181bcf28d6eedbe8fea29afcc5bde36a6" +checksum = "cc8605e40bab5114dcb0f76268e18880082b5798dec10757b5b58d2c3bbc7a1c" dependencies = [ "anes", "cast", @@ -519,19 +563,16 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.17", + "getrandom 0.2.16", "once_cell", "tiny-keccak", ] [[package]] name = "convert_case" -version = "0.10.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" -dependencies = [ - "unicode-segmentation", -] +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie-factory" @@ -539,6 +580,12 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b" +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -568,9 +615,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" [[package]] name = "crc16" @@ -624,15 +671,15 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-common" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", "typenum", @@ -640,9 +687,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ "hybrid-array", ] @@ -658,9 +705,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.23.0" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -668,41 +715,43 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.23.0" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ + "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.101", ] [[package]] name = "darling_macro" -version = "0.23.0" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "data-encoding" -version = "2.10.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "deranged" -version = "0.5.8" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", + "serde", ] [[package]] @@ -713,52 +762,42 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "derive-where" -version = "1.6.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08b3a0bcc0d079199cd476b2cae8435016ec11d1c0986c6901c5ac223041534" +checksum = "e73f2692d4bd3cac41dca28934a39894200c9fabf49586d77d0e5954af1d7902" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "derive_arbitrary" -version = "1.4.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "derive_more" -version = "2.1.1" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn", - "unicode-xid", + "syn 2.0.101", ] [[package]] @@ -768,19 +807,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "crypto-common 0.1.7", + "crypto-common 0.1.6", "subtle", ] [[package]] name = "digest" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4850db49bf08e663084f7fb5c87d202ef91a3907271aff24a94eb97ff039153c" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ - "block-buffer 0.12.0", + "block-buffer 0.12.1", "const-oid", - "crypto-common 0.2.1", + "crypto-common 0.2.2", "ctutils", ] @@ -792,7 +831,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -829,7 +868,7 @@ dependencies = [ "serde", "serde_json", "smallvec", - "thiserror", + "thiserror 2.0.18", "tokio", "tokio-stream", "tokio-tungstenite", @@ -840,11 +879,38 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "engineioxide-client" +version = "0.17.0" +dependencies = [ + "bytes", + "engineioxide", + "engineioxide-core", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "pin-project-lite", + "serde", + "serde_json", + "smallvec", + "thiserror 2.0.18", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tokio-util", + "tracing", + "tracing-subscriber", +] + [[package]] name = "engineioxide-core" version = "0.2.2" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-util", "http", @@ -882,16 +948,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "etcetera" version = "0.11.0" @@ -929,12 +985,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - [[package]] name = "float-cmp" version = "0.10.0" @@ -945,10 +995,10 @@ dependencies = [ ] [[package]] -name = "foldhash" -version = "0.1.5" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" @@ -958,9 +1008,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -999,7 +1049,7 @@ checksum = "1458c6e22d36d61507034d5afecc64f105c1d39712b7ac6ec3b352c423f715cc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -1010,9 +1060,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1041,9 +1091,9 @@ checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1075,7 +1125,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -1132,43 +1182,41 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi 5.3.0", - "wasip2", + "r-efi 5.2.0", + "wasi 0.14.2+wasi-0.2.4", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "rand_core 0.10.0", - "wasip2", - "wasip3", + "rand_core 0.10.1", ] [[package]] @@ -1179,23 +1227,25 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "half" -version = "2.7.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", - "zerocopy", ] [[package]] name = "hashbrown" -version = "0.15.5" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash 0.1.5", -] +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "hashbrown" @@ -1205,20 +1255,14 @@ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ "allocator-api2", "equivalent", - "foldhash 0.2.0", + "foldhash", ] -[[package]] -name = "hashbrown" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - [[package]] name = "hashlink" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230" +checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f" dependencies = [ "hashbrown 0.16.1", ] @@ -1244,9 +1288,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -1278,14 +1322,14 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" dependencies = [ - "digest 0.11.2", + "digest 0.11.3", ] [[package]] name = "http" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" dependencies = [ "bytes", "itoa", @@ -1328,18 +1372,18 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hybrid-array" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3944cf8cf766b40e2a1a333ee5e9b563f854d5fa49d6a8ca2764e97c6eddb214" +checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" dependencies = [ "typenum", ] [[package]] name = "hyper" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" dependencies = [ "atomic-waker", "bytes", @@ -1353,15 +1397,17 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", + "want", ] [[package]] name = "hyper-util" -version = "0.1.20" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" dependencies = [ "bytes", + "futures-core", "http", "http-body", "hyper", @@ -1370,15 +1416,38 @@ dependencies = [ "tower-service", ] +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "icu_collections" -version = "2.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", "potential_utf", - "utf8_iter", "yoke", "zerofrom", "zerovec", @@ -1386,9 +1455,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -1399,10 +1468,11 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ + "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -1413,38 +1483,42 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "2.2.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ + "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", + "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.2.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "2.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", "icu_locale_core", + "stable_deref_trait", + "tinystr", "writeable", "yoke", "zerofrom", @@ -1452,12 +1526,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - [[package]] name = "ident_case" version = "1.0.1" @@ -1466,9 +1534,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.1.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ "idna_adapter", "smallvec", @@ -1487,25 +1555,35 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.14.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.17.0", + "hashbrown 0.15.4", "serde", - "serde_core", ] [[package]] name = "is-terminal" -version = "0.4.17" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1519,17 +1597,18 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.18" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] @@ -1539,47 +1618,42 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "libc" -version = "0.2.184" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libredox" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" dependencies = [ "libc", ] [[package]] name = "litemap" -version = "0.8.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.29" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "loom" @@ -1605,7 +1679,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -1619,7 +1693,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -1630,7 +1704,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -1641,16 +1715,16 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "matchers" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -1682,14 +1756,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" dependencies = [ "cfg-if", - "digest 0.11.2", + "digest 0.11.3", ] [[package]] name = "memchr" -version = "2.8.0" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "mime" @@ -1705,69 +1779,54 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mio" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.61.2", ] -[[package]] -name = "mongocrypt" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da0cd419a51a5fb44819e290fbdb0665a54f21dead8923446a799c7f4d26ad9" -dependencies = [ - "bson 2.15.0", - "mongocrypt-sys", - "once_cell", - "serde", -] - -[[package]] -name = "mongocrypt-sys" -version = "0.1.5+1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224484c5d09285a7b8cb0a0c117e847ebd14cb6e4470ecf68cdb89c503b0edb9" - [[package]] name = "mongodb" -version = "3.5.2" +version = "3.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5941683db2ab2697f71e58dc0319024e808d3b28e7cf20f4bfb445fe54a30b" +checksum = "d0f8c69f13acf07eae386a2974f48ffd9187ea2aba8defbea9aa34e7e272c5f3" dependencies = [ - "base64", - "bitflags", + "async-trait", + "base64 0.13.1", + "bitflags 1.3.2", "bson 2.15.0", + "chrono", "derive-where", "derive_more", "futures-core", + "futures-executor", "futures-io", "futures-util", "hex", "hmac 0.12.1", "macro_magic", "md-5 0.10.6", - "mongocrypt", "mongodb-internal-macros", + "once_cell", "pbkdf2", "percent-encoding", - "rand 0.9.4", + "rand 0.8.5", "rustc_version_runtime", "rustls", - "rustversion", + "rustls-pemfile", "serde", "serde_bytes", "serde_with", "sha1", "sha2 0.10.9", - "socket2 0.6.3", + "socket2 0.5.10", "stringprep", "strsim", "take_mut", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-rustls", "tokio-util", @@ -1778,23 +1837,23 @@ dependencies = [ [[package]] name = "mongodb-internal-macros" -version = "3.5.2" +version = "3.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47021a12bbf0dffde9c890fa2d36ff6ae342c532016226b04a42301b2b912660" +checksum = "b9202de265a3a8bbb43f9fe56db27c93137d4f9fb04c093f47e9c7de0c61ac7d" dependencies = [ "macro_magic", "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "nix" -version = "0.31.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ - "bitflags", + "bitflags 2.9.1", "cfg-if", "cfg_aliases", "libc", @@ -1812,18 +1871,19 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.50.3" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "windows-sys 0.61.2", + "overload", + "winapi", ] [[package]] name = "num-conv" -version = "0.2.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" @@ -1840,7 +1900,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags", + "bitflags 2.9.1", ] [[package]] @@ -1854,9 +1914,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.4" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "oorandom" @@ -1864,6 +1924,12 @@ version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parking" version = "2.2.1" @@ -1872,9 +1938,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.5" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -1882,31 +1948,37 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.12" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-link", + "windows-targets 0.52.6", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "pbkdf2" -version = "0.12.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", ] [[package]] name = "percent-encoding" -version = "2.3.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -1929,9 +2001,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "plotters" @@ -1963,11 +2035,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56201207dac53e2f38e848e31b4b91616a6bb6e0c7205b77718994a7f49e70fc" +checksum = "08808e3c483c46e999108051c78334f473d5adb59d78bb80a1268c7e6aa6c514" dependencies = [ - "base64", + "base64 0.22.1", "byteorder", "bytes", "fallible-iterator", @@ -1981,9 +2053,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc729a129e682e8d24170cd30ae1aa01b336b096cbb56df6d534ffec133d186" +checksum = "851ca9db4932932d69f3ea811b1abe63087a0f740a47692619dd40d4899b68be" dependencies = [ "bytes", "fallible-iterator", @@ -1992,9 +2064,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.5" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" dependencies = [ "zerovec", ] @@ -2014,39 +2086,29 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.45" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.3.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" [[package]] name = "r-efi" @@ -2073,12 +2135,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.5", + "rand_core 0.9.3", ] [[package]] @@ -2088,8 +2150,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" dependencies = [ "chacha20", - "getrandom 0.4.2", - "rand_core 0.10.0", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -2109,7 +2171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.5", + "rand_core 0.9.3", ] [[package]] @@ -2118,29 +2180,29 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.17", + "getrandom 0.2.16", ] [[package]] name = "rand_core" -version = "0.9.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.3.3", ] [[package]] name = "rand_core" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rayon" -version = "1.11.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -2148,9 +2210,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.13.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -2158,9 +2220,9 @@ dependencies = [ [[package]] name = "redis" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44e94c96d8870a387d88ce3de3fdd608cbfc0705f03cb343cdde91509d3e49a" +checksum = "2fa6f8e4b491d7a8ef3a9550a4d71969bd0064f46e32b8dbbcc7fc60dad94fed" dependencies = [ "arcstr", "async-lock", @@ -2173,9 +2235,9 @@ dependencies = [ "log", "percent-encoding", "pin-project-lite", - "rand 0.9.4", + "rand 0.10.1", "ryu", - "socket2 0.6.3", + "socket2 0.6.4", "tokio", "tokio-util", "url", @@ -2198,41 +2260,56 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.18" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ - "bitflags", + "bitflags 2.9.1", ] [[package]] name = "regex" -version = "1.12.3" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "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.14" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.5", ] [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" @@ -2242,7 +2319,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.17", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -2250,29 +2327,33 @@ dependencies = [ [[package]] name = "rmp" -version = "0.8.15" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba8be72d372b2c9b35542551678538b562e7cf86c3315773cae48dfbfe7790c" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" dependencies = [ + "byteorder", "num-traits", + "paste", ] [[package]] name = "rmp-serde" -version = "1.3.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" dependencies = [ + "byteorder", "rmp", "serde", ] [[package]] name = "rmpv" -version = "1.3.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4e1d4b9b938a26d2996af33229f0ca0956c652c1375067f0b45291c1df8417" +checksum = "58450723cd9ee93273ce44a20b6ec4efe17f8ed2e3631474387bfdecf18bb2a9" dependencies = [ + "num-traits", "rmp", "serde", "serde_bytes", @@ -2299,50 +2380,46 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.37" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "once_cell", "ring", - "rustls-pki-types", "rustls-webpki", - "subtle", - "zeroize", + "sct", ] [[package]] -name = "rustls-pki-types" -version = "1.14.0" +name = "rustls-pemfile" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "zeroize", + "base64 0.21.7", ] [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", - "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.23" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2365,75 +2442,72 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "semver" -version = "1.0.28" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde_core", "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.19" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" dependencies = [ "serde", - "serde_core", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" dependencies = [ - "indexmap", + "indexmap 2.9.0", "itoa", "memchr", + "ryu", "serde", - "serde_core", - "zmij", ] [[package]] name = "serde_path_to_error" -version = "0.1.20" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" dependencies = [ "itoa", "serde", - "serde_core", ] [[package]] @@ -2450,24 +2524,32 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.18.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "serde_core", + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.9.0", + "serde", + "serde_derive", + "serde_json", "serde_with_macros", + "time", ] [[package]] name = "serde_with_macros" -version = "3.18.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -2500,7 +2582,7 @@ checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" dependencies = [ "cfg-if", "cpufeatures 0.3.0", - "digest 0.11.2", + "digest 0.11.3", ] [[package]] @@ -2520,11 +2602,10 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.8" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ - "errno", "libc", ] @@ -2536,15 +2617,18 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" [[package]] name = "slab" -version = "0.4.12" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" @@ -2567,9 +2651,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", "windows-sys 0.61.2", @@ -2598,7 +2682,7 @@ dependencies = [ "socketioxide-parser-common", "socketioxide-parser-msgpack", "state", - "thiserror", + "thiserror 2.0.18", "tokio", "tokio-stream", "tokio-tungstenite", @@ -2621,7 +2705,7 @@ dependencies = [ "serde", "serde_json", "smallvec", - "thiserror", + "thiserror 2.0.18", ] [[package]] @@ -2654,7 +2738,7 @@ dependencies = [ "smallvec", "socketioxide", "socketioxide-core", - "thiserror", + "thiserror 2.0.18", "tokio", "tracing", "tracing-subscriber", @@ -2702,7 +2786,7 @@ dependencies = [ "socketioxide", "socketioxide-core", "sqlx", - "thiserror", + "thiserror 2.0.18", "tokio", "tokio-postgres", "tracing", @@ -2727,7 +2811,7 @@ dependencies = [ "smallvec", "socketioxide", "socketioxide-core", - "thiserror", + "thiserror 2.0.18", "tokio", "tracing", "tracing-subscriber", @@ -2750,7 +2834,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b44e85bf579a8eeb4ceaa77a3a523baf2bf0e9bac7e40f405d537b5d2d5ccb" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "cfg-if", "crc", @@ -2763,7 +2847,7 @@ dependencies = [ "futures-util", "hashbrown 0.16.1", "hashlink", - "indexmap", + "indexmap 2.9.0", "log", "memchr", "percent-encoding", @@ -2771,7 +2855,7 @@ dependencies = [ "serde_json", "sha2 0.10.9", "smallvec", - "thiserror", + "thiserror 2.0.18", "tokio", "tokio-stream", "tracing", @@ -2788,7 +2872,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn", + "syn 2.0.101", ] [[package]] @@ -2809,7 +2893,7 @@ dependencies = [ "sha2 0.10.9", "sqlx-core", "sqlx-postgres", - "syn", + "syn 2.0.101", "tokio", "url", ] @@ -2821,8 +2905,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87a2bdd6e83f6b3ea525ca9fee568030508b58355a43d0b2c1674d5f79dcd65e" dependencies = [ "atoi", - "base64", - "bitflags", + "base64 0.22.1", + "bitflags 2.9.1", "byteorder", "crc", "dotenvy", @@ -2844,16 +2928,16 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 2.0.18", "tracing", "whoami", ] [[package]] name = "stable_deref_trait" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "state" @@ -2899,9 +2983,20 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.117" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -2922,7 +3017,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] @@ -2937,13 +3032,33 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + [[package]] name = "thiserror" version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] @@ -2954,44 +3069,45 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", + "once_cell", ] [[package]] name = "time" -version = "0.3.47" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", - "serde_core", + "serde", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -3008,9 +3124,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -3028,9 +3144,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -3043,9 +3159,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.51.1" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "bytes", "libc", @@ -3053,7 +3169,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.3", + "socket2 0.6.4", "tokio-macros", "windows-sys 0.61.2", ] @@ -3066,14 +3182,14 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "tokio-postgres" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd8df5ef180f6364759a6f00f7aadda4fbbac86cdee37480826a6ff9f3574ce" +checksum = "a528f7d280f6d5b9cd149635c8705b0dd049754bc67d81d31fa25169a93809d3" dependencies = [ "async-trait", "byteorder", @@ -3089,7 +3205,7 @@ dependencies = [ "postgres-protocol", "postgres-types", "rand 0.10.1", - "socket2 0.6.3", + "socket2 0.6.4", "tokio", "tokio-util", "whoami", @@ -3097,9 +3213,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", @@ -3107,9 +3223,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.18" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -3144,9 +3260,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", @@ -3172,9 +3288,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.44" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -3184,20 +3300,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.31" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "tracing-core" -version = "0.1.36" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -3216,14 +3332,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.23" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex-automata", + "regex", "sharded-slab", "smallvec", "thread_local", @@ -3232,6 +3348,12 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "tungstenite" version = "0.29.0" @@ -3243,36 +3365,27 @@ dependencies = [ "http", "httparse", "log", - "rand 0.9.4", + "rand 0.9.1", "sha1", - "thiserror", + "thiserror 2.0.18", ] [[package]] name = "typed-builder" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398a3a3c918c96de527dc11e6e846cd549d4508030b8a33e1da12789c856b81a" -dependencies = [ - "typed-builder-macro", -] - -[[package]] -name = "typed-builder-macro" -version = "0.22.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e48cea23f68d1f78eb7bc092881b6bb88d3d6b5b7e6234f6f9c911da1ffb221" +checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicode-bidi" @@ -3282,36 +3395,24 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" -version = "0.1.25" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" - -[[package]] -name = "unicode-segmentation" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" - -[[package]] -name = "unicode-xid" -version = "0.2.6" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "untrusted" @@ -3321,14 +3422,13 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", ] [[package]] @@ -3345,13 +3445,13 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.23.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ - "getrandom 0.4.2", + "getrandom 0.3.3", "js-sys", - "serde_core", + "serde", "wasm-bindgen", ] @@ -3378,36 +3478,27 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" +name = "want" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "wasip2", + "try-lock", ] [[package]] -name = "wasip2" -version = "1.0.2+wasi-0.2.9" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +name = "wasi" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ - "wit-bindgen", + "wit-bindgen-rt", ] [[package]] @@ -3416,14 +3507,14 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42" dependencies = [ - "wasi 0.14.7+wasi-0.2.4", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -3434,9 +3525,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3444,116 +3535,160 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.101", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] [[package]] -name = "wasm-encoder" -version = "0.244.0" +name = "web-sys" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ - "leb128fmt", - "wasmparser", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "wasm-metadata" -version = "0.244.0" +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "whoami" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +checksum = "998767ef88740d1f5b0682a9c53c24431453923962269c2db68ee43788c5a40d" dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", + "libc", + "libredox", + "objc2-system-configuration", + "wasite", + "web-sys", ] [[package]] -name = "wasmparser" -version = "0.244.0" +name = "winapi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] -name = "web-sys" -version = "0.3.95" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "js-sys", - "wasm-bindgen", + "windows-sys 0.59.0", ] [[package]] -name = "webpki-roots" -version = "1.0.6" +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "rustls-pki-types", + "windows-targets 0.48.5", ] [[package]] -name = "whoami" -version = "2.1.1" +name = "windows-core" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a5b12f9df4f978d2cfdb1bd3bac52433f44393342d7ee9c25f5a1c14c0f45d" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "libc", - "libredox", - "objc2-system-configuration", - "wasite", - "web-sys", + "windows-implement", + "windows-interface", + "windows-link 0.1.1", + "windows-result", + "windows-strings", ] [[package]] -name = "winapi-util" -version = "0.1.11" +name = "windows-implement" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ - "windows-sys 0.61.2", + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-interface" +version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ - "windows-targets 0.48.5", + "proc-macro2", + "quote", + "syn 2.0.101", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.1", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.1", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -3578,7 +3713,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -3703,98 +3838,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", + "bitflags 2.9.1", ] [[package]] name = "writeable" -version = "0.6.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wyz" @@ -3813,10 +3869,11 @@ checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" [[package]] name = "yoke" -version = "0.8.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ + "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -3824,68 +3881,62 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] [[package]] name = "zerofrom" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", "synstructure", ] -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" - [[package]] name = "zerotrie" -version = "0.2.4" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" dependencies = [ "displaydoc", "yoke", @@ -3894,9 +3945,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.6" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -3905,17 +3956,11 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.101", ] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/crates/engineioxide-client/Cargo.toml b/crates/engineioxide-client/Cargo.toml new file mode 100644 index 00000000..d2a963f8 --- /dev/null +++ b/crates/engineioxide-client/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "engineioxide-client" +description = "Engine IO client implementation in rust" +version = "0.17.0" +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +keywords.workspace = true +categories.workspace = true +license.workspace = true +readme = "README.md" + +[dependencies] +engineioxide-core = { path = "../engineioxide-core", version = "0.2" } +bytes.workspace = true +futures-core.workspace = true +futures-util.workspace = true +http.workspace = true +http-body.workspace = true +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true +tokio = { workspace = true, features = ["rt", "time"] } +hyper = { workspace = true, features = ["client", "http1"] } +tokio-tungstenite.workspace = true +http-body-util.workspace = true +pin-project-lite.workspace = true +smallvec.workspace = true +hyper-util = { workspace = true, features = ["tokio"] } + +# Tracing +tracing = { workspace = true } # TODO: make optional + +[dev-dependencies] +tokio = { workspace = true, features = ["macros", "parking_lot"] } +tokio-stream.workspace = true +tokio-util.workspace = true +tracing-subscriber = { workspace = true, features = ["env-filter"] } +engineioxide = { path = "../engineioxide", features = [ + "tracing", + "v3", + "__test_harness", +] } + +[features] +v3 = ["engineioxide-core/v3"] +# tracing = ["dep:tracing", "engineioxide-core/tracing"] +__test_harness = [] diff --git a/crates/engineioxide-client/README.md b/crates/engineioxide-client/README.md new file mode 100644 index 00000000..e69de29b diff --git a/crates/engineioxide-client/src/client.rs b/crates/engineioxide-client/src/client.rs new file mode 100644 index 00000000..f48b5508 --- /dev/null +++ b/crates/engineioxide-client/src/client.rs @@ -0,0 +1,159 @@ +use std::{ + fmt, + pin::Pin, + task::{Context, Poll, ready}, +}; + +use engineioxide_core::{Packet, Sid}; +use futures_core::Stream; +use futures_util::Sink; + +use crate::{ + EioEvent, + transport::{ + PollingSvc, PollingTransport, PollingTransportError, Transport, TransportError, WebSocket, + WsTransport, WsTransportError, noop_impl::NoopWebSocket, + }, +}; + +pin_project_lite::pin_project! { + pub struct Client { + #[pin] + pub transport: Transport, + + should_send_pong: bool, + should_flush: bool, + closing: bool, + pub sid: Sid, + } +} + +impl Client { + pub async fn connect_ws(ws: impl Into) -> Result> { + let (inner, open) = WsTransport::connect(ws).await?; + let transport = Transport::Websocket { inner }; + let client = Client { + transport, + sid: open.sid, + + should_flush: false, + should_send_pong: false, + closing: false, + }; + + Ok(client) + } +} +impl Client { + pub async fn connect(svc: S) -> Result> { + let (inner, open) = PollingTransport::connect(svc).await?; + let transport = Transport::Polling { inner }; + let client = Client { + transport, + sid: open.sid, + + should_flush: false, + should_send_pong: false, + closing: false, + }; + + Ok(client) + } +} + +impl Client { + #[tracing::instrument(skip(cx))] + fn heartbeat( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll>> { + let mut proj = self.project(); + ready!(proj.transport.as_mut().poll_ready(cx))?; + proj.transport.as_mut().start_send(Packet::Pong)?; + + *proj.should_send_pong = false; + *proj.should_flush = true; + Poll::Ready(Ok(())) + } + + #[tracing::instrument(skip(cx))] + fn flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll>> { + let mut proj = self.project(); + ready!(proj.transport.as_mut().poll_flush(cx))?; + *proj.should_flush = false; + Poll::Ready(Ok(())) + } +} + +impl Stream for Client { + type Item = Result>; + + #[tracing::instrument(skip(cx))] + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + if self.closing { + ready!(self.project().transport.poll_close(cx))?; + return Poll::Ready(None); + } + + if self.should_send_pong { + ready!(self.as_mut().heartbeat(cx))?; + } + + if self.should_flush { + ready!(self.as_mut().flush(cx))?; + } + + match ready!(self.as_mut().project().transport.poll_next(cx)) { + Some(Ok(Packet::Ping)) => { + *self.as_mut().project().should_send_pong = true; + self.poll_next(cx) + } + Some(Ok(Packet::Close)) => { + *self.as_mut().project().closing = true; + cx.waker().wake_by_ref(); // wake up to close the transport + Poll::Ready(Some(Ok(EioEvent::Disconnect))) + } + Some(Ok(Packet::Message(v))) => Poll::Ready(Some(Ok(EioEvent::Message(v)))), + Some(Ok(Packet::Binary(v))) => Poll::Ready(Some(Ok(EioEvent::Binary(v)))), + Some(Ok(v)) => unreachable!("unexpected msg {v:?}"), + Some(Err(e)) => Poll::Ready(Some(Err(e))), + None => Poll::Ready(None), + } + } +} + +impl Sink for Client { + type Error = as Sink>::Error; + + fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().transport.poll_ready(cx) + } + + fn start_send(self: Pin<&mut Self>, event: EioEvent) -> Result<(), Self::Error> { + if let Some(packet) = event.into() { + self.project().transport.start_send(packet)?; + } + Ok(()) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().transport.poll_flush(cx) + } + + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().transport.poll_close(cx) + } +} + +impl fmt::Debug for Client { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Client") + .field("should_send_pong", &self.should_send_pong) + .field("should_flush", &self.should_flush) + .field("sid", &self.sid) + .finish() + } +} diff --git a/crates/engineioxide-client/src/event.rs b/crates/engineioxide-client/src/event.rs new file mode 100644 index 00000000..5894a962 --- /dev/null +++ b/crates/engineioxide-client/src/event.rs @@ -0,0 +1,20 @@ +use bytes::Bytes; +use engineioxide_core::{Packet, Str}; + +#[derive(Debug, PartialEq, Eq)] +pub enum EioEvent { + Connect, + Disconnect, + Message(Str), + Binary(Bytes), +} + +impl From for Option { + fn from(value: EioEvent) -> Option { + match value { + EioEvent::Message(msg) => Some(Packet::Message(msg)), + EioEvent::Binary(bin) => Some(Packet::Binary(bin)), + _ => None, + } + } +} diff --git a/crates/engineioxide-client/src/lib.rs b/crates/engineioxide-client/src/lib.rs new file mode 100644 index 00000000..7babd7b9 --- /dev/null +++ b/crates/engineioxide-client/src/lib.rs @@ -0,0 +1,18 @@ +#![allow(missing_docs)] +#![cfg_attr(docsrs, feature(doc_cfg))] +#![doc( + html_logo_url = "https://raw.githubusercontent.com/Totodore/socketioxide/refs/heads/main/.github/logo_dark.svg" +)] +#![doc( + html_favicon_url = "https://raw.githubusercontent.com/Totodore/socketioxide/refs/heads/main/.github/logo_dark.ico" +)] +//! Engine.IO client library for Rust. + +mod client; +mod event; +mod transport; + +pub use crate::client::Client; +pub use crate::event::EioEvent; +pub use crate::transport::PollingTransport; +pub use transport::{WsTransport, noop_impl, tungstenite_impl}; diff --git a/crates/engineioxide-client/src/transport/mod.rs b/crates/engineioxide-client/src/transport/mod.rs new file mode 100644 index 00000000..52334186 --- /dev/null +++ b/crates/engineioxide-client/src/transport/mod.rs @@ -0,0 +1,121 @@ +use std::{ + fmt, + pin::Pin, + task::{Context, Poll}, +}; + +use engineioxide_core::{Packet, TransportType}; +use futures_core::Stream; +use futures_util::Sink; + +pub use crate::transport::polling::{PollingSvc, PollingTransport, PollingTransportError}; +pub use crate::transport::ws::{ + WebSocket, WsTransport, WsTransportError, noop_impl, tungstenite_impl, +}; + +mod polling; +mod ws; + +pub enum TransportError { + Polling(PollingTransportError), + Websocket(WsTransportError), +} + +impl fmt::Debug for TransportError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self) + } +} +impl fmt::Display for TransportError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + TransportError::Polling(e) => write!(f, "polling error: {}", e), + TransportError::Websocket(e) => write!(f, "ws error: {}", e), + } + } +} +impl std::error::Error for TransportError {} + +pin_project_lite::pin_project! { + #[project = TransportProj] + pub enum Transport { + Polling { + #[pin] + inner: PollingTransport + }, + Websocket { + #[pin] + inner: WsTransport + } + } +} + +impl Transport { + pub fn transport_type(&self) -> TransportType { + match self { + Transport::Polling { .. } => TransportType::Polling, + Transport::Websocket { .. } => TransportType::Websocket, + } + } +} + +impl Stream for Transport { + type Item = Result>; + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.as_mut().project() { + TransportProj::Polling { inner } => { + inner.poll_next(cx).map_err(TransportError::Polling) + } + TransportProj::Websocket { inner } => { + inner.poll_next(cx).map_err(TransportError::Websocket) + } + } + } +} +impl Sink for Transport { + type Error = TransportError; + + fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.project() { + TransportProj::Polling { inner } => { + inner.poll_ready(cx).map_err(TransportError::Polling) + } + TransportProj::Websocket { inner } => { + inner.poll_ready(cx).map_err(TransportError::Websocket) + } + } + } + + fn start_send(self: Pin<&mut Self>, item: Packet) -> Result<(), Self::Error> { + match self.project() { + TransportProj::Polling { inner } => { + inner.start_send(item).map_err(TransportError::Polling) + } + TransportProj::Websocket { inner } => { + inner.start_send(item).map_err(TransportError::Websocket) + } + } + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.project() { + TransportProj::Polling { inner } => { + inner.poll_flush(cx).map_err(TransportError::Polling) + } + TransportProj::Websocket { inner } => { + inner.poll_flush(cx).map_err(TransportError::Websocket) + } + } + } + + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.project() { + TransportProj::Polling { inner } => { + inner.poll_close(cx).map_err(TransportError::Polling) + } + TransportProj::Websocket { inner } => { + inner.poll_close(cx).map_err(TransportError::Websocket) + } + } + } +} diff --git a/crates/engineioxide-client/src/transport/polling.rs b/crates/engineioxide-client/src/transport/polling.rs new file mode 100644 index 00000000..3f0ae1f8 --- /dev/null +++ b/crates/engineioxide-client/src/transport/polling.rs @@ -0,0 +1,302 @@ +use std::{ + convert::Infallible, + fmt, + pin::Pin, + task::{Context, Poll, ready}, +}; + +use bytes::{BufMut, Bytes, BytesMut}; +use engineioxide_core::{OpenPacket, Packet, PacketParseError, ProtocolVersion, Sid, payload}; +use futures_core::Stream; +use futures_util::{Sink, StreamExt}; +use http::{Request, Response, StatusCode}; +use http_body_util::{BodyExt, Full, combinators::BoxBody}; +use hyper::service::Service as HyperSvc; +use pin_project_lite::pin_project; + +pub trait PollingSvc: + HyperSvc< + Request>, + Response = Response, + Error = ::Error, + > +{ + type Body: http_body::Body + 'static; + type Error: fmt::Debug + std::error::Error; + type ResBodyError: fmt::Debug + std::error::Error + 'static; +} + +impl PollingSvc for S +where + S: HyperSvc>, Response = Response>, + >>>::Error: fmt::Debug + std::error::Error, + B: http_body::Body + 'static, + ::Error: fmt::Debug + std::error::Error + 'static, + ::Data: Send + fmt::Debug + 'static, +{ + type Body = B; + type Error = >>>::Error; + type ResBodyError = ::Error; +} + +pin_project! { + #[project = PollStateProj] + enum PollState { + Pending { + #[pin] + fut: F + }, + Decoding { + stream: Pin>>> + } + } +} + +pin_project! { + #[project = PostStateProj] + enum PostState { + Queuing { + bytes: BytesMut, + }, + Pending { + #[pin] + fut: F, + // TODO: BytesList + bytes: BytesMut, + } + } +} + +impl Default for PostState { + fn default() -> Self { + PostState::Queuing { + bytes: BytesMut::new(), + } + } +} + +impl PollState { + fn new_request>(svc: &S, sid: Sid) -> Self { + let uri = format!("http://localhost:3000/engine.io?EIO=4&transport=polling&sid={sid}"); + let req = Request::get(uri) + .body(BoxBody::new(Full::default())) + .unwrap(); + let fut = svc.call(req); + PollState::Pending { fut } + } +} + +#[derive(Debug, thiserror::Error)] +pub enum PollingTransportError { + #[error("polling error: {0}")] + Polling(::Error), + #[error("polling body error: {0}")] + PollingBody(::ResBodyError), + #[error("packet error: {0}")] + Packet(#[from] PacketParseError), +} + +pin_project! { + pub struct PollingTransport + { + svc: S, + + #[pin] + poll_state: PollState, + + #[pin] + post_state: PostState, + + sid: Sid, + } +} + +impl PollingTransport { + pub async fn connect(svc: S) -> Result<(Self, OpenPacket), PollingTransportError> { + tracing::trace!("handshake request"); + + let req = Request::builder() + .method("GET") + .uri("http://localhost:3000/engine.io?EIO=4&transport=polling") + .body(BoxBody::new(Full::default())) + .unwrap(); + + let res = svc + .call(req) + .await + .map_err(PollingTransportError::Polling)?; + let body = res + .collect() + .await + .map_err(PollingTransportError::PollingBody)?; + + let packet = Packet::parse( + ProtocolVersion::V4, + String::from_utf8(body.to_bytes().to_vec()).unwrap(), + )?; + + match packet { + Packet::Open(open) => { + let poll_state = PollState::new_request(&svc, open.sid); + let transport = PollingTransport { + svc, + poll_state, + post_state: PostState::default(), + sid: open.sid, + }; + + Ok((transport, open)) + } + _ => Err(PollingTransportError::Packet( + PacketParseError::InvalidPacketType(None), + )), + } + } +} + +impl Stream for PollingTransport { + type Item = Result>; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + tracing::trace!(poll_state = ?self.poll_state, "polling"); + + let mut poll_state_proj = self.as_mut().project().poll_state.project(); + match poll_state_proj { + PollStateProj::Pending { ref mut fut } => { + match ready!(fut.as_mut().poll(cx)) { + Ok(res) => { + let (parts, body) = res.into_parts(); + assert!(parts.status == StatusCode::OK); + let body = Box::pin(body); + //TODO: implement limited body + Content-Type + let stream = + payload::decoder(body, None, ProtocolVersion::V4, 200).boxed_local(); + + self.project() + .poll_state + .set(PollState::Decoding { stream }); + + cx.waker().wake_by_ref(); + Poll::Pending + } + Err(err) => { + tracing::debug!(?err, "got body error"); + Poll::Ready(Some(Err(PacketParseError::InvalidPacketPayload.into()))) + } + } + } + PollStateProj::Decoding { ref mut stream } => { + if let Some(packet) = ready!(stream.poll_next_unpin(cx)) { + Poll::Ready(Some(packet.map_err(PollingTransportError::from))) + } else { + let request = PollState::new_request(&self.svc, self.sid); + self.project().poll_state.set(request); + //check if wake is needed + cx.waker().wake_by_ref(); + Poll::Pending + } + } + } + } +} + +impl Sink for PollingTransport { + type Error = PollingTransportError; + + fn poll_ready(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn start_send(self: Pin<&mut Self>, item: Packet) -> Result<(), Self::Error> { + tracing::trace!(post_state = ?self.post_state, "sending packet"); + self.project().post_state.encode(item); + Ok(()) + } + + fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + tracing::trace!(post_state = ?self.post_state, "flushing"); + let proj = self.as_mut().project().post_state.project(); + + match proj { + PostStateProj::Queuing { bytes } if bytes.is_empty() => Poll::Ready(Ok(())), + PostStateProj::Queuing { bytes } => { + let body = std::mem::take(bytes).freeze(); + //TODO: handle max body size from open packet + let sid = self.sid; + let req = Request::post(format!( + "http://localhost:3000/engine.io?EIO=4&transport=polling&sid={sid}", + )) + .body(BoxBody::new(Full::new(body))) + .unwrap(); + + let fut = self.svc.call(req); + self.project().post_state.set(PostState::Pending { + fut, + bytes: BytesMut::new(), + }); + cx.waker().wake_by_ref(); + Poll::Pending + } + PostStateProj::Pending { fut, .. } => { + match ready!(fut.poll(cx)) { + Ok(res) => { + assert!(res.status().is_success()); + self.project().post_state.set(PostState::default()); + Poll::Ready(Ok(())) // TODO: check response == ok + } + Err(err) => { + self.project().post_state.set(PostState::default()); + Poll::Ready(Err(PollingTransportError::Polling(err))) + } + } + } + } + } + + fn poll_close(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + //TODO: close behavior + Poll::Ready(Ok(())) + } +} + +impl PostState { + pub fn encode(self: Pin<&mut Self>, item: Packet) { + const PACKET_SEPARATOR_V4: u8 = b'\x1e'; + let packet: Bytes = item.into(); + let bytes = match self.project() { + PostStateProj::Queuing { bytes } => bytes, + PostStateProj::Pending { bytes, .. } => bytes, + }; + + if !bytes.is_empty() { + bytes.put_u8(PACKET_SEPARATOR_V4); + } + bytes.extend_from_slice(&packet); + } +} + +impl fmt::Debug for PollState { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Pending { .. } => write!(f, "Pending"), + Self::Decoding { .. } => write!(f, "Decoding"), + } + } +} +impl fmt::Debug for PostState { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Pending { .. } => write!(f, "Pending"), + Self::Queuing { .. } => write!(f, "Queuing"), + } + } +} +impl fmt::Debug for PollingTransport { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("PollingTransport") + .field("poll_state", &self.poll_state) + .field("post_state", &self.post_state) + .field("sid", &self.sid) + .finish() + } +} diff --git a/crates/engineioxide-client/src/transport/ws.rs b/crates/engineioxide-client/src/transport/ws.rs new file mode 100644 index 00000000..9cd642c3 --- /dev/null +++ b/crates/engineioxide-client/src/transport/ws.rs @@ -0,0 +1,276 @@ +use std::{ + fmt, + pin::Pin, + task::{Context, Poll, ready}, +}; + +use bytes::Bytes; +use engineioxide_core::{OpenPacket, Packet, PacketParseError, ProtocolVersion, Str}; +use futures_core::Stream; +use futures_util::{Sink, StreamExt}; +use pin_project_lite::pin_project; +use tokio_tungstenite::tungstenite::{self, Message, Utf8Bytes}; + +pin_project! { + pub struct WsTransport { + #[pin] + inner: S, + } +} + +pub enum WsTransportError { + Websocket(::Error), + Packet(PacketParseError), + Closed, +} +impl From for WsTransportError { + fn from(e: PacketParseError) -> Self { + WsTransportError::Packet(e) + } +} +impl fmt::Debug for WsTransportError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self) + } +} +impl fmt::Display for WsTransportError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + WsTransportError::Websocket(e) => write!(f, "websocket error: {}", e), + WsTransportError::Packet(e) => write!(f, "packet error: {}", e), + WsTransportError::Closed => write!(f, "websocket closed"), + } + } +} +impl std::error::Error for WsTransportError {} + +impl WsTransport { + pub fn new(inner: impl Into) -> Self { + Self { + inner: inner.into(), + } + } + + pub async fn connect(inner: impl Into) -> Result<(Self, OpenPacket), WsTransportError> { + tracing::trace!("handshake request"); + let mut ws = Self::new(inner); + + match ws.next().await.ok_or(WsTransportError::Closed)?? { + Packet::Open(open_packet) => Ok((ws, open_packet)), + _ => Err(WsTransportError::Packet( + PacketParseError::InvalidPacketType(None), + )), + } + } +} + +pub trait WebSocket: + Stream::Error>> + + Sink::Error> + + Sized + + Unpin +{ + type Error: fmt::Debug + std::error::Error; +} + +pub enum WsMessage { + Text(Str), + Binary(Bytes), + Close, +} + +impl WsTransport { + fn parse_packet(&self, msg: WsMessage) -> Result> { + match msg { + WsMessage::Text(msg) => { + let msg_str = unsafe { Str::from_bytes_unchecked(msg.into()) }; + let packet = Packet::parse(ProtocolVersion::V4, msg_str)?; + Ok(packet) + } + WsMessage::Binary(data) => Ok(Packet::Binary(data)), + WsMessage::Close => { + todo!("impl ws close"); + } + } + } +} + +impl Stream for WsTransport { + type Item = Result>; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match ready!(self.as_mut().project().inner.poll_next(cx)) { + Some(Ok(msg)) => match self.parse_packet(msg) { + Ok(packet) => Poll::Ready(Some(Ok(packet))), + Err(e) => Poll::Ready(Some(Err(e))), + }, + Some(Err(e)) => Poll::Ready(Some(Err(WsTransportError::Websocket(e)))), + None => Poll::Ready(None), + } + } +} + +impl Sink for WsTransport { + type Error = WsTransportError; + + fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project() + .inner + .poll_ready(cx) + .map_err(WsTransportError::Websocket) + } + + fn start_send(self: Pin<&mut Self>, item: Packet) -> Result<(), Self::Error> { + let msg = match item { + Packet::Binary(bin) => WsMessage::Binary(bin), + Packet::Noop => return Ok(()), + p => WsMessage::Text(String::from(p).into()), + }; + self.project() + .inner + .start_send(msg) + .map_err(WsTransportError::Websocket) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project() + .inner + .poll_flush(cx) + .map_err(WsTransportError::Websocket) + } + + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project() + .inner + .poll_close(cx) + .map_err(WsTransportError::Websocket) + } +} + +pub mod noop_impl { + use std::convert::Infallible; + + use super::*; + + #[derive(Debug, Default)] + pub struct NoopWebSocket; + + impl WebSocket for NoopWebSocket { + type Error = Infallible; + } + impl Stream for NoopWebSocket { + type Item = Result; + + fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(None) + } + } + impl Sink for NoopWebSocket { + type Error = Infallible; + + fn poll_ready( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + + fn start_send(self: Pin<&mut Self>, _item: WsMessage) -> Result<(), Self::Error> { + Ok(()) + } + + fn poll_flush( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + + fn poll_close( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + } +} +pub mod tungstenite_impl { + use super::*; + + impl From for tungstenite::Message { + fn from(value: WsMessage) -> Self { + match value { + WsMessage::Text(v) => { + tungstenite::Message::Text(unsafe { Utf8Bytes::from_bytes_unchecked(v.into()) }) + } + WsMessage::Binary(bytes) => tungstenite::Message::Binary(bytes), + WsMessage::Close => tungstenite::Message::Close(None), + } + } + } + pin_project! { + pub struct TokioTungsteniteWebSocket { + #[pin] + inner: tokio_tungstenite::WebSocketStream, + } + } + + impl From> for TokioTungsteniteWebSocket + where + S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Unpin, + { + fn from(inner: tokio_tungstenite::WebSocketStream) -> Self { + Self { inner } + } + } + + impl WebSocket + for TokioTungsteniteWebSocket + { + type Error = tungstenite::Error; + } + + impl Sink + for TokioTungsteniteWebSocket + { + type Error = tungstenite::Error; + + fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().inner.poll_ready(cx) + } + + fn start_send(self: Pin<&mut Self>, item: WsMessage) -> Result<(), Self::Error> { + self.project().inner.start_send(item.into()) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().inner.poll_flush(cx) + } + + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().inner.poll_close(cx) + } + } + + impl Stream + for TokioTungsteniteWebSocket + { + type Item = Result; + + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match ready!(self.project().inner.poll_next(cx)) { + Some(Ok(Message::Text(v))) => Poll::Ready(Some(Ok(WsMessage::Text(unsafe { + Str::from_bytes_unchecked(v.into()) + })))), + Some(Ok(Message::Binary(v))) => Poll::Ready(Some(Ok(WsMessage::Binary(v)))), + Some(Ok(Message::Close(_))) => Poll::Ready(Some(Ok(WsMessage::Close))), + Some(Ok(_)) => { + cx.waker().wake_by_ref(); + Poll::Pending + } + Some(Err(e)) => Poll::Ready(Some(Err(e))), + None => Poll::Pending, + } + } + } +} diff --git a/crates/engineioxide-client/tests/fixture.rs b/crates/engineioxide-client/tests/fixture.rs new file mode 100644 index 00000000..fd1a1881 --- /dev/null +++ b/crates/engineioxide-client/tests/fixture.rs @@ -0,0 +1,110 @@ +use std::io; +use std::pin::Pin; +use std::task::{Context, Poll}; + +use bytes::Bytes; +use engineioxide::handler::EngineIoHandler; +use engineioxide::service::EngineIoService; +use engineioxide_client::Client; +use engineioxide_client::tungstenite_impl::TokioTungsteniteWebSocket; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; +use tokio::sync::mpsc; +use tokio_stream::wrappers::UnboundedReceiverStream; +use tokio_tungstenite::tungstenite::handshake::client::{Request, generate_key}; +use tokio_tungstenite::tungstenite::protocol::Role; +use tokio_util::io::StreamReader; + +pin_project_lite::pin_project! { + pub struct StreamImpl { + tx: mpsc::UnboundedSender>, + #[pin] + rx: StreamReader>, Bytes>, + } +} + +impl StreamImpl { + pub fn new( + tx: mpsc::UnboundedSender>, + rx: mpsc::UnboundedReceiver>, + ) -> Self { + Self { + tx, + rx: StreamReader::new(UnboundedReceiverStream::new(rx)), + } + } +} + +impl AsyncRead for StreamImpl { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &mut ReadBuf<'_>, + ) -> Poll> { + self.project().rx.poll_read(cx, buf) + } +} +impl AsyncWrite for StreamImpl { + fn poll_write( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + let len = buf.len(); + self.project() + .tx + .send(Ok(Bytes::copy_from_slice(buf))) + .unwrap(); + Poll::Ready(Ok(len)) + } + + fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } +} + +pub async fn tungstenite_client( + svc: EngineIoService, +) -> tokio_tungstenite::WebSocketStream { + let (tx, rx) = mpsc::unbounded_channel(); + let (tx1, rx1) = mpsc::unbounded_channel(); + + let parts = Request::builder() + .method("GET") + .header("Host", "127.0.0.1") + .header("Connection", "Upgrade") + .header("Upgrade", "websocket") + .header("Sec-WebSocket-Version", "13") + .header("Sec-WebSocket-Key", generate_key()) + .uri("ws://127.0.0.1/engine.io/?EIO=4&transport=websocket") + .body(http_body_util::Empty::::new()) + .unwrap() + .into_parts() + .0; + + svc.ws_init( + StreamImpl::new(tx, rx1), + engineioxide::ProtocolVersion::V4, + None, + parts, + ) + .await + .unwrap(); + + tokio_tungstenite::WebSocketStream::from_raw_socket( + StreamImpl::new(tx1, rx), + Role::Client, + Default::default(), + ) + .await +} + +pub async fn client_ws_connect( + svc: EngineIoService, +) -> Client, TokioTungsteniteWebSocket> { + let ws = tungstenite_client(svc).await; + Client::connect_ws(ws).await.unwrap() +} diff --git a/crates/engineioxide-client/tests/handshake.rs b/crates/engineioxide-client/tests/handshake.rs new file mode 100644 index 00000000..811befaf --- /dev/null +++ b/crates/engineioxide-client/tests/handshake.rs @@ -0,0 +1,93 @@ +use std::sync::Arc; + +use bytes::Bytes; +use engineioxide::handler::EngineIoHandler; +use engineioxide::{DisconnectReason, service::EngineIoService}; +use engineioxide::{Socket, Str}; +use engineioxide_client::tungstenite_impl::TokioTungsteniteWebSocket; +use engineioxide_client::{PollingTransport, WsTransport}; +use engineioxide_core::Sid; +use tokio::sync::mpsc; +use tracing_subscriber::EnvFilter; + +use crate::fixture::tungstenite_client; + +mod fixture; + +#[derive(Debug, PartialEq, Eq)] +enum Event { + Connect(Sid), + Disconnect(Sid, DisconnectReason), + Message(Sid, Str), + Binary(Sid, Bytes), +} + +#[derive(Debug)] +struct Handler { + tx: mpsc::UnboundedSender, +} + +impl Handler { + fn new() -> (Self, mpsc::UnboundedReceiver) { + let (tx, rx) = mpsc::unbounded_channel(); + (Self { tx }, rx) + } +} + +fn init_tracing() { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .try_init() + .ok(); +} + +/// Build an [`EngineIoService`] with a short ping interval/timeout so the +/// heartbeat fires quickly during tests. +fn service() -> (EngineIoService, mpsc::UnboundedReceiver) { + init_tracing(); + let (handler, rx) = Handler::new(); + let svc = EngineIoService::new(Arc::new(handler)); + (svc, rx) +} + +impl EngineIoHandler for Handler { + type Data = (); + fn on_connect(self: Arc, socket: Arc>) { + self.tx.send(Event::Connect(socket.id)).unwrap(); + } + + fn on_disconnect(&self, socket: Arc>, reason: DisconnectReason) { + self.tx.send(Event::Disconnect(socket.id, reason)).unwrap(); + } + + fn on_message(self: &Arc, msg: Str, socket: Arc>) { + self.tx + .send(Event::Message(socket.id, msg.clone())) + .unwrap(); + socket.emit(msg).unwrap(); + } + + fn on_binary(self: &Arc, data: Bytes, socket: Arc>) { + self.tx + .send(Event::Binary(socket.id, data.clone())) + .unwrap(); + socket.emit_binary(data).unwrap(); + } +} + +#[tokio::test] +async fn handshake_polling() { + let (svc, mut rx) = service(); + let (_, open) = PollingTransport::connect(svc).await.unwrap(); + assert_eq!(rx.recv().await.unwrap(), Event::Connect(open.sid)); +} + +#[tokio::test] +async fn handshake_websocket() { + let (svc, mut rx) = service(); + let ws = tungstenite_client(svc).await; + let (_, open) = WsTransport::>::connect(ws) + .await + .unwrap(); + assert_eq!(rx.recv().await.unwrap(), Event::Connect(open.sid)); +} diff --git a/crates/engineioxide-client/tests/heartbeat.rs b/crates/engineioxide-client/tests/heartbeat.rs new file mode 100644 index 00000000..010cd942 --- /dev/null +++ b/crates/engineioxide-client/tests/heartbeat.rs @@ -0,0 +1,188 @@ +//! Heartbeat mechanism tests. +//! +//! In the engine.io v4 protocol the *server* drives the heartbeat: every +//! `ping_interval` it sends a `Packet::Ping` and expects a `Packet::Pong` back +//! within `ping_timeout`, otherwise it closes the socket with +//! [`DisconnectReason::HeartbeatTimeout`]. +//! +//! The pong is emitted transparently by `Client::poll_next`: a `Ping` is +//! intercepted, a `Pong` is sent and the `Ping` is never surfaced to the user. + +use std::sync::Arc; +use std::time::Duration; + +use bytes::Bytes; +use engineioxide::config::EngineIoConfig; +use engineioxide::handler::EngineIoHandler; +use engineioxide::service::EngineIoService; +use engineioxide::{DisconnectReason, Socket, Str}; +use engineioxide_client::{Client, EioEvent}; +use engineioxide_core::Sid; +use futures_util::{SinkExt, StreamExt}; +use tokio::sync::mpsc; +use tracing_subscriber::EnvFilter; + +mod fixture; + +const PING_INTERVAL: Duration = Duration::from_millis(100); +const PING_TIMEOUT: Duration = Duration::from_millis(100); + +#[derive(Debug, PartialEq, Eq)] +enum Event { + Connect(Sid), + Disconnect(Sid, DisconnectReason), + Message(Sid, Str), +} + +#[derive(Debug)] +struct Handler { + tx: mpsc::Sender, +} + +impl Handler { + fn new() -> (Self, mpsc::Receiver) { + let (tx, rx) = mpsc::channel(100); + (Self { tx }, rx) + } +} + +impl EngineIoHandler for Handler { + type Data = (); + fn on_connect(self: Arc, socket: Arc>) { + self.tx.try_send(Event::Connect(socket.id)).unwrap(); + } + + fn on_disconnect(&self, socket: Arc>, reason: DisconnectReason) { + self.tx + .try_send(Event::Disconnect(socket.id, reason)) + .unwrap(); + } + + fn on_message(self: &Arc, msg: Str, socket: Arc>) { + self.tx + .try_send(Event::Message(socket.id, msg.clone())) + .unwrap(); + // Echo the message back so the client can observe liveness. + socket.emit(msg).unwrap(); + } + + fn on_binary(self: &Arc, _data: Bytes, _socket: Arc>) {} +} + +fn init_tracing() { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .try_init() + .ok(); +} + +/// Build an [`EngineIoService`] with a short ping interval/timeout so the +/// heartbeat fires quickly during tests. +fn service() -> (EngineIoService, mpsc::Receiver) { + init_tracing(); + let (handler, rx) = Handler::new(); + let config = EngineIoConfig::builder() + .ping_interval(PING_INTERVAL) + .ping_timeout(PING_TIMEOUT) + .build(); + let svc = EngineIoService::with_config(Arc::new(handler), config); + (svc, rx) +} + +/// A [`Client`] that is continuously polled must auto-respond to the server's +/// `Ping`s with `Pong`s, keeping the connection alive across several ping +/// cycles. The connection must also still be usable afterwards. +#[tokio::test] +async fn heartbeat_keeps_connection_alive() { + let (svc, mut rx) = service(); + + let mut client = Client::connect(svc).await.unwrap(); + let sid = client.sid; + assert_eq!(rx.recv().await.unwrap(), Event::Connect(sid)); + + // Drive the client for several ping cycles. Any server event during this + // window can only be a disconnect (we send nothing), which would mean the + // heartbeat failed. + let window = PING_INTERVAL * 5; + let deadline = tokio::time::sleep(window); + tokio::pin!(deadline); + tokio::select! { + _ = &mut deadline => (), + ev = rx.recv() => panic!("unexpected server event during heartbeat: {ev:?}"), + // Polling the stream is what lets the client receive `Ping`s and + // emit `Pong`s. `Ping` is consumed internally and never yielded, + // so this branch effectively never resolves. + packet = client.next() => match packet { + Some(Ok(p)) => panic!("unexpected packet during heartbeat: {p:?}"), + Some(Err(e)) => panic!("client stream error during heartbeat: {e:?}"), + None => panic!("client stream ended unexpectedly"), + }, + } + + // The connection survived several ping cycles: prove it is still healthy + // by round-tripping a message (the handler echoes it back). + client.send(EioEvent::Message("hb".into())).await.unwrap(); + assert_eq!( + rx.recv().await.unwrap(), + Event::Message(sid, "hb".into()), + "server should still receive messages after the heartbeat window", + ); + match client.next().await { + Some(Ok(EioEvent::Message(msg))) => { + assert_eq!(msg, "hb") + } + // Ignore any other packet (should not happen, `Ping` is internal). + Some(Ok(p)) => panic!("unexpected packet: {p:?}"), + Some(Err(e)) => panic!("client stream error: {e:?}"), + None => panic!("client stream ended before echo"), + } +} + +/// A [`Client`] that is continuously polled must auto-respond to the server's +/// `Ping`s with `Pong`s, keeping the connection alive across several ping +/// cycles. The connection must also still be usable afterwards. +#[tokio::test] +async fn heartbeat_keeps_connection_alive_websocket() { + let (svc, mut rx) = service(); + + let mut client = fixture::client_ws_connect(svc).await; + let sid = client.sid; + assert_eq!(rx.recv().await.unwrap(), Event::Connect(sid)); + + // Drive the client for several ping cycles. Any server event during this + // window can only be a disconnect (we send nothing), which would mean the + // heartbeat failed. + let window = PING_INTERVAL * 5; + let deadline = tokio::time::sleep(window); + tokio::pin!(deadline); + tokio::select! { + _ = &mut deadline => (), + ev = rx.recv() => panic!("unexpected server event during heartbeat: {ev:?}"), + // Polling the stream is what lets the client receive `Ping`s and + // emit `Pong`s. `Ping` is consumed internally and never yielded, + // so this branch effectively never resolves. + packet = client.next() => match packet { + Some(Ok(p)) => panic!("unexpected packet during heartbeat: {p:?}"), + Some(Err(e)) => panic!("client stream error during heartbeat: {e:?}"), + None => panic!("client stream ended unexpectedly"), + }, + } + + // The connection survived several ping cycles: prove it is still healthy + // by round-tripping a message (the handler echoes it back). + client.send(EioEvent::Message("hb".into())).await.unwrap(); + assert_eq!( + rx.recv().await.unwrap(), + Event::Message(sid, "hb".into()), + "server should still receive messages after the heartbeat window", + ); + match client.next().await { + Some(Ok(EioEvent::Message(msg))) => { + assert_eq!(msg, "hb") + } + // Ignore any other packet (should not happen, `Ping` is internal). + Some(Ok(p)) => panic!("unexpected packet: {p:?}"), + Some(Err(e)) => panic!("client stream error: {e:?}"), + None => panic!("client stream ended before echo"), + } +} diff --git a/crates/engineioxide-client/tests/round_trip.rs b/crates/engineioxide-client/tests/round_trip.rs new file mode 100644 index 00000000..9d3c6bac --- /dev/null +++ b/crates/engineioxide-client/tests/round_trip.rs @@ -0,0 +1,150 @@ +//! Polling mechanism tests. +//! +//! These tests exercise the [`Client`] read/write halves obtained via +//! [`Client::split`]: packets sent through the sink must reach the server and +//! the echoed packets must be surfaced back through the stream. + +use std::sync::Arc; + +use bytes::Bytes; +use engineioxide::handler::EngineIoHandler; +use engineioxide::{DisconnectReason, service::EngineIoService}; +use engineioxide::{Socket, Str}; +use engineioxide_client::{Client, EioEvent}; +use engineioxide_core::Sid; +use futures_util::{SinkExt, StreamExt}; +use tokio::sync::mpsc; +use tracing_subscriber::EnvFilter; + +mod fixture; + +#[derive(Debug, PartialEq, Eq)] +enum Event { + Connect(Sid), + Disconnect(Sid, DisconnectReason), + Message(Sid, Str), + Binary(Sid, Bytes), +} + +#[derive(Debug)] +struct Handler { + tx: mpsc::UnboundedSender, +} + +impl Handler { + fn new() -> (Self, mpsc::UnboundedReceiver) { + let (tx, rx) = mpsc::unbounded_channel(); + (Self { tx }, rx) + } +} + +fn init_tracing() { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .try_init() + .ok(); +} + +fn service() -> (EngineIoService, mpsc::UnboundedReceiver) { + init_tracing(); + let (handler, rx) = Handler::new(); + let svc = EngineIoService::new(Arc::new(handler)); + (svc, rx) +} + +impl EngineIoHandler for Handler { + type Data = (); + fn on_connect(self: Arc, socket: Arc>) { + self.tx.send(Event::Connect(socket.id)).unwrap(); + } + + fn on_disconnect(&self, socket: Arc>, reason: DisconnectReason) { + self.tx.send(Event::Disconnect(socket.id, reason)).unwrap(); + } + + fn on_message(self: &Arc, msg: Str, socket: Arc>) { + self.tx + .send(Event::Message(socket.id, msg.clone())) + .unwrap(); + socket.emit(msg).unwrap(); + } + + fn on_binary(self: &Arc, data: Bytes, socket: Arc>) { + self.tx + .send(Event::Binary(socket.id, data.clone())) + .unwrap(); + socket.emit_binary(data).unwrap(); + } +} + +/// Packets sent through the write half must reach the server, and the packets +/// the handler echoes back must be surfaced in order through the read half. +#[tokio::test] +async fn round_trip() { + let (svc, mut rx) = service(); + let client = Client::connect(svc).await.unwrap(); + let sid = client.sid; + assert_eq!(rx.recv().await.unwrap(), Event::Connect(sid)); + let (mut ctx, mut crx) = client.split::(); + + ctx.send(EioEvent::Message("Hello".into())).await.unwrap(); + ctx.send(EioEvent::Binary(Bytes::from_static(b"Hello"))) + .await + .unwrap(); + + // The server observes both packets. + assert_eq!( + rx.recv().await.unwrap(), + Event::Message(sid, "Hello".into()) + ); + assert_eq!( + rx.recv().await.unwrap(), + Event::Binary(sid, Bytes::from_static(b"Hello")) + ); + + // And echoes them back through the read half, in order. + match crx.next().await { + Some(Ok(EioEvent::Message(msg))) => assert_eq!(msg, "Hello"), + other => panic!("expected echoed message, got {other:?}"), + } + match crx.next().await { + Some(Ok(EioEvent::Binary(data))) => assert_eq!(data, Bytes::from_static(b"Hello")), + other => panic!("expected echoed binary, got {other:?}"), + } +} + +/// Packets sent through the write half must reach the server, and the packets +/// the handler echoes back must be surfaced in order through the read half. +#[tokio::test] +async fn round_trip_ws() { + let (svc, mut rx) = service(); + let client = fixture::client_ws_connect(svc).await; + let sid = client.sid; + assert_eq!(rx.recv().await.unwrap(), Event::Connect(sid)); + let (mut ctx, mut crx) = client.split::(); + + ctx.send(EioEvent::Message("Hello".into())).await.unwrap(); + ctx.send(EioEvent::Binary(Bytes::from_static(b"Hello"))) + .await + .unwrap(); + + // The server observes both packets. + assert_eq!( + rx.recv().await.unwrap(), + Event::Message(sid, "Hello".into()) + ); + assert_eq!( + rx.recv().await.unwrap(), + Event::Binary(sid, Bytes::from_static(b"Hello")) + ); + + // And echoes them back through the read half, in order. + match crx.next().await { + Some(Ok(EioEvent::Message(msg))) => assert_eq!(msg, "Hello"), + other => panic!("expected echoed message, got {other:?}"), + } + match crx.next().await { + Some(Ok(EioEvent::Binary(data))) => assert_eq!(data, Bytes::from_static(b"Hello")), + other => panic!("expected echoed binary, got {other:?}"), + } +} diff --git a/crates/engineioxide-core/src/packet.rs b/crates/engineioxide-core/src/packet.rs index 0d16416d..1b275a70 100644 --- a/crates/engineioxide-core/src/packet.rs +++ b/crates/engineioxide-core/src/packet.rs @@ -223,6 +223,7 @@ impl Packet { .ok_or(PacketParseError::InvalidPacketType(None))?; let is_upgrade = value.len() == 6 && &value[1..6] == "probe"; let res = match packet_type { + b'0' => Packet::Open(serde_json::from_slice(&value.as_bytes()[1..])?), b'1' => Packet::Close, b'2' if is_upgrade => Packet::PingUpgrade, b'2' => Packet::Ping, diff --git a/crates/engineioxide-core/src/payload/encoder.rs b/crates/engineioxide-core/src/payload/encoder.rs index af0ac536..469acf75 100644 --- a/crates/engineioxide-core/src/payload/encoder.rs +++ b/crates/engineioxide-core/src/payload/encoder.rs @@ -7,14 +7,21 @@ //! * binary encoder (used when there are binary packets and the client supports binary) //! -use std::pin::Pin; +use std::{ + convert::Infallible, + pin::Pin, + task::{Poll, ready}, +}; +use bytes::Bytes; use futures_util::{FutureExt, Stream, StreamExt}; +use http_body::Body; +use pin_project_lite::pin_project; use smallvec::smallvec; use crate::{ packet::PacketBuf, - payload::{Payload, peekable::Peekable}, + payload::{PACKET_SEPARATOR_V4, Payload, peekable::Peekable}, }; #[cfg(feature = "v3")] @@ -54,6 +61,111 @@ async fn poll_packet(mut rx: Pin<&mut Peekable>>) packet } +pin_project! { + pub struct V4StreamEncoder> { + #[pin] + rx: Peekable, + max_payload: u64, + sent_bytes: u64 + } +} + +impl> V4StreamEncoder { + pub fn new(rx: Peekable, max_payload: u64) -> Self { + Self { + rx, + max_payload, + sent_bytes: 0, + } + } +} + +impl> V4StreamEncoder { + fn encode_packets(packets: PacketBuf, size: u64, sent_bytes: &mut u64) -> Option { + let mut data = String::with_capacity(size as usize); + if packets.is_empty() { + return None; + } + + for packet in packets { + let packet: String = packet.into(); + + if *sent_bytes > 0 { + data.push(std::char::from_u32(PACKET_SEPARATOR_V4 as u32).unwrap()); + } + data.push_str(&packet); + } + + *sent_bytes += data.len() as u64 + PACKET_SEPARATOR_V4 as u64; + + Some(data.into()) + } + + fn validate_payload_size( + packets: &PacketBuf, + sent_bytes: &u64, + max_payload: &u64, + ) -> Option { + const PUNCTUATION_LEN: u64 = 1; + let size = packets + .iter() + .map(|p| p.get_size_hint(false)) + .sum::() as u64 + + PUNCTUATION_LEN; + + if *sent_bytes + size > *max_payload { + None + } else { + Some(size) + } + } +} + +impl> Stream for V4StreamEncoder { + type Item = Bytes; + + fn poll_next( + self: Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + let mut this = self.project(); + + match this.rx.as_mut().poll_peek(cx) { + Poll::Ready(Some(v)) + if let Some(size) = + Self::validate_payload_size(v, this.sent_bytes, this.max_payload) => + { + *this.sent_bytes += size as u64; + let packets = ready!(this.rx.poll_next(cx)).expect("we just peeked Some packets"); + Poll::Ready(Self::encode_packets(packets, size, this.sent_bytes)) + } + Poll::Ready(Some(_)) => { + #[cfg(feature = "tracing")] + tracing::debug!("payload too big, stopping encoding for this payload"); + Poll::Ready(None) + } + Poll::Ready(None) => Poll::Ready(None), + Poll::Pending if *this.sent_bytes == 0 => Poll::Pending, + Poll::Pending => Poll::Ready(None), + } + } +} + +impl> Body for V4StreamEncoder { + type Data = Bytes; + type Error = Infallible; + + fn poll_frame( + self: Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll, Self::Error>>> { + match ready!(self.poll_next(cx)) { + Some(frame) => Poll::Ready(Some(Ok(http_body::Frame::data(frame)))), + None => Poll::Ready(None), + } + } +} + /// Encode multiple packets into a string payload according to the /// [engine.io v4 protocol](https://socket.io/fr/docs/v4/engine-io-protocol/#http-long-polling-1) pub async fn v4_encoder( diff --git a/crates/engineioxide-core/src/payload/mod.rs b/crates/engineioxide-core/src/payload/mod.rs index 23f153b7..0dc6d808 100644 --- a/crates/engineioxide-core/src/payload/mod.rs +++ b/crates/engineioxide-core/src/payload/mod.rs @@ -10,6 +10,8 @@ mod buf; mod decoder; mod encoder; +pub use encoder::V4StreamEncoder; + const PACKET_SEPARATOR_V4: u8 = b'\x1e'; #[cfg(feature = "v3")] const STRING_PACKET_SEPARATOR_V3: u8 = b':'; @@ -74,6 +76,10 @@ impl Payload { } } +pub fn encoder_2<'a, S: Stream>(rx: S, max_payload: u64) -> V4StreamEncoder { + V4StreamEncoder::new(peekable::Peekable::new(rx), max_payload) +} + /// Encodes a payload into a byte stream. pub async fn encoder( rx: impl Stream, diff --git a/crates/engineioxide/src/service/parser.rs b/crates/engineioxide/src/service/parser.rs index 2cb5623a..093629c5 100644 --- a/crates/engineioxide/src/service/parser.rs +++ b/crates/engineioxide/src/service/parser.rs @@ -83,6 +83,11 @@ pub enum ParseError { #[error("unsupported protocol version")] UnsupportedProtocolVersion, } +impl From for ParseError { + fn from(_: engineioxide_core::UnknownTransportError) -> Self { + ParseError::UnknownTransport + } +} /// Convert an error into an http response /// If it is a known error, return the appropriate http status code