diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..355f57d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "templates/decky"] + path = templates/decky + url = https://git.ngni.us/NG-SD-Plugins/usdpl-decky-plugin-template diff --git a/Cargo.lock b/Cargo.lock index 6af977b..1cf8485 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,120 +4,84 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", - "opaque-debug", -] - -[[package]] -name = "aes-gcm-siv" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "polyval", - "subtle", - "zeroize", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -138,6 +102,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "block-buffer" version = "0.9.0" @@ -149,27 +119,30 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.0.79" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -177,15 +150,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -204,42 +168,33 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher", -] - [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.85", ] [[package]] @@ -253,9 +208,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding" @@ -322,24 +277,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] -name = "errno" -version = "0.3.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -350,12 +300,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fixedbitset" @@ -365,9 +312,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "libz-sys", @@ -382,18 +329,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -406,9 +353,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -416,15 +363,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -433,38 +380,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -490,9 +437,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -511,9 +458,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gloo-net" @@ -551,9 +498,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -563,15 +510,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex-literal" @@ -580,10 +521,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" [[package]] -name = "http" -version = "0.2.9" +name = "home" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -592,15 +542,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -608,34 +558,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - [[package]] name = "itertools" version = "0.10.5" @@ -647,36 +577,36 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libz-sys" -version = "1.1.9" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -685,15 +615,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -701,9 +631,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" @@ -725,7 +655,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] @@ -739,15 +669,15 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "5.9.0" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ "miette-derive", "once_cell", @@ -757,33 +687,44 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.9.0" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", +] + +[[package]] +name = "minicov" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "def6d99771d7c499c26ad4d40eb6645eafd3a1553b35fc26ea5a489a45e82d9a" +dependencies = [ + "cc", + "walkdir", ] [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.8" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -807,57 +748,41 @@ name = "nrpc-build" version = "1.0.0" dependencies = [ "nrpc", - "prettyplease 0.2.10", + "prettyplease 0.2.25", "proc-macro2", "prost-build", "prost-types", "protox", "quote", - "syn 2.0.25", + "syn 2.0.85", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "obfstr" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2b2cbbfd8defa51ff24450a61d73b3ff3e158484ddd274a883e886e6fbaa78" - [[package]] name = "object" -version = "0.31.1" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -865,9 +790,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", @@ -878,15 +803,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -894,29 +819,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -926,27 +851,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", -] +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" @@ -960,19 +876,19 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.10" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92139198957b410250d43fad93e630d956499a625c527eda65175c8680f83387" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -1024,9 +940,9 @@ dependencies = [ [[package]] name = "prost-reflect" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000e1e05ebf7b26e1eba298e66fe4eee6eb19c567d0ffb35e0dd34231cdac4c8" +checksum = "6b823de344848e011658ac981009100818b322421676740546f8b52ed5249428" dependencies = [ "logos", "miette", @@ -1073,9 +989,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1112,12 +1028,12 @@ dependencies = [ [[package]] name = "ratchet_core" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faed301a9f297e8cd3617a2bc79ed17eefa88d5873ed08517c96628b48d1f386" +checksum = "6789222135326999f15197ba858c86596aa6a114a6256de78403a9b30eb5792d" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "bytes", "derive_more", "either", @@ -1136,9 +1052,9 @@ dependencies = [ [[package]] name = "ratchet_deflate" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77238362df52f64482e0bd1c413d2d3d0e20052056ba4d88918ef2e962c86f11" +checksum = "f0635ceae91b65b17684e91d50e641459049d2dbdc2a3f43fa92621c79eba847" dependencies = [ "bytes", "flate2", @@ -1150,9 +1066,9 @@ dependencies = [ [[package]] name = "ratchet_ext" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35f5bf3bd015a94b77730229e895e03af945627984ee5c4f95d40fd9227ea36b" +checksum = "72e2c8c3ec37aa42337d00d7961905bcec79c78ef81b7cae055b3d8c777caae1" dependencies = [ "bytes", "http", @@ -1161,9 +1077,9 @@ dependencies = [ [[package]] name = "ratchet_rs" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d326d7cd4227a7f58b36c1efb16b348f7e2e43e1d1ef032e9b094ff6cec583" +checksum = "81051560fba507ea6f4487499e5374c76383d068b3b5212b3f6c0aea51e0f409" dependencies = [ "ratchet_core", "ratchet_deflate", @@ -1172,34 +1088,34 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.3", + "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" -version = "0.3.2" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.3", + "regex-syntax 0.8.5", ] [[package]] @@ -1210,44 +1126,52 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.37.23" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags", + "bitflags 2.6.0", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "scoped-tls" @@ -1257,29 +1181,44 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.213" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1298,45 +1237,45 @@ dependencies = [ ] [[package]] -name = "signal-hook-registry" -version = "1.4.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - [[package]] name = "syn" version = "1.0.109" @@ -1350,9 +1289,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -1361,43 +1300,42 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.6.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ - "autocfg", "cfg-if", "fastrand", - "redox_syscall", + "once_cell", "rustix", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -1410,33 +1348,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] @@ -1455,52 +1391,42 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array", - "subtle", -] +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "url" -version = "2.4.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1516,10 +1442,8 @@ dependencies = [ "async-trait", "bytes", "gettext-ng", - "hex", "log", "nrpc", - "obfstr", "prost", "ratchet_rs", "tokio", @@ -1532,19 +1456,18 @@ name = "usdpl-build" version = "1.0.0" dependencies = [ "nrpc-build", - "prettyplease 0.2.10", + "prettyplease 0.2.25", "proc-macro2", "prost-build", "prost-types", "quote", - "syn 2.0.25", + "syn 2.0.85", ] [[package]] name = "usdpl-core" version = "1.0.0" dependencies = [ - "aes-gcm-siv", "base64", "hex-literal", ] @@ -1557,11 +1480,9 @@ dependencies = [ "futures", "futures-channel", "gloo-net", - "hex", "js-sys", "log", "nrpc", - "obfstr", "prost", "usdpl-core", "wasm-bindgen", @@ -1578,9 +1499,19 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasi" @@ -1590,34 +1521,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -1627,9 +1559,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1637,31 +1569,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-bindgen-test" -version = "0.3.37" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" +checksum = "d381749acb0943d357dcbd8f0b100640679883fcdeeef04def49daf8d33a5426" dependencies = [ "console_error_panic_hook", "js-sys", + "minicov", "scoped-tls", "wasm-bindgen", "wasm-bindgen-futures", @@ -1670,19 +1603,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.37" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" +checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", + "syn 2.0.85", ] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -1690,55 +1624,53 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "winapi-util" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-sys 0.59.0", ] -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -1747,48 +1679,69 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "zeroize" -version = "1.3.0" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] diff --git a/Cargo.toml b/Cargo.toml index 52e25b7..aeb8ecb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,8 @@ members = [ ] exclude = [ - "templates/decky/backend" + "templates/decky/backend", + "templates/decky/src/rust" ] resolver = "2" diff --git a/templates/decky b/templates/decky new file mode 160000 index 0000000..b82d3ed --- /dev/null +++ b/templates/decky @@ -0,0 +1 @@ +Subproject commit b82d3edf77deba94beef53d4d32c705487da918c diff --git a/usdpl-back/Cargo.toml b/usdpl-back/Cargo.toml index 7346369..6a28374 100644 --- a/usdpl-back/Cargo.toml +++ b/usdpl-back/Cargo.toml @@ -11,8 +11,8 @@ description = "Universal Steam Deck Plugin Library back-end" [features] default = ["blocking"] decky = ["usdpl-core/decky"] +any = [] blocking = [] # synchronous API for async functionality, using tokio -#encrypt = ["usdpl-core", "obfstr", "hex"] [dependencies] usdpl-core = { version = "1.0", path = "../usdpl-core"} @@ -35,10 +35,6 @@ tokio = { version = "1", features = [ "full" ]} async-trait = "0.1.57" async-recursion = "1.0.0" -# encryption helpers -obfstr = { version = "0.3", optional = true } -hex = { version = "0.4", optional = true } - # translations gettext-ng = { version = "0.4.1" } diff --git a/usdpl-back/src/api_common/dirs.rs b/usdpl-back/src/api_common/dirs.rs index c27e12a..8ee7aff 100644 --- a/usdpl-back/src/api_common/dirs.rs +++ b/usdpl-back/src/api_common/dirs.rs @@ -4,9 +4,9 @@ use std::path::PathBuf; /// The home directory of the user currently running the Steam Deck UI. pub fn home() -> Option { - #[cfg(not(any(feature = "decky", feature = "crankshaft")))] + #[cfg(not(any(feature = "decky")))] let result = crate::api_any::dirs::home(); - #[cfg(all(feature = "decky", not(any(feature = "crankshaft"))))] + #[cfg(all(feature = "decky", not(any(feature = "any"))))] let result = crate::api_decky::home() .ok() .map(|x| PathBuf::from(x).join("..").canonicalize().ok()) @@ -17,9 +17,9 @@ pub fn home() -> Option { /// The plugin's root folder. pub fn plugin() -> Option { - #[cfg(not(any(feature = "decky", feature = "crankshaft")))] + #[cfg(not(any(feature = "decky")))] let result = None; // TODO - #[cfg(all(feature = "decky", not(any(feature = "crankshaft"))))] + #[cfg(all(feature = "decky", not(any(feature = "any"))))] let result = crate::api_decky::plugin_dir().ok().map(|x| x.into()); result @@ -27,9 +27,9 @@ pub fn plugin() -> Option { /// The recommended log directory pub fn log() -> Option { - #[cfg(not(any(feature = "decky", feature = "crankshaft")))] + #[cfg(not(any(feature = "decky")))] let result = crate::api_any::dirs::log(); - #[cfg(all(feature = "decky", not(any(feature = "crankshaft"))))] + #[cfg(all(feature = "decky", not(any(feature = "any"))))] let result = crate::api_decky::log_dir().ok().map(|x| x.into()); result diff --git a/usdpl-build/src/front/service_generator.rs b/usdpl-build/src/front/service_generator.rs index f41d4c4..fcaa592 100644 --- a/usdpl-build/src/front/service_generator.rs +++ b/usdpl-build/src/front/service_generator.rs @@ -55,7 +55,7 @@ fn generate_service_methods( #field_name: #js_type_name, }); params_to_fields.push(quote::quote! { - #field_name: #rs_type_name::from_wasm(#field_name.into()),//: #field_name, + #field_name: #rs_type_name::from_wasm(#field_name),//: #field_name, }); } let params_to_fields_transformer = if input_type.field.len() == 1 { @@ -67,11 +67,11 @@ fn generate_service_methods( .expect("Protobuf message field needs a name") ); quote::quote! { - let val = #method_input::from_wasm(#field_name.into()); + let val = #method_input::from_wasm(#field_name); } } else if input_type.field.is_empty() { quote::quote! { - let val = #method_input {}; + let val = (); } } else { quote::quote! { @@ -94,22 +94,8 @@ fn generate_service_methods( }, Err(e) => { if let Some(e_handler) = &self.error_handler { - let error_info = js_sys::Object::new(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("service"), - &JsValue::from(self.service.descriptor()) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("method"), - &JsValue::from(#method_name_str) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("error"), - &JsValue::from("todo"/*TODO*/) - ).unwrap(); + let error_info = nrpc_error_to_jsobj(self.service.descriptor(), #method_name_str, &e); + if let Err(call_e) = e_handler.call1(&JsValue::UNDEFINED, &error_info) { // log error log::error!("service:{}|method:{}|error:{}|js error:{}", self.service.descriptor(), #method_name_str, e, @@ -145,22 +131,8 @@ fn generate_service_methods( }, Err(e) => { if let Some(e_handler) = &self.error_handler { - let error_info = js_sys::Object::new(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("service"), - &JsValue::from(self.service.descriptor()) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("method"), - &JsValue::from(#method_name_str) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("error"), - &JsValue::from("todo"/*TODO*/) - ).unwrap(); + let error_info = nrpc_error_to_jsobj(self.service.descriptor(), #method_name_str, &e); + if let Err(call_e) = e_handler.call1(&JsValue::UNDEFINED, &error_info) { // log error log::error!("service:{}|method:{}|error:{}|js error:{}", self.service.descriptor(), #method_name_str, e, @@ -215,7 +187,7 @@ fn generate_service_methods( } } else if input_type.field.is_empty() { quote::quote! { - let val = #method_input {}; + let val = (); } } else { quote::quote! { @@ -236,22 +208,8 @@ fn generate_service_methods( match next_result { Err(e) => { if let Some(e_handler) = &self.error_handler { - let error_info = js_sys::Object::new(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("service"), - &JsValue::from(self.service.descriptor()) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("method"), - &JsValue::from(#method_name_str) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("error"), - &JsValue::from("todo"/*TODO*/) - ).unwrap(); + let error_info = nrpc_error_to_jsobj(self.service.descriptor(), #method_name_str, &e); + if let Err(call_e) = e_handler.call1(&JsValue::UNDEFINED, &error_info) { // log error log::error!("service:{}|method:{}|error:{}|js error:{}", self.service.descriptor(), #method_name_str, e, @@ -293,22 +251,8 @@ fn generate_service_methods( }, Err(e) => { if let Some(e_handler) = &self.error_handler { - let error_info = js_sys::Object::new(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("service"), - &JsValue::from(self.service.descriptor()) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("method"), - &JsValue::from(#method_name_str) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("error"), - &JsValue::from("todo"/*TODO*/) - ).unwrap(); + let error_info = nrpc_error_to_jsobj(self.service.descriptor(), #method_name_str, &e); + if let Err(call_e) = e_handler.call1(&JsValue::UNDEFINED, &error_info) { // log error log::error!("service:{}|method:{}|error:{}|js error:{}", self.service.descriptor(), #method_name_str, e, @@ -342,22 +286,8 @@ fn generate_service_methods( match next_result { Err(e) => { if let Some(e_handler) = &self.error_handler { - let error_info = js_sys::Object::new(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("service"), - &JsValue::from(self.service.descriptor()) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("method"), - &JsValue::from(#method_name_str) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("error"), - &JsValue::from("todo"/*TODO*/) - ).unwrap(); + let error_info = nrpc_error_to_jsobj(self.service.descriptor(), #method_name_str, &e); + if let Err(call_e) = e_handler.call1(&JsValue::UNDEFINED, &error_info) { // log error log::error!("service:{}|method:{}|error:{}|js error:{}", self.service.descriptor(), #method_name_str, e, @@ -399,22 +329,8 @@ fn generate_service_methods( }, Err(e) => { if let Some(e_handler) = &self.error_handler { - let error_info = js_sys::Object::new(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("service"), - &JsValue::from(self.service.descriptor()) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("method"), - &JsValue::from(#method_name_str) - ).unwrap(); - js_sys::Reflect::set( - &error_info, - &JsValue::from("error"), - &JsValue::from("todo"/*TODO*/) - ).unwrap(); + let error_info = nrpc_error_to_jsobj(self.service.descriptor(), #method_name_str, &e); + if let Err(call_e) = e_handler.call1(&JsValue::UNDEFINED, &error_info) { // log error log::error!("service:{}|method:{}|error:{}|js error:{}", self.service.descriptor(), #method_name_str, e, @@ -622,7 +538,21 @@ fn generate_wasm_struct_interop( if descriptor.field.len() == 0 { quote::quote! { pub type #msg_name = (); - pub type #msg_name_wasm = #msg_name; + pub type #msg_name_wasm = JsValue;//#msg_name; + + impl std::convert::Into for #msg_name { + #[inline] + fn into(self) -> super::#super_msg_name { + super::#super_msg_name {} + } + } + + impl std::convert::From for #msg_name { + #[inline] + fn from(_: super::#super_msg_name) -> Self { + () + } + } #(#gen_nested_types)* @@ -662,7 +592,8 @@ fn generate_wasm_struct_interop( } } };*/ - + let into_converter_tokens = type_enum.to_into_prost_type(); + let from_converter_tokens = type_enum.to_from_prost_type(&field_name); quote::quote! { pub type #msg_name = #type_name; @@ -672,7 +603,7 @@ fn generate_wasm_struct_interop( #[inline] fn into(self) -> super::#super_msg_name { super::#super_msg_name { - #field_name: self + #field_name: self #into_converter_tokens } } } @@ -681,7 +612,8 @@ fn generate_wasm_struct_interop( #[inline] #[allow(unused_variables)] fn from(other: super::#super_msg_name) -> Self { - other.#field_name + #from_converter_tokens + //other.#field_name } } @@ -692,8 +624,11 @@ fn generate_wasm_struct_interop( #(#gen_enums)* } } else { + // struct with more than one field + let mut gen_into_wasm_streamable_fields = Vec::with_capacity(descriptor.field.len()); let mut gen_from_wasm_streamable_fields = Vec::with_capacity(descriptor.field.len()); + let mut gen_from_wasm_map_infallible = Vec::with_capacity(descriptor.field.len()); for field in &descriptor.field { let field_name_str = field @@ -710,33 +645,29 @@ fn generate_wasm_struct_interop( let into_wasm_streamable = type_enum.to_into_wasm_streamable(field_name_str, &js_map_name); let from_wasm_streamable = type_enum.to_from_wasm_streamable(field_name_str, &js_map_name); + let from_wasm_map_infallible = type_enum.to_from_map_infallible(field_name_str, &js_map_name); //let wasm_type_name = type_enum.to_wasm_tokens(); gen_fields.push(quote::quote! { pub #field_name: #type_name, }); - gen_into_fields.push(quote::quote! { - #field_name: self.#field_name.into(), + + let into_converter_tokens = type_enum.to_into_prost_type(); + gen_into_fields.push(quote::quote!{ + #field_name: self.#field_name #into_converter_tokens, }); - gen_from_fields.push(quote::quote! { - #field_name: <_>::from(other.#field_name), + let from_converter_tokens = type_enum.to_from_prost_type(&field_name); + gen_from_fields.push(quote::quote!{ + #field_name: #from_converter_tokens, }); gen_into_wasm_streamable_fields.push(into_wasm_streamable); gen_from_wasm_streamable_fields.push(from_wasm_streamable); + gen_from_wasm_map_infallible.push(from_wasm_map_infallible); } - let wasm_attribute_maybe = - if (descriptor.field.len() == 1 || !is_response_msg) && !descriptor.field.is_empty() { - quote::quote! {} - } else { - quote::quote! { - #[wasm_bindgen] - } - }; - quote::quote! { - #wasm_attribute_maybe + #[derive(Default)] pub struct #msg_name { #(#gen_fields)* } @@ -755,7 +686,24 @@ fn generate_wasm_struct_interop( } } - type #msg_name_wasm = #msg_name; + impl IntoWasmable for #msg_name { + fn into_wasm(self) -> js_sys::Map { + let #js_map_name = js_sys::Map::new(); + #(#gen_into_wasm_streamable_fields)* + #js_map_name + } + } + + impl FromWasmable for #msg_name { + fn from_wasm(js: js_sys::Map) -> Self { + let #js_map_name = js_sys::Map::from(js); + Self { + #(#gen_from_wasm_map_infallible)* + } + } + } + + type #msg_name_wasm = js_sys::Map;//#msg_name; impl std::convert::Into for #msg_name { #[inline] @@ -935,7 +883,7 @@ impl ProtobufType { Self::Sfixed32 => quote::quote! {i32}, Self::Sfixed64 => quote::quote! {i64}, Self::Bool => quote::quote! {bool}, - Self::String => quote::quote! {String}, + Self::String => quote::quote! {js_sys::JsString}, Self::Bytes => quote::quote! {Vec}, Self::Repeated(_) => quote::quote! {js_sys::Array}, Self::Map { .. } => quote::quote! {js_sys::Map}, @@ -958,6 +906,27 @@ impl ProtobufType { quote::quote!{#field_ident: #type_tokens::from_wasm_streamable(#js_map_name.get(&JsValue::from(#field_name)))?,} } + fn to_from_map_infallible(&self, field_name: &str, js_map_name: &syn::Ident) -> proc_macro2::TokenStream { + let type_tokens = self.to_tokens(); + let field_ident = quote::format_ident!("{}", field_name); + quote::quote!{#field_ident: #type_tokens::from_wasm_streamable(#js_map_name.get(&JsValue::from(#field_name))).unwrap_or_default(),} + } + + fn to_into_prost_type(&self) -> proc_macro2::TokenStream { + match self { + //Self::String => quote::quote!{.as_string().unwrap()}, + _ => quote::quote!{.into()} + } + + } + + fn to_from_prost_type(&self, field_name: &syn::Ident) -> proc_macro2::TokenStream { + match self { + //Self::String => quote::quote!{#field_name: }, + _ => quote::quote!{<_>::from(other.#field_name)} + } + } + /*fn is_already_wasm_streamable(&self) -> bool { !matches!(self, Self::Custom(_)) }*/ @@ -991,6 +960,9 @@ fn generate_wasm_enum_interop( .as_ref() .expect("Protobuf enum needs a name") ); + if descriptor.value.is_empty() { + panic!("Cannot generate enum {} with 0 variants because it is not possible to initialize", descriptor.name.as_ref().unwrap()); + } let mut gen_values = Vec::with_capacity(descriptor.value.len()); let mut gen_into_values = Vec::with_capacity(descriptor.value.len()); let mut gen_from_values = Vec::with_capacity(descriptor.value.len()); @@ -998,7 +970,10 @@ fn generate_wasm_enum_interop( // TODO deal with options when necessary todo!("Deal with enum options when necessary"); } - for value in &descriptor.value { + gen_values.push(quote::quote!{ + #[default] + }); + for value in descriptor.value.iter() { let val_name = quote::format_ident!( "{}", value @@ -1041,7 +1016,7 @@ fn generate_wasm_enum_interop( quote::quote! { #[wasm_bindgen] #[repr(i32)] - #[derive(Clone, Copy)] + #[derive(Clone, Copy, Default)] pub enum #enum_name { #(#gen_values)* } @@ -1066,34 +1041,46 @@ fn generate_wasm_enum_interop( #impl_wasm_compat - impl FromWasmable for #enum_name { - fn from_wasm(js: i32) -> Self { - #enum_name::from(super::#super_enum_name::from_i32(js).unwrap()) + impl KnownWasmCompatible for #enum_name_wasm {} + + impl FromWasmable<#enum_name_wasm> for #enum_name { + fn from_wasm(js: #enum_name_wasm) -> Self { + js } } - impl IntoWasmable for #enum_name { - fn into_wasm(self) -> i32 { - self as i32 + impl IntoWasmable<#enum_name_wasm> for #enum_name { + fn into_wasm(self) -> #enum_name_wasm { + self } } - impl From for #enum_name { - fn from(other: i32) -> Self { - #enum_name::from(super::#super_enum_name::from_i32(other).unwrap()) + impl std::convert::From for #enum_name { + fn from(x: i32) -> Self { + #enum_name::from(super::#super_enum_name::from_i32(x).unwrap()) } } - impl Into for #enum_name { + impl std::convert::Into for #enum_name { fn into(self) -> i32 { self as i32 } } + impl #enum_name { + fn from_f64(f: f64) -> Self { + Self::from(super::#super_enum_name::from_i32(f as i32).unwrap()) + } + + fn into_f64(self) -> f64 { + (self as i32).into() + } + } + impl ::usdpl_front::wasm::FromWasmStreamableType for #enum_name { fn from_wasm_streamable(js: JsValue) -> Result { if let Some(float) = js.as_f64() { - Ok(Self::from_wasm(float as i32)) + Ok(Self::from_f64(float)) } else { Err(::usdpl_front::wasm::WasmStreamableConversionError::UnexpectedType { expected: ::usdpl_front::wasm::JsType::Number, @@ -1105,7 +1092,7 @@ fn generate_wasm_enum_interop( impl ::usdpl_front::wasm::IntoWasmStreamableType for #enum_name { fn into_wasm_streamable(self) -> JsValue { - JsValue::from(self.into_wasm()) + JsValue::from(self.into_f64()) } } } @@ -1224,6 +1211,49 @@ fn generate_service_io_types( } } +fn generate_error_to_jsobject_fn() -> proc_macro2::TokenStream { + quote::quote!{ + #[allow(dead_code)] + fn nrpc_error_to_jsobj(descriptor: &str, method_name: &str, error: &usdpl_front::_helpers::nrpc::ServiceError) -> js_sys::Object { + let js_error = js_sys::Object::new(); + js_sys::Reflect::set( + &js_error, + &JsValue::from("variant"), + &JsValue::from(error.variant()) + ).unwrap(); + js_sys::Reflect::set( + &js_error, + &JsValue::from("name"), + &JsValue::from(error.variant_str()) + ).unwrap(); + js_sys::Reflect::set( + &js_error, + &JsValue::from("message"), + &JsValue::from(error.to_string()) + ).unwrap(); + + let error_info = js_sys::Object::new(); + js_sys::Reflect::set( + &error_info, + &JsValue::from("service"), + &JsValue::from(descriptor) + ).unwrap(); + js_sys::Reflect::set( + &error_info, + &JsValue::from("method"), + &JsValue::from(method_name) + ).unwrap(); + js_sys::Reflect::set( + &error_info, + &JsValue::from("error"), + &JsValue::from("todo"/*TODO*/) + ).unwrap(); + + error_info + } + } +} + impl IServiceGenerator for WasmServiceGenerator { fn generate(&mut self, service: Service) -> proc_macro2::TokenStream { let lock = self.shared.lock().expect("Cannot lock shared state"); @@ -1236,6 +1266,7 @@ impl IServiceGenerator for WasmServiceGenerator { let service_str_name = service.name.clone(); let service_methods = generate_service_methods(&service, fds); let service_types = generate_service_io_types(&service, fds); + let error_translate_fn = generate_error_to_jsobject_fn(); let mod_name = quote::format_ident!("js_{}", service.name.to_lowercase()); quote::quote! { mod #mod_name { @@ -1254,6 +1285,8 @@ impl IServiceGenerator for WasmServiceGenerator { use usdpl_front::WebSocketHandler; + #error_translate_fn + #service_types /// WASM/JS-compatible wrapper of a Rust nRPC service diff --git a/usdpl-core/Cargo.toml b/usdpl-core/Cargo.toml index cb6d07a..321a467 100644 --- a/usdpl-core/Cargo.toml +++ b/usdpl-core/Cargo.toml @@ -9,14 +9,12 @@ readme = "../README.md" description = "Universal Steam Deck Plugin Library core designed for all architectures" [features] -default = [] +default = ["any"] decky = [] -encrypt = ["aes-gcm-siv"] +any = [] [dependencies] base64 = "0.13" -aes-gcm-siv = { version = "0.10", optional = true, default-features = false, features = ["alloc", "aes"] } -# nrpc = "0.2" [dev-dependencies] hex-literal = "0.3.4" diff --git a/usdpl-core/src/api_common/target.rs b/usdpl-core/src/api_common/target.rs index 4d5d378..166fcaf 100644 --- a/usdpl-core/src/api_common/target.rs +++ b/usdpl-core/src/api_common/target.rs @@ -10,11 +10,11 @@ impl Platform { /// The current platform that usdpl-core is configured to target. /// This is determined by feature flags. pub fn current() -> Self { - #[cfg(all(feature = "decky", not(any(feature = "crankshaft"))))] + #[cfg(all(feature = "decky", not(any(feature = "any"))))] { Self::Decky } - #[cfg(not(any(feature = "decky")))] + #[cfg(feature = "any")] { Self::Any } diff --git a/usdpl-front/Cargo.toml b/usdpl-front/Cargo.toml index 725a3f0..507d820 100644 --- a/usdpl-front/Cargo.toml +++ b/usdpl-front/Cargo.toml @@ -15,7 +15,6 @@ crate-type = ["cdylib", "rlib"] default = [] decky = ["usdpl-core/decky"] debug = ["console_error_panic_hook"] -#encrypt = ["usdpl-core/encrypt", "obfstr", "hex"] [dependencies] wasm-bindgen = "0.2" @@ -41,9 +40,6 @@ web-sys = { version = "0.3", features = [ ]} js-sys = { version = "0.3" } -obfstr = { version = "0.3", optional = true } -hex = { version = "0.4", optional = true } - nrpc = { version = "1.0", path = "../../nRPC/nrpc", default-features = false} usdpl-core = { version = "1.0", path = "../usdpl-core" } prost = "0.11" diff --git a/usdpl-front/src/lib.rs b/usdpl-front/src/lib.rs index 959b65c..8b41c27 100644 --- a/usdpl-front/src/lib.rs +++ b/usdpl-front/src/lib.rs @@ -32,11 +32,6 @@ const DEFAULT_LOGGER: console_logs::BuiltInLogger = console_logs::BuiltInLogger: static mut CACHE: Option> = None; -#[cfg(feature = "encrypt")] -fn encryption_key() -> Vec { - hex::decode(obfstr::obfstr!(env!("USDPL_ENCRYPTION_KEY"))).unwrap() -} - static INIT_DONE: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); /// Initialize the front-end library diff --git a/usdpl-front/src/wasm/mod.rs b/usdpl-front/src/wasm/mod.rs index 17bf56b..6aaa1ff 100644 --- a/usdpl-front/src/wasm/mod.rs +++ b/usdpl-front/src/wasm/mod.rs @@ -2,6 +2,7 @@ mod arrays; mod js_function_stream; mod maps; +mod not_quite_trivial; mod streaming; mod trivials; mod wasm_traits; diff --git a/usdpl-front/src/wasm/not_quite_trivial.rs b/usdpl-front/src/wasm/not_quite_trivial.rs new file mode 100644 index 0000000..95c7e41 --- /dev/null +++ b/usdpl-front/src/wasm/not_quite_trivial.rs @@ -0,0 +1,25 @@ +use super::{FromWasmable, IntoWasmable}; + +impl FromWasmable for String { + fn from_wasm(js: js_sys::JsString) -> Self { + js.as_string().unwrap() + } +} + +impl IntoWasmable for String { + fn into_wasm(self) -> js_sys::JsString { + js_sys::JsString::from(self) + } +} + +impl FromWasmable for () { + fn from_wasm(_: wasm_bindgen::JsValue) -> Self { + () + } +} + +impl IntoWasmable for () { + fn into_wasm(self) -> wasm_bindgen::JsValue { + wasm_bindgen::JsValue::undefined() + } +} diff --git a/usdpl-front/src/wasm/trivials.rs b/usdpl-front/src/wasm/trivials.rs index 3187e26..571caf7 100644 --- a/usdpl-front/src/wasm/trivials.rs +++ b/usdpl-front/src/wasm/trivials.rs @@ -35,6 +35,7 @@ trivial_convert! { u64 } trivial_convert! { u128 } trivial_convert! { bool } + trivial_convert! { String } trivial_convert! { () } diff --git a/usdpl-front/src/wasm/wasm_traits.rs b/usdpl-front/src/wasm/wasm_traits.rs index ec1ec9f..19df10a 100644 --- a/usdpl-front/src/wasm/wasm_traits.rs +++ b/usdpl-front/src/wasm/wasm_traits.rs @@ -38,3 +38,5 @@ impl KnownWasmCompatible for () {} impl KnownWasmCompatible for js_sys::Map {} impl KnownWasmCompatible for js_sys::Array {} +impl KnownWasmCompatible for wasm_bindgen::JsValue {} +impl KnownWasmCompatible for js_sys::JsString {}