This commit is contained in:
Alexander Medvedev 2026-01-28 23:40:48 +01:00
parent fb13004b47
commit b58822319d
406 changed files with 2652 additions and 2298 deletions

339
Cargo.lock generated
View File

@ -281,9 +281,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.53" version = "1.2.54"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583"
dependencies = [ dependencies = [
"find-msvc-tools", "find-msvc-tools",
"shlex", "shlex",
@ -318,13 +318,13 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]] [[package]]
name = "chacha20" name = "chacha20"
version = "0.10.0-rc.8" version = "0.10.0-rc.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31cd65b2ca03198c223cd9a8fa1152c4ec251cd79049f6dc584152ad3fb5ba9d" checksum = "c81d916c6ae06736ec667b51f95ee5ff660a75f4ea6ce1bd932c942365c0ea43"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
] ]
[[package]] [[package]]
@ -366,18 +366,18 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.54" version = "4.5.55"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
] ]
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.54" version = "4.5.55"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"clap_lex", "clap_lex",
@ -636,15 +636,14 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]] [[package]]
name = "crossfire" name = "crossfire"
version = "2.1.10" version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd901251b9b46c1752c85edfee0aee718c03a85a065f4126d32e5d6d419edf48" checksum = "7e1ff29ef3add47897a4dab381889ccf8dedcedec4e2c8feed37efcf22a6392b"
dependencies = [ dependencies = [
"crossbeam-queue",
"crossbeam-utils", "crossbeam-utils",
"enum_dispatch",
"futures-core", "futures-core",
"parking_lot", "parking_lot",
"smallvec",
] ]
[[package]] [[package]]
@ -667,13 +666,13 @@ dependencies = [
[[package]] [[package]]
name = "crypto-bigint" name = "crypto-bigint"
version = "0.7.0-rc.21" version = "0.7.0-rc.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9f9a78b88bb8255ec59a81423aa92ada22f96883f9ae59dcb68613907636ae5" checksum = "053c3561863ce55e3226ecc48b08679f4b66cb1b92b9afb42c2c402dfe8b9b51"
dependencies = [ dependencies = [
"ctutils", "ctutils",
"num-traits", "num-traits",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
"serdect", "serdect",
"zeroize", "zeroize",
] ]
@ -699,13 +698,13 @@ dependencies = [
[[package]] [[package]]
name = "crypto-primes" name = "crypto-primes"
version = "0.7.0-pre.7" version = "0.7.0-pre.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6372ba15f988d7cd77e9cfbc42b269601c006f2f16a21a72b886136caf04bfb" checksum = "334a79c97c0b7fa536716dc132fd417d0afbf471440a41fc25a5d9f66d8771cd"
dependencies = [ dependencies = [
"crypto-bigint 0.7.0-rc.21", "crypto-bigint 0.7.0-rc.22",
"libm", "libm",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
] ]
[[package]] [[package]]
@ -776,9 +775,9 @@ dependencies = [
[[package]] [[package]]
name = "digest" name = "digest"
version = "0.11.0-rc.8" version = "0.11.0-rc.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fc1408b7a9f59a7b933faff3e9e7fc15a05a524effd3b3d1601156944c8077f" checksum = "bff8de092798697546237a3a701e4174fe021579faec9b854379af9bf1e31962"
dependencies = [ dependencies = [
"block-buffer 0.11.0", "block-buffer 0.11.0",
"const-oid 0.10.2", "const-oid 0.10.2",
@ -959,6 +958,12 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foldhash"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]] [[package]]
name = "foldhash" name = "foldhash"
version = "0.2.0" version = "0.2.0"
@ -1099,15 +1104,16 @@ dependencies = [
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.4.0-rc.0" version = "0.4.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b99f0d993a2b9b97b9a201193aa8ad21305cde06a3be9a7e1f8f4201e5cc27e" checksum = "74f70a332ddf75e5e5e43284304179ba02f391f82f692f030b08a8378adf3c99"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"r-efi", "r-efi",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
"wasip2", "wasip2",
"wasip3",
] ]
[[package]] [[package]]
@ -1157,6 +1163,15 @@ version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash 0.1.5",
]
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.16.1" version = "0.16.1"
@ -1165,7 +1180,7 @@ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [ dependencies = [
"allocator-api2", "allocator-api2",
"equivalent", "equivalent",
"foldhash", "foldhash 0.2.0",
] ]
[[package]] [[package]]
@ -1213,11 +1228,11 @@ dependencies = [
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.13.0-rc.3" version = "0.13.0-rc.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1c597ac7d6cc8143e30e83ef70915e7f883b18d8bec2e2b2bce47f5bbb06d57" checksum = "d9956e202a691c5c86c60303a421f66f93f44b29433407b7c43cf2bebadc750e"
dependencies = [ dependencies = [
"digest 0.11.0-rc.8", "digest 0.11.0-rc.9",
] ]
[[package]] [[package]]
@ -1282,9 +1297,9 @@ checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424"
[[package]] [[package]]
name = "hybrid-array" name = "hybrid-array"
version = "0.4.5" version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f471e0a81b2f90ffc0cb2f951ae04da57de8baa46fa99112b062a5173a5088d0" checksum = "b41fb3dc24fe72c2e3a4685eed55917c2fb228851257f4a8f2d985da9443c3e5"
dependencies = [ dependencies = [
"typenum", "typenum",
] ]
@ -1427,6 +1442,12 @@ dependencies = [
"zerovec", "zerovec",
] ]
[[package]]
name = "id-arena"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]] [[package]]
name = "idna" name = "idna"
version = "1.1.0" version = "1.1.0"
@ -1539,6 +1560,12 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "leb128fmt"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.180" version = "0.2.180"
@ -1557,9 +1584,9 @@ dependencies = [
[[package]] [[package]]
name = "libm" name = "libm"
version = "0.2.15" version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
@ -1723,9 +1750,9 @@ dependencies = [
[[package]] [[package]]
name = "num-conv" name = "num-conv"
version = "0.1.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
[[package]] [[package]]
name = "num-derive" name = "num-derive"
@ -2002,9 +2029,9 @@ dependencies = [
[[package]] [[package]]
name = "pkcs8" name = "pkcs8"
version = "0.11.0-rc.9" version = "0.11.0-rc.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80f8fa6196ede5a9f9ee95b44ca134bddc9b70e8913f9297bd58c909f5889a09" checksum = "b226d2cc389763951db8869584fd800cbbe2962bf454e2edeb5172b31ee99774"
dependencies = [ dependencies = [
"der 0.8.0-rc.10", "der 0.8.0-rc.10",
"spki 0.8.0-rc.4", "spki 0.8.0-rc.4",
@ -2040,6 +2067,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn",
]
[[package]] [[package]]
name = "primeorder" name = "primeorder"
version = "0.13.6" version = "0.13.6"
@ -2121,13 +2158,14 @@ dependencies = [
"bytes", "bytes",
"console-subscriber", "console-subscriber",
"crossbeam", "crossbeam",
"dashmap",
"flate2", "flate2",
"futures", "futures",
"hmac 0.13.0-rc.3", "hmac 0.13.0-rc.4",
"libloading", "libloading",
"log", "log",
"num-bigint", "num-bigint",
"pkcs8 0.11.0-rc.9", "pkcs8 0.11.0-rc.10",
"pumpkin-config", "pumpkin-config",
"pumpkin-data", "pumpkin-data",
"pumpkin-inventory", "pumpkin-inventory",
@ -2347,12 +2385,12 @@ dependencies = [
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.10.0-rc.7" version = "0.10.0-rc.8"
source = "git+https://github.com/rust-random/rand#7a81944044f3f1d2dc5c85a8ca9bd30429f46bd0" source = "git+https://github.com/rust-random/rand#47455a0b004d5992d2a3d23ecf244f1edea27f40"
dependencies = [ dependencies = [
"chacha20", "chacha20",
"getrandom 0.4.0-rc.0", "getrandom 0.4.0-rc.1",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
] ]
[[package]] [[package]]
@ -2366,9 +2404,9 @@ dependencies = [
[[package]] [[package]]
name = "rand_core" name = "rand_core"
version = "0.10.0-rc-5" version = "0.10.0-rc-6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05a06e03bd1f2ae861ab9e7498b6c64ed3dadb9ce175c0464a2522a5f23c0045" checksum = "70765ff7112b0fb2d272d24d9a2f907fc206211304328fe58b2db15a5649ef28"
[[package]] [[package]]
name = "rayon" name = "rayon"
@ -2454,19 +2492,19 @@ dependencies = [
[[package]] [[package]]
name = "rsa" name = "rsa"
version = "0.10.0-rc.13" version = "0.10.0-rc.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ff85dd219e338d42a2eada54ad71fe515717e08d53f728a8803de33b83f80b8" checksum = "6ef381dd6f207f81aff2ee3a8264eddd68ba475bbfcdb44ca445e5906bce381b"
dependencies = [ dependencies = [
"const-oid 0.10.2", "const-oid 0.10.2",
"crypto-bigint 0.7.0-rc.21", "crypto-bigint 0.7.0-rc.22",
"crypto-primes", "crypto-primes",
"digest 0.11.0-rc.8", "digest 0.11.0-rc.9",
"pkcs1", "pkcs1",
"pkcs8 0.11.0-rc.9", "pkcs8 0.11.0-rc.10",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
"sha1", "sha1",
"signature 3.0.0-rc.8", "signature 3.0.0-rc.9",
"spki 0.8.0-rc.4", "spki 0.8.0-rc.4",
"zeroize", "zeroize",
] ]
@ -2591,6 +2629,12 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "semver"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.228" version = "1.0.228"
@ -2672,7 +2716,7 @@ checksum = "9c777f0a122a53fddb0beb6e706771197000b8eb5c9f42b5b850f450ef48c788"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"digest 0.11.0-rc.8", "digest 0.11.0-rc.9",
] ]
[[package]] [[package]]
@ -2694,7 +2738,7 @@ checksum = "7535f94fa3339fe9e5e9be6260a909e62af97f6e14b32345ccf79b92b8b81233"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"digest 0.11.0-rc.8", "digest 0.11.0-rc.9",
] ]
[[package]] [[package]]
@ -2734,12 +2778,12 @@ dependencies = [
[[package]] [[package]]
name = "signature" name = "signature"
version = "3.0.0-rc.8" version = "3.0.0-rc.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c04b70a14ee5f15e2e0c785a5fdb2e9a51138dfe13ba3cf8eab037a9e60b1879" checksum = "0ad0ce3b3f8efd7406f22e2ca5d02be21cdf3b3d1d53ab141f784de8965c7c7e"
dependencies = [ dependencies = [
"digest 0.11.0-rc.8", "digest 0.11.0-rc.9",
"rand_core 0.10.0-rc-5", "rand_core 0.10.0-rc-6",
] ]
[[package]] [[package]]
@ -2762,9 +2806,9 @@ dependencies = [
[[package]] [[package]]
name = "siphasher" name = "siphasher"
version = "1.0.1" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
[[package]] [[package]]
name = "slab" name = "slab"
@ -2789,9 +2833,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.60.2", "windows-sys 0.60.2",
@ -2904,18 +2948,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "2.0.17" version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "2.0.17" version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2933,9 +2977,9 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.45" version = "0.3.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5"
dependencies = [ dependencies = [
"deranged", "deranged",
"itoa", "itoa",
@ -2950,15 +2994,15 @@ dependencies = [
[[package]] [[package]]
name = "time-core" name = "time-core"
version = "0.1.7" version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
[[package]] [[package]]
name = "time-macros" name = "time-macros"
version = "0.2.25" version = "0.2.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd" checksum = "78cc610bac2dcee56805c99642447d4c5dbde4d01f752ffea0199aee1f601dc4"
dependencies = [ dependencies = [
"num-conv", "num-conv",
"time-core", "time-core",
@ -3242,6 +3286,12 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]] [[package]]
name = "untrusted" name = "untrusted"
version = "0.9.0" version = "0.9.0"
@ -3366,7 +3416,16 @@ version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
dependencies = [ dependencies = [
"wit-bindgen", "wit-bindgen 0.51.0",
]
[[package]]
name = "wasip3"
version = "0.3.1+wasi-0.3.0-rc-2025-09-16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87ba4be47b1d11244670d11857eee0758a8f2c39aea64d80b78c1ce29b4642cd"
dependencies = [
"wit-bindgen 0.48.1",
] ]
[[package]] [[package]]
@ -3414,6 +3473,40 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "wasm-encoder"
version = "0.241.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01164c9dda68301e34fdae536c23ed6fe90ce6d97213ccc171eebbd3d02d6b8"
dependencies = [
"leb128fmt",
"wasmparser",
]
[[package]]
name = "wasm-metadata"
version = "0.241.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "876fe286f2fa416386deedebe8407e6f19e0b5aeaef3d03161e77a15fa80f167"
dependencies = [
"anyhow",
"indexmap",
"wasm-encoder",
"wasmparser",
]
[[package]]
name = "wasmparser"
version = "0.241.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8"
dependencies = [
"bitflags",
"hashbrown 0.15.5",
"indexmap",
"semver",
]
[[package]] [[package]]
name = "webpki-roots" name = "webpki-roots"
version = "1.0.5" version = "1.0.5"
@ -3631,12 +3724,100 @@ version = "0.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
[[package]]
name = "wit-bindgen"
version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f8c2adb5f74ac9395bc3121c99a1254bf9310482c27b13f97167aedb5887138"
dependencies = [
"wit-bindgen-rust-macro",
]
[[package]] [[package]]
name = "wit-bindgen" name = "wit-bindgen"
version = "0.51.0" version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
[[package]]
name = "wit-bindgen-core"
version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b881a098cae03686d7a0587f8f306f8a58102ad8da8b5599100fbe0e7f5800b"
dependencies = [
"anyhow",
"heck",
"wit-parser",
]
[[package]]
name = "wit-bindgen-rust"
version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69667efa439a453e1d50dac939c6cab6d2c3ac724a9d232b6631dad2472a5b70"
dependencies = [
"anyhow",
"heck",
"indexmap",
"prettyplease",
"syn",
"wasm-metadata",
"wit-bindgen-core",
"wit-component",
]
[[package]]
name = "wit-bindgen-rust-macro"
version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eae2e22cceb5d105d52326c07e3e67603a861cc7add70fc467f7cc7ec5265017"
dependencies = [
"anyhow",
"prettyplease",
"proc-macro2",
"quote",
"syn",
"wit-bindgen-core",
"wit-bindgen-rust",
]
[[package]]
name = "wit-component"
version = "0.241.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241"
dependencies = [
"anyhow",
"bitflags",
"indexmap",
"log",
"serde",
"serde_derive",
"serde_json",
"wasm-encoder",
"wasm-metadata",
"wasmparser",
"wit-parser",
]
[[package]]
name = "wit-parser"
version = "0.241.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ef1c6ad67f35c831abd4039c02894de97034100899614d1c44e2268ad01c91"
dependencies = [
"anyhow",
"id-arena",
"indexmap",
"log",
"semver",
"serde",
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser",
]
[[package]] [[package]]
name = "writeable" name = "writeable"
version = "0.6.2" version = "0.6.2"
@ -3668,18 +3849,18 @@ dependencies = [
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.33" version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" checksum = "fdea86ddd5568519879b8187e1cf04e24fce28f7fe046ceecbce472ff19a2572"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.33" version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" checksum = "0c15e1b46eff7c6c91195752e0eeed8ef040e391cdece7c25376957d5f15df22"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -3748,6 +3929,6 @@ dependencies = [
[[package]] [[package]]
name = "zmij" name = "zmij"
version = "1.0.14" version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea" checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439"

View File

@ -16,7 +16,7 @@ members = [
[workspace.lints.clippy] [workspace.lints.clippy]
# Groups # Groups
all = { level = "deny", priority = -1 } all = { level = "deny", priority = -1 }
# nursery = { level = "deny", priority = -1 } nursery = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 } pedantic = { level = "deny", priority = -1 }
cargo = { level = "deny", priority = -1 } cargo = { level = "deny", priority = -1 }
@ -25,6 +25,7 @@ empty_enum_variants_with_brackets = "deny"
empty_structs_with_brackets = "deny" empty_structs_with_brackets = "deny"
separated_literal_suffix = "deny" separated_literal_suffix = "deny"
semicolon_outside_block = "deny" semicolon_outside_block = "deny"
redundant_test_prefix = "deny"
non_zero_suggestions = "deny" non_zero_suggestions = "deny"
string_lit_chars_any = "deny" string_lit_chars_any = "deny"
use_self = "deny" use_self = "deny"
@ -46,7 +47,15 @@ cast_precision_loss = "allow"
multiple_crate_versions = "allow" multiple_crate_versions = "allow"
single_call_fn = "allow" single_call_fn = "allow"
unreadable_literal = "allow" unreadable_literal = "allow"
many_single_char_names = "allow"
suboptimal_flops = "allow"
cast_lossless = "allow" cast_lossless = "allow"
while_float = "allow"
or_fun_call = "allow"
significant_drop_tightening = "allow"
suspicious_operation_groupings = "allow"
literal_string_with_formatting_args = "allow"
future_not_send = "allow"
cast_sign_loss = "allow" cast_sign_loss = "allow"
float_cmp = "allow" float_cmp = "allow"
cast_possible_truncation = "allow" cast_possible_truncation = "allow"
@ -106,14 +115,14 @@ console-subscriber = { version = "0.5.0", default-features = false }
crc-fast = "1.10.0" crc-fast = "1.10.0"
criterion = { version = "0.8", default-features = false } criterion = { version = "0.8", default-features = false }
crossbeam-utils = "0.8.21" crossbeam-utils = "0.8.21"
crossfire = "2.1.10" crossfire = { version= "3.0.2", features = ["compat"]}
dashmap = "6.1" dashmap = "6.1"
ecdsa = "0.16.9" ecdsa = "0.16.9"
enum_dispatch = "0.3.13" enum_dispatch = "0.3.13"
env_logger = "0.11.8" env_logger = "0.11.8"
flate2 = "1.1.8" flate2 = "1.1.8"
heck = "0.5" heck = "0.5"
hmac = "=0.13.0-rc.3" hmac = "=0.13.0-rc.4"
indexmap = "2.13" indexmap = "2.13"
itertools = "0.14.0" itertools = "0.14.0"
libloading = "0.9" libloading = "0.9"
@ -126,7 +135,7 @@ num-traits = "0.2"
num_cpus = "1.17.0" num_cpus = "1.17.0"
p384 = "0.13.1" p384 = "0.13.1"
phf = "0.13.1" phf = "0.13.1"
pkcs8 = "=0.11.0-rc.9" pkcs8 = "=0.11.0-rc.10"
proc-macro2 = "1.0" proc-macro2 = "1.0"
pumpkin-config = { path = "pumpkin-config" } pumpkin-config = { path = "pumpkin-config" }
pumpkin-data = { path = "pumpkin-data" } pumpkin-data = { path = "pumpkin-data" }
@ -138,7 +147,7 @@ pumpkin-util = { path = "pumpkin-util" }
pumpkin-world = { path = "pumpkin-world" } pumpkin-world = { path = "pumpkin-world" }
quote = "1.0" quote = "1.0"
rand = { git = "https://github.com/rust-random/rand"} rand = { git = "https://github.com/rust-random/rand"}
rsa = "=0.10.0-rc.13" rsa = "=0.10.0-rc.14"
rustc-hash = "2.1.1" rustc-hash = "2.1.1"
rustyline = "17.0.2" rustyline = "17.0.2"
ruzstd = "0.8.2" ruzstd = "0.8.2"

View File

@ -1,7 +1,7 @@
use pumpkin_util::ProfileAction; use pumpkin_util::ProfileAction;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize, Clone)]
#[serde(default)] #[serde(default)]
pub struct AuthenticationConfig { pub struct AuthenticationConfig {
/// Whether to use Mojang authentication. /// Whether to use Mojang authentication.
@ -35,7 +35,7 @@ impl Default for AuthenticationConfig {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize, Clone)]
#[serde(default)] #[serde(default)]
pub struct PlayerProfileConfig { pub struct PlayerProfileConfig {
/// Allow players flagged by Mojang (e.g. banned, forced name change). /// Allow players flagged by Mojang (e.g. banned, forced name change).
@ -56,7 +56,7 @@ impl Default for PlayerProfileConfig {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize, Clone)]
#[serde(default)] #[serde(default)]
pub struct TextureConfig { pub struct TextureConfig {
/// Whether to use player textures. /// Whether to use player textures.
@ -80,7 +80,7 @@ impl Default for TextureConfig {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize, Clone)]
#[serde(default)] #[serde(default)]
pub struct TextureTypes { pub struct TextureTypes {
/// Use player skins. /// Use player skins.

View File

@ -12,7 +12,7 @@ pub struct Op {
impl Op { impl Op {
#[must_use] #[must_use]
pub fn new( pub const fn new(
uuid: Uuid, uuid: Uuid,
name: String, name: String,
level: PermissionLvl, level: PermissionLvl,

View File

@ -9,7 +9,7 @@ pub struct WhitelistEntry {
impl WhitelistEntry { impl WhitelistEntry {
#[must_use] #[must_use]
pub fn new(uuid: Uuid, name: String) -> Self { pub const fn new(uuid: Uuid, name: String) -> Self {
Self { uuid, name } Self { uuid, name }
} }
} }

View File

@ -228,7 +228,7 @@ fn get_i32_hash(val: i32) -> u32 {
} }
#[test] #[test]
fn test_hash() { fn hash() {
assert_eq!(get_str_hash("minecraft:sharpness"), 2734053906u32); assert_eq!(get_str_hash("minecraft:sharpness"), 2734053906u32);
assert_eq!(get_i32_hash(3), 3795317917u32); assert_eq!(get_i32_hash(3), 3795317917u32);
assert_eq!( assert_eq!(

View File

@ -145,7 +145,7 @@ pub enum DropType {
} }
impl DropType { impl DropType {
fn from_i8(value: i8) -> Result<Self, InventoryError> { const fn from_i8(value: i8) -> Result<Self, InventoryError> {
Ok(match value { Ok(match value {
0 => Self::SingleItem, 0 => Self::SingleItem,
1 => Self::FullStack, 1 => Self::FullStack,
@ -154,13 +154,13 @@ impl DropType {
} }
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq)]
pub enum MouseDragType { pub enum MouseDragType {
Left, Left,
Right, Right,
Middle, Middle,
} }
#[derive(PartialEq, Debug)] #[derive(PartialEq, Eq, Debug)]
pub enum MouseDragState { pub enum MouseDragState {
Start(MouseDragType), Start(MouseDragType),
AddSlot(usize), AddSlot(usize),

View File

@ -73,7 +73,7 @@ impl PlayerInventory {
} }
#[must_use] #[must_use]
pub fn is_valid_hotbar_index(slot: usize) -> bool { pub const fn is_valid_hotbar_index(slot: usize) -> bool {
slot < Self::HOTBAR_SIZE slot < Self::HOTBAR_SIZE
} }

View File

@ -210,7 +210,7 @@ pub trait Slot: Send + Sync {
self.on_take_item(player, stack).await; self.on_take_item(player, stack).await;
} }
stack.unwrap_or(ItemStack::EMPTY.clone()) stack.unwrap_or_else(|| ItemStack::EMPTY.clone())
}) })
} }

View File

@ -8,7 +8,7 @@ pub struct WindowProperty<T: WindowPropertyTrait> {
} }
impl<T: WindowPropertyTrait> WindowProperty<T> { impl<T: WindowPropertyTrait> WindowProperty<T> {
pub fn new(window_property: T, value: i16) -> Self { pub const fn new(window_property: T, value: i16) -> Self {
Self { Self {
window_property, window_property,
value, value,

View File

@ -21,7 +21,7 @@ pub struct NbtCompound {
impl NbtCompound { impl NbtCompound {
#[must_use] #[must_use]
pub fn new() -> Self { pub const fn new() -> Self {
Self { Self {
child_tags: Vec::new(), child_tags: Vec::new(),
} }
@ -85,7 +85,7 @@ impl NbtCompound {
} }
#[must_use] #[must_use]
pub fn is_empty(&self) -> bool { pub const fn is_empty(&self) -> bool {
self.child_tags.is_empty() self.child_tags.is_empty()
} }

View File

@ -30,7 +30,7 @@ pub struct NbtReadHelper<R: Read + Seek> {
} }
impl<R: Read + Seek> NbtReadHelper<R> { impl<R: Read + Seek> NbtReadHelper<R> {
pub fn new(r: R) -> Self { pub const fn new(r: R) -> Self {
Self { reader: r } Self { reader: r }
} }
} }
@ -87,7 +87,7 @@ pub struct Deserializer<R: Read + Seek> {
} }
impl<R: Read + Seek> Deserializer<R> { impl<R: Read + Seek> Deserializer<R> {
pub fn new(input: R, is_named: bool) -> Self { pub const fn new(input: R, is_named: bool) -> Self {
Self { Self {
input: NbtReadHelper { reader: input }, input: NbtReadHelper { reader: input },
tag_to_deserialize_stack: None, tag_to_deserialize_stack: None,

View File

@ -77,7 +77,7 @@ pub struct Nbt {
impl Nbt { impl Nbt {
#[must_use] #[must_use]
pub fn new(name: String, tag: NbtCompound) -> Self { pub const fn new(name: String, tag: NbtCompound) -> Self {
Self { Self {
name, name,
root_tag: tag, root_tag: tag,
@ -231,7 +231,7 @@ mod test {
} }
#[test] #[test]
fn test_simple_ser_de_unnamed() { fn simple_ser_de_unnamed() {
let test = Test { let test = Test {
byte: 123, byte: 123,
short: 1342, short: 1342,
@ -260,7 +260,7 @@ mod test {
} }
#[test] #[test]
fn test_simple_ser_de_array() { fn simple_ser_de_array() {
let test = TestArray { let test = TestArray {
byte_array: vec![0, 3, 2], byte_array: vec![0, 3, 2],
int_array: vec![13, 1321, 2], int_array: vec![13, 1321, 2],
@ -275,7 +275,7 @@ mod test {
} }
#[test] #[test]
fn test_simple_ser_de_named() { fn simple_ser_de_named() {
let name = String::from("Test"); let name = String::from("Test");
let test = Test { let test = Test {
byte: 123, byte: 123,
@ -294,7 +294,7 @@ mod test {
} }
#[test] #[test]
fn test_simple_ser_de_array_named() { fn simple_ser_de_array_named() {
let name = String::from("Test"); let name = String::from("Test");
let test = TestArray { let test = TestArray {
byte_array: vec![0, 3, 2], byte_array: vec![0, 3, 2],
@ -329,7 +329,7 @@ mod test {
} }
#[test] #[test]
fn test_list() { fn list() {
let test1 = Test { let test1 = Test {
byte: 123, byte: 123,
short: 1342, short: 1342,
@ -369,7 +369,7 @@ mod test {
} }
#[test] #[test]
fn test_list_named() { fn list_named() {
let test1 = Test { let test1 = Test {
byte: 123, byte: 123,
short: 1342, short: 1342,
@ -407,7 +407,7 @@ mod test {
} }
#[test] #[test]
fn test_nbt_arrays() { fn nbt_arrays() {
#[derive(Serialize)] #[derive(Serialize)]
struct Tagged { struct Tagged {
#[serde(serialize_with = "nbt_long_array")] #[serde(serialize_with = "nbt_long_array")]
@ -489,7 +489,7 @@ mod test {
} }
#[test] #[test]
fn test_tuple_fail() { fn tuple_fail() {
#[derive(Serialize)] #[derive(Serialize)]
struct BadData { struct BadData {
x: (i32, i64), x: (i32, i64),
@ -506,7 +506,7 @@ mod test {
} }
#[test] #[test]
fn test_tuple_ok() { fn tuple_ok() {
#[derive(Serialize, Deserialize, PartialEq, Debug)] #[derive(Serialize, Deserialize, PartialEq, Debug)]
struct GoodData { struct GoodData {
x: (i32, i32), x: (i32, i32),

View File

@ -116,7 +116,7 @@ mod tests {
use std::io::Cursor; use std::io::Cursor;
#[test] #[test]
fn test_gzip_read_write_compound() { fn gzip_read_write_compound() {
// Create a test compound // Create a test compound
let mut compound = NbtCompound::new(); let mut compound = NbtCompound::new();
compound.put_byte("byte_value", 123); compound.put_byte("byte_value", 123);
@ -163,7 +163,7 @@ mod tests {
} }
#[test] #[test]
fn test_gzip_convenience_methods() { fn gzip_convenience_methods() {
// Create a test compound // Create a test compound
let mut compound = NbtCompound::new(); let mut compound = NbtCompound::new();
compound.put_int("test_value", 12345); compound.put_int("test_value", 12345);
@ -180,7 +180,7 @@ mod tests {
} }
#[test] #[test]
fn test_gzip_empty_compound() { fn gzip_empty_compound() {
let compound = NbtCompound::new(); let compound = NbtCompound::new();
let mut buffer = Vec::new(); let mut buffer = Vec::new();
write_gzip_compound_tag(compound, &mut buffer).expect("Failed to compress empty compound"); write_gzip_compound_tag(compound, &mut buffer).expect("Failed to compress empty compound");
@ -191,7 +191,7 @@ mod tests {
} }
#[test] #[test]
fn test_gzip_large_compound() { fn gzip_large_compound() {
let mut compound = NbtCompound::new(); let mut compound = NbtCompound::new();
// Add 1000 integer entries // Add 1000 integer entries
@ -229,7 +229,7 @@ mod tests {
} }
#[test] #[test]
fn test_gzip_serialize_deserialize() { fn gzip_serialize_deserialize() {
let test_struct = TestStruct { let test_struct = TestStruct {
string_field: "test string".to_string(), string_field: "test string".to_string(),
int_field: 12345, int_field: 12345,
@ -263,7 +263,7 @@ mod tests {
#[test] #[test]
#[expect(clippy::print_stdout)] #[expect(clippy::print_stdout)]
fn test_gzip_compression_ratio() { fn gzip_compression_ratio() {
let mut compound = NbtCompound::new(); let mut compound = NbtCompound::new();
// Create a compound with repetitive data (should compress well) // Create a compound with repetitive data (should compress well)
@ -287,7 +287,7 @@ mod tests {
} }
#[test] #[test]
fn test_gzip_invalid_data() { fn gzip_invalid_data() {
// Try to read from invalid data // Try to read from invalid data
let invalid_data = vec![1, 2, 3, 4, 5]; // Not valid GZip data let invalid_data = vec![1, 2, 3, 4, 5]; // Not valid GZip data
let result = read_gzip_compound_tag(Cursor::new(invalid_data)); let result = read_gzip_compound_tag(Cursor::new(invalid_data));
@ -296,7 +296,7 @@ mod tests {
#[test] #[test]
#[expect(clippy::struct_field_names)] #[expect(clippy::struct_field_names)]
fn test_roundtrip_with_arrays() { fn roundtrip_with_arrays() {
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq)]
struct ArrayTest { struct ArrayTest {
byte_array: Vec<u8>, byte_array: Vec<u8>,
@ -319,7 +319,7 @@ mod tests {
} }
#[test] #[test]
fn test_roundtrip_with_map() { fn roundtrip_with_map() {
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq)]
struct MapTest { struct MapTest {
string_map: HashMap<String, String>, string_map: HashMap<String, String>,
@ -348,7 +348,7 @@ mod tests {
} }
#[test] #[test]
fn test_direct_file_io() { fn direct_file_io() {
use tempfile::tempdir; use tempfile::tempdir;
let temp_dir = tempdir().expect("Failed to create temporary directory"); let temp_dir = tempdir().expect("Failed to create temporary directory");

View File

@ -16,7 +16,7 @@ pub struct WriteAdaptor<W: Write> {
} }
impl<W: Write> WriteAdaptor<W> { impl<W: Write> WriteAdaptor<W> {
pub fn new(w: W) -> Self { pub const fn new(w: W) -> Self {
Self { writer: w } Self { writer: w }
} }
} }
@ -57,7 +57,7 @@ pub struct Serializer<W: Write> {
} }
impl<W: Write> Serializer<W> { impl<W: Write> Serializer<W> {
pub fn new(output: W, name: Option<String>) -> Self { pub const fn new(output: W, name: Option<String>) -> Self {
Self { Self {
output: WriteAdaptor::new(output), output: WriteAdaptor::new(output),
state: State::Root(name), state: State::Root(name),

View File

@ -267,7 +267,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_byte(&self) -> Option<i8> { pub const fn extract_byte(&self) -> Option<i8> {
match self { match self {
Self::Byte(byte) => Some(*byte), Self::Byte(byte) => Some(*byte),
_ => None, _ => None,
@ -275,7 +275,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_short(&self) -> Option<i16> { pub const fn extract_short(&self) -> Option<i16> {
match self { match self {
Self::Short(short) => Some(*short), Self::Short(short) => Some(*short),
_ => None, _ => None,
@ -283,7 +283,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_int(&self) -> Option<i32> { pub const fn extract_int(&self) -> Option<i32> {
match self { match self {
Self::Int(int) => Some(*int), Self::Int(int) => Some(*int),
_ => None, _ => None,
@ -291,7 +291,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_long(&self) -> Option<i64> { pub const fn extract_long(&self) -> Option<i64> {
match self { match self {
Self::Long(long) => Some(*long), Self::Long(long) => Some(*long),
_ => None, _ => None,
@ -299,7 +299,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_float(&self) -> Option<f32> { pub const fn extract_float(&self) -> Option<f32> {
match self { match self {
Self::Float(float) => Some(*float), Self::Float(float) => Some(*float),
_ => None, _ => None,
@ -307,7 +307,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_double(&self) -> Option<f64> { pub const fn extract_double(&self) -> Option<f64> {
match self { match self {
Self::Double(double) => Some(*double), Self::Double(double) => Some(*double),
_ => None, _ => None,
@ -347,7 +347,7 @@ impl NbtTag {
} }
#[must_use] #[must_use]
pub fn extract_compound(&self) -> Option<&NbtCompound> { pub const fn extract_compound(&self) -> Option<&NbtCompound> {
match self { match self {
Self::Compound(compound) => Some(compound), Self::Compound(compound) => Some(compound),
_ => None, _ => None,

View File

@ -16,7 +16,7 @@ pub struct Ack {
impl Ack { impl Ack {
#[must_use] #[must_use]
pub fn new(sequences: Vec<u32>) -> Self { pub const fn new(sequences: Vec<u32>) -> Self {
Self { sequences } Self { sequences }
} }

View File

@ -14,7 +14,7 @@ pub struct CDisconnectPlayer {
impl CDisconnectPlayer { impl CDisconnectPlayer {
#[must_use] #[must_use]
pub fn new(reason: i32, message: String) -> Self { pub const fn new(reason: i32, message: String) -> Self {
Self { Self {
reason: VarInt(reason), reason: VarInt(reason),
skip_message: message.is_empty(), skip_message: message.is_empty(),

View File

@ -9,7 +9,7 @@ pub struct CHandshake {
impl CHandshake { impl CHandshake {
#[must_use] #[must_use]
pub fn new(jwt_data: String) -> Self { pub const fn new(jwt_data: String) -> Self {
Self { jwt_data } Self { jwt_data }
} }
} }

View File

@ -20,7 +20,7 @@ pub struct CNetworkChunkPublisherUpdate {
impl CNetworkChunkPublisherUpdate { impl CNetworkChunkPublisherUpdate {
#[must_use] #[must_use]
pub fn new(pos_for_view: BlockPos, new_radius: u32) -> Self { pub const fn new(pos_for_view: BlockPos, new_radius: u32) -> Self {
Self { Self {
pos_for_view: NetworkPos(pos_for_view), pos_for_view: NetworkPos(pos_for_view),
new_radius: VarUInt(new_radius), new_radius: VarUInt(new_radius),

View File

@ -14,7 +14,7 @@ pub struct CNetworkSettings {
impl CNetworkSettings { impl CNetworkSettings {
#[must_use] #[must_use]
pub fn new( pub const fn new(
compression_threshold: u16, compression_threshold: u16,
compression_method: u16, compression_method: u16,
client_throttle_enabled: bool, client_throttle_enabled: bool,

View File

@ -13,7 +13,7 @@ pub struct CConnectedPong {
impl CConnectedPong { impl CConnectedPong {
#[must_use] #[must_use]
#[expect(clippy::similar_names)] #[expect(clippy::similar_names)]
pub fn new(ping: u64, pong: u64) -> Self { pub const fn new(ping: u64, pong: u64) -> Self {
Self { ping, pong } Self { ping, pong }
} }
} }
@ -30,7 +30,7 @@ pub struct CConnectionRequestAccepted {
impl CConnectionRequestAccepted { impl CConnectionRequestAccepted {
#[must_use] #[must_use]
pub fn new( pub const fn new(
client_address: SocketAddr, client_address: SocketAddr,
system_index: u16, system_index: u16,
system_addresses: [SocketAddr; 10], system_addresses: [SocketAddr; 10],

View File

@ -17,7 +17,7 @@ pub struct COpenConnectionReply1 {
impl COpenConnectionReply1 { impl COpenConnectionReply1 {
#[must_use] #[must_use]
pub fn new(server_guid: u64, has_server_security: bool, mtu: u16) -> Self { pub const fn new(server_guid: u64, has_server_security: bool, mtu: u16) -> Self {
Self { Self {
magic: RAKNET_MAGIC, magic: RAKNET_MAGIC,
server_guid, server_guid,
@ -40,7 +40,12 @@ pub struct COpenConnectionReply2 {
impl COpenConnectionReply2 { impl COpenConnectionReply2 {
#[must_use] #[must_use]
pub fn new(server_guid: u64, client_address: SocketAddr, mtu: u16, security: bool) -> Self { pub const fn new(
server_guid: u64,
client_address: SocketAddr,
mtu: u16,
security: bool,
) -> Self {
Self { Self {
magic: RAKNET_MAGIC, magic: RAKNET_MAGIC,
server_guid, server_guid,

View File

@ -62,7 +62,7 @@ impl fmt::Display for ServerInfo {
impl CUnconnectedPong { impl CUnconnectedPong {
#[must_use] #[must_use]
pub fn new(time: u64, server_guid: u64, magic: [u8; 16], server_id: String) -> Self { pub const fn new(time: u64, server_guid: u64, magic: [u8; 16], server_id: String) -> Self {
Self { Self {
time, time,
server_guid, server_guid,

View File

@ -18,7 +18,7 @@ pub struct CResourcePackStackPacket {
impl CResourcePackStackPacket { impl CResourcePackStackPacket {
#[must_use] #[must_use]
pub fn new( pub const fn new(
resource_pack_required: bool, resource_pack_required: bool,
texture_pack_list_size: VarUInt, texture_pack_list_size: VarUInt,
game_version: String, game_version: String,

View File

@ -17,7 +17,7 @@ pub struct CResourcePacksInfo {
impl CResourcePacksInfo { impl CResourcePacksInfo {
#[must_use] #[must_use]
#[expect(clippy::fn_params_excessive_bools)] #[expect(clippy::fn_params_excessive_bools)]
pub fn new( pub const fn new(
resource_pack_required: bool, resource_pack_required: bool,
has_addon_packs: bool, has_addon_packs: bool,
has_scripts: bool, has_scripts: bool,

View File

@ -72,7 +72,7 @@ pub enum MetadataValue {
impl MetadataValue { impl MetadataValue {
#[must_use] #[must_use]
pub fn type_id(&self) -> u32 { pub const fn type_id(&self) -> u32 {
match self { match self {
Self::Byte(_) => 0, Self::Byte(_) => 0,
Self::Short(_) => 1, Self::Short(_) => 1,

View File

@ -52,7 +52,7 @@ pub struct Frame {
impl Frame { impl Frame {
#[must_use] #[must_use]
pub fn new_unreliable(payload: Vec<u8>) -> Self { pub const fn new_unreliable(payload: Vec<u8>) -> Self {
Self { Self {
reliability: RakReliability::Unreliable, reliability: RakReliability::Unreliable,
payload, payload,

View File

@ -36,7 +36,7 @@ pub enum RakReliability {
impl RakReliability { impl RakReliability {
#[must_use] #[must_use]
pub fn is_reliable(&self) -> bool { pub const fn is_reliable(&self) -> bool {
matches!( matches!(
self, self,
Self::Reliable Self::Reliable
@ -48,12 +48,12 @@ impl RakReliability {
} }
#[must_use] #[must_use]
pub fn is_sequenced(&self) -> bool { pub const fn is_sequenced(&self) -> bool {
matches!(self, Self::ReliableSequenced | Self::UnreliableSequenced) matches!(self, Self::ReliableSequenced | Self::UnreliableSequenced)
} }
#[must_use] #[must_use]
pub fn is_ordered(&self) -> bool { pub const fn is_ordered(&self) -> bool {
matches!( matches!(
self, self,
Self::UnreliableSequenced Self::UnreliableSequenced
@ -64,7 +64,7 @@ impl RakReliability {
} }
#[must_use] #[must_use]
pub fn is_order_exclusive(&self) -> bool { pub const fn is_order_exclusive(&self) -> bool {
matches!( matches!(
self, self,
Self::ReliableOrdered | Self::ReliableOrderedWithAckReceipt Self::ReliableOrdered | Self::ReliableOrderedWithAckReceipt
@ -72,7 +72,7 @@ impl RakReliability {
} }
#[must_use] #[must_use]
pub fn from_id(id: u8) -> Option<Self> { pub const fn from_id(id: u8) -> Option<Self> {
match id { match id {
0 => Some(Self::Unreliable), 0 => Some(Self::Unreliable),
1 => Some(Self::UnreliableSequenced), 1 => Some(Self::UnreliableSequenced),
@ -87,7 +87,7 @@ impl RakReliability {
} }
#[must_use] #[must_use]
pub fn to_id(&self) -> u8 { pub const fn to_id(&self) -> u8 {
match self { match self {
Self::Unreliable => 0, Self::Unreliable => 0,
Self::UnreliableSequenced => 1, Self::UnreliableSequenced => 1,

View File

@ -90,16 +90,16 @@ impl Default for UDPNetworkDecoder {
impl UDPNetworkDecoder { impl UDPNetworkDecoder {
#[must_use] #[must_use]
pub fn new() -> Self { pub const fn new() -> Self {
Self { compression: None } Self { compression: None }
} }
pub fn set_compression(&mut self, threshold: CompressionThreshold) { pub const fn set_compression(&mut self, threshold: CompressionThreshold) {
self.compression = Some(threshold); self.compression = Some(threshold);
} }
/// NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted /// NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted
pub fn set_encryption(&mut self, _key: &[u8; 16]) { pub const fn set_encryption(&mut self, _key: &[u8; 16]) {
// if matches!(self.reader, DecryptionReader::Decrypt(_)) { // if matches!(self.reader, DecryptionReader::Decrypt(_)) {
// panic!("Cannot upgrade a stream that already has a cipher!"); // panic!("Cannot upgrade a stream that already has a cipher!");
// } // }

View File

@ -91,16 +91,19 @@ impl Default for UDPNetworkEncoder {
impl UDPNetworkEncoder { impl UDPNetworkEncoder {
#[must_use] #[must_use]
pub fn new() -> Self { pub const fn new() -> Self {
Self { compression: None } Self { compression: None }
} }
pub fn set_compression(&mut self, compression_info: (CompressionThreshold, CompressionLevel)) { pub const fn set_compression(
&mut self,
compression_info: (CompressionThreshold, CompressionLevel),
) {
self.compression = Some(compression_info); self.compression = Some(compression_info);
} }
/// NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted /// NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted
pub fn set_encryption(&mut self, _key: &[u8; 16]) { pub const fn set_encryption(&mut self, _key: &[u8; 16]) {
// if matches!(self.writer, EncryptionWriter::Encrypt(_)) { // if matches!(self.writer, EncryptionWriter::Encrypt(_)) {
// panic!("Cannot upgrade a stream that already has a cipher!"); // panic!("Cannot upgrade a stream that already has a cipher!");
// } // }

View File

@ -14,7 +14,7 @@ pub struct SLoadingScreen {
impl SLoadingScreen { impl SLoadingScreen {
#[must_use] #[must_use]
pub fn is_loading_done(&self) -> bool { pub const fn is_loading_done(&self) -> bool {
self.status.0 == 2 self.status.0 == 2
} }
} }

View File

@ -55,7 +55,7 @@ impl SText {
} }
} }
fn get_dummy_strings(category: u8) -> &'static [&'static str] { const fn get_dummy_strings(category: u8) -> &'static [&'static str] {
match category { match category {
0 => &[ 0 => &[
"raw", "raw",
@ -71,7 +71,7 @@ impl SText {
} }
} }
fn get_category(&self) -> u8 { const fn get_category(&self) -> u8 {
match self.r#type { match self.r#type {
TextPacketType::Raw TextPacketType::Raw
| TextPacketType::Tip | TextPacketType::Tip
@ -205,7 +205,7 @@ impl PacketWrite for SText {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u8)] #[repr(u8)]
pub enum TextPacketType { pub enum TextPacketType {
Raw = 0, Raw = 0,

View File

@ -31,7 +31,7 @@ impl VarInt {
/// Returns the exact number of bytes this `VarInt` will write when /// Returns the exact number of bytes this `VarInt` will write when
/// [`Encode::encode`] is called, assuming no error occurs. /// [`Encode::encode`] is called, assuming no error occurs.
#[must_use] #[must_use]
pub fn written_size(&self) -> usize { pub const fn written_size(&self) -> usize {
match self.0 { match self.0 {
0 => 1, 0 => 1,
n => (31 - n.leading_zeros() as usize) / 7 + 1, n => (31 - n.leading_zeros() as usize) / 7 + 1,

View File

@ -30,7 +30,7 @@ impl VarULong {
/// Returns the exact number of bytes this `VarLong` will write when /// Returns the exact number of bytes this `VarLong` will write when
/// [`Encode::encode`] is called, assuming no error occurs. /// [`Encode::encode`] is called, assuming no error occurs.
#[must_use] #[must_use]
pub fn written_size(&self) -> usize { pub const fn written_size(&self) -> usize {
match self.0 { match self.0 {
0 => 1, 0 => 1,
n => (31 - n.leading_zeros() as usize) / 7 + 1, n => (31 - n.leading_zeros() as usize) / 7 + 1,

View File

@ -71,12 +71,12 @@ fn clamp_value(value: f64) -> f64 {
value.clamp(-MAX_VELOCITY_CLAMP, MAX_VELOCITY_CLAMP) value.clamp(-MAX_VELOCITY_CLAMP, MAX_VELOCITY_CLAMP)
} }
fn abs_max(a: f64, b: f64) -> f64 { const fn abs_max(a: f64, b: f64) -> f64 {
a.abs().max(b.abs()) a.abs().max(b.abs())
} }
fn to_long(value: f64) -> i64 { fn to_long(value: f64) -> i64 {
(((value * 0.5 + 0.5) * MAX_15_BIT_VALUE).round() as i64).clamp(0, 32766) ((value.mul_add(0.5, 0.5) * MAX_15_BIT_VALUE).round() as i64).clamp(0, 32766)
} }
impl Serialize for Velocity { impl Serialize for Velocity {

View File

@ -18,7 +18,7 @@ pub struct CConfigAddResourcePack<'a> {
impl<'a> CConfigAddResourcePack<'a> { impl<'a> CConfigAddResourcePack<'a> {
#[must_use] #[must_use]
pub fn new( pub const fn new(
uuid: &'a uuid::Uuid, uuid: &'a uuid::Uuid,
url: &'a str, url: &'a str,
hash: &'a str, hash: &'a str,

View File

@ -10,7 +10,7 @@ pub struct CConfigDisconnect<'a> {
impl<'a> CConfigDisconnect<'a> { impl<'a> CConfigDisconnect<'a> {
#[must_use] #[must_use]
pub fn new(reason: &'a str) -> Self { pub const fn new(reason: &'a str) -> Self {
Self { reason } Self { reason }
} }
} }

View File

@ -11,7 +11,7 @@ pub struct CCookieRequest<'a> {
impl<'a> CCookieRequest<'a> { impl<'a> CCookieRequest<'a> {
#[must_use] #[must_use]
pub fn new(key: &'a ResourceLocation) -> Self { pub const fn new(key: &'a ResourceLocation) -> Self {
Self { key } Self { key }
} }
} }

View File

@ -12,7 +12,7 @@ pub struct CKnownPacks<'a> {
impl<'a> CKnownPacks<'a> { impl<'a> CKnownPacks<'a> {
#[must_use] #[must_use]
pub fn new(known_packs: &'a [KnownPack]) -> Self { pub const fn new(known_packs: &'a [KnownPack]) -> Self {
Self { known_packs } Self { known_packs }
} }
} }

View File

@ -14,7 +14,7 @@ pub struct CPluginMessage<'a> {
impl<'a> CPluginMessage<'a> { impl<'a> CPluginMessage<'a> {
#[must_use] #[must_use]
pub fn new(channel: &'a str, data: &'a [u8]) -> Self { pub const fn new(channel: &'a str, data: &'a [u8]) -> Self {
Self { channel, data } Self { channel, data }
} }
} }

View File

@ -13,7 +13,7 @@ pub struct CRegistryData<'a> {
impl<'a> CRegistryData<'a> { impl<'a> CRegistryData<'a> {
#[must_use] #[must_use]
pub fn new(registry_id: &'a ResourceLocation, entries: &'a [RegistryEntry]) -> Self { pub const fn new(registry_id: &'a ResourceLocation, entries: &'a [RegistryEntry]) -> Self {
Self { Self {
registry_id, registry_id,
entries, entries,
@ -31,7 +31,7 @@ pub struct RegistryEntry {
// TODO: No unwraps // TODO: No unwraps
impl RegistryEntry { impl RegistryEntry {
#[must_use] #[must_use]
pub fn new(entry_id: ResourceLocation, data: Option<Box<[u8]>>) -> Self { pub const fn new(entry_id: ResourceLocation, data: Option<Box<[u8]>>) -> Self {
Self { entry_id, data } Self { entry_id, data }
} }

View File

@ -11,7 +11,7 @@ pub struct CConfigServerLinks<'a> {
impl<'a> CConfigServerLinks<'a> { impl<'a> CConfigServerLinks<'a> {
#[must_use] #[must_use]
pub fn new(links: &'a [Link<'a>]) -> Self { pub const fn new(links: &'a [Link<'a>]) -> Self {
Self { links } Self { links }
} }
} }

View File

@ -13,7 +13,7 @@ pub struct CStoreCookie<'a> {
impl<'a> CStoreCookie<'a> { impl<'a> CStoreCookie<'a> {
#[must_use] #[must_use]
pub fn new(key: &'a ResourceLocation, payload: &'a [u8]) -> Self { pub const fn new(key: &'a ResourceLocation, payload: &'a [u8]) -> Self {
Self { key, payload } Self { key, payload }
} }
} }

View File

@ -12,7 +12,7 @@ pub struct CTransfer<'a> {
impl<'a> CTransfer<'a> { impl<'a> CTransfer<'a> {
#[must_use] #[must_use]
pub fn new(host: &'a str, port: &'a VarInt) -> Self { pub const fn new(host: &'a str, port: &'a VarInt) -> Self {
Self { host, port } Self { host, port }
} }
} }

View File

@ -18,7 +18,7 @@ pub struct CUpdateTags<'a> {
impl<'a> CUpdateTags<'a> { impl<'a> CUpdateTags<'a> {
#[must_use] #[must_use]
pub fn new(tags: &'a [RegistryKey]) -> Self { pub const fn new(tags: &'a [RegistryKey]) -> Self {
Self { tags } Self { tags }
} }
} }

View File

@ -16,7 +16,7 @@ pub struct CLoginCookieRequest<'a> {
impl<'a> CLoginCookieRequest<'a> { impl<'a> CLoginCookieRequest<'a> {
#[must_use] #[must_use]
pub fn new(key: &'a ResourceLocation) -> Self { pub const fn new(key: &'a ResourceLocation) -> Self {
Self { key } Self { key }
} }
} }

View File

@ -25,7 +25,7 @@ pub struct CEncryptionRequest<'a> {
impl<'a> CEncryptionRequest<'a> { impl<'a> CEncryptionRequest<'a> {
#[must_use] #[must_use]
pub fn new( pub const fn new(
server_id: &'a str, server_id: &'a str,
public_key: &'a [u8], public_key: &'a [u8],
verify_token: &'a [u8], verify_token: &'a [u8],

View File

@ -15,7 +15,7 @@ pub struct CLoginDisconnect {
impl CLoginDisconnect { impl CLoginDisconnect {
#[must_use] #[must_use]
pub fn new(json_reason: String) -> Self { pub const fn new(json_reason: String) -> Self {
Self { json_reason } Self { json_reason }
} }
} }

View File

@ -22,7 +22,7 @@ pub struct CLoginSuccess<'a> {
impl<'a> CLoginSuccess<'a> { impl<'a> CLoginSuccess<'a> {
#[must_use] #[must_use]
pub fn new(uuid: &'a uuid::Uuid, username: &'a str, properties: &'a [Property]) -> Self { pub const fn new(uuid: &'a uuid::Uuid, username: &'a str, properties: &'a [Property]) -> Self {
Self { Self {
uuid, uuid,
username, username,

View File

@ -24,7 +24,7 @@ pub struct CLoginPluginRequest<'a> {
impl<'a> CLoginPluginRequest<'a> { impl<'a> CLoginPluginRequest<'a> {
#[must_use] #[must_use]
pub fn new(message_id: VarInt, channel: &'a str, data: &'a [u8]) -> Self { pub const fn new(message_id: VarInt, channel: &'a str, data: &'a [u8]) -> Self {
Self { Self {
message_id, message_id,
channel, channel,

View File

@ -20,7 +20,7 @@ pub struct CSetCompression {
impl CSetCompression { impl CSetCompression {
#[must_use] #[must_use]
pub fn new(threshold: VarInt) -> Self { pub const fn new(threshold: VarInt) -> Self {
Self { threshold } Self { threshold }
} }
} }

View File

@ -21,7 +21,7 @@ pub struct CAcknowledgeBlockChange {
impl CAcknowledgeBlockChange { impl CAcknowledgeBlockChange {
#[must_use] #[must_use]
pub fn new(sequence_id: VarInt) -> Self { pub const fn new(sequence_id: VarInt) -> Self {
Self { sequence_id } Self { sequence_id }
} }
} }

View File

@ -18,7 +18,7 @@ pub struct CActionBar<'a> {
impl<'a> CActionBar<'a> { impl<'a> CActionBar<'a> {
#[must_use] #[must_use]
pub fn new(action_bar: &'a TextComponent) -> Self { pub const fn new(action_bar: &'a TextComponent) -> Self {
Self { action_bar } Self { action_bar }
} }
} }

View File

@ -25,7 +25,7 @@ pub struct CSetBlockDestroyStage {
impl CSetBlockDestroyStage { impl CSetBlockDestroyStage {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, location: BlockPos, destroy_stage: i8) -> Self { pub const fn new(entity_id: VarInt, location: BlockPos, destroy_stage: i8) -> Self {
Self { Self {
entity_id, entity_id,
location, location,

View File

@ -23,7 +23,7 @@ pub struct CBlockEntityData {
impl CBlockEntityData { impl CBlockEntityData {
#[must_use] #[must_use]
pub fn new(location: BlockPos, r#type: VarInt, nbt_data: Box<[u8]>) -> Self { pub const fn new(location: BlockPos, r#type: VarInt, nbt_data: Box<[u8]>) -> Self {
Self { Self {
location, location,
r#type, r#type,

View File

@ -26,7 +26,7 @@ pub struct CBlockEvent {
impl CBlockEvent { impl CBlockEvent {
#[must_use] #[must_use]
pub fn new( pub const fn new(
location: BlockPos, location: BlockPos,
action_id: u8, action_id: u8,
action_parameter: u8, action_parameter: u8,

View File

@ -21,7 +21,7 @@ pub struct CBlockUpdate {
impl CBlockUpdate { impl CBlockUpdate {
#[must_use] #[must_use]
pub fn new(location: BlockPos, state_id: VarInt) -> Self { pub const fn new(location: BlockPos, state_id: VarInt) -> Self {
Self { location, state_id } Self { location, state_id }
} }
} }

View File

@ -21,7 +21,7 @@ pub struct CBossEvent<'a> {
impl<'a> CBossEvent<'a> { impl<'a> CBossEvent<'a> {
#[must_use] #[must_use]
pub fn new(uuid: &'a uuid::Uuid, action: BosseventAction) -> Self { pub const fn new(uuid: &'a uuid::Uuid, action: BosseventAction) -> Self {
Self { uuid, action } Self { uuid, action }
} }
} }

View File

@ -24,7 +24,7 @@ pub struct CChangeDifficulty {
impl CChangeDifficulty { impl CChangeDifficulty {
#[must_use] #[must_use]
pub fn new(difficulty: u8, locked: bool) -> Self { pub const fn new(difficulty: u8, locked: bool) -> Self {
Self { difficulty, locked } Self { difficulty, locked }
} }
} }

View File

@ -20,7 +20,7 @@ pub struct CCombatDeath<'a> {
impl<'a> CCombatDeath<'a> { impl<'a> CCombatDeath<'a> {
#[must_use] #[must_use]
pub fn new(player_id: VarInt, message: &'a TextComponent) -> Self { pub const fn new(player_id: VarInt, message: &'a TextComponent) -> Self {
Self { player_id, message } Self { player_id, message }
} }
} }

View File

@ -29,7 +29,7 @@ pub struct CCommandSuggestions {
impl CCommandSuggestions { impl CCommandSuggestions {
#[must_use] #[must_use]
pub fn new( pub const fn new(
id: VarInt, id: VarInt,
start: VarInt, start: VarInt,
length: VarInt, length: VarInt,
@ -52,7 +52,7 @@ pub struct CommandSuggestion {
impl CommandSuggestion { impl CommandSuggestion {
#[must_use] #[must_use]
pub fn new(suggestion: String, tooltip: Option<TextComponent>) -> Self { pub const fn new(suggestion: String, tooltip: Option<TextComponent>) -> Self {
Self { Self {
suggestion, suggestion,
tooltip, tooltip,

View File

@ -23,7 +23,7 @@ pub struct CCommands<'a> {
impl<'a> CCommands<'a> { impl<'a> CCommands<'a> {
#[must_use] #[must_use]
pub fn new(nodes: Box<[ProtoNode<'a>]>, root_node_index: VarInt) -> Self { pub const fn new(nodes: Box<[ProtoNode<'a>]>, root_node_index: VarInt) -> Self {
Self { Self {
nodes, nodes,
root_node_index, root_node_index,
@ -331,7 +331,7 @@ pub enum SuggestionProviders {
} }
impl SuggestionProviders { impl SuggestionProviders {
fn resource_location(self) -> &'static str { const fn resource_location(self) -> &'static str {
match self { match self {
Self::AskServer => "minecraft:ask_server", Self::AskServer => "minecraft:ask_server",
Self::AllRecipes => "minecraft:all_recipes", Self::AllRecipes => "minecraft:all_recipes",

View File

@ -17,7 +17,7 @@ pub struct CPlayCookieRequest<'a> {
impl<'a> CPlayCookieRequest<'a> { impl<'a> CPlayCookieRequest<'a> {
#[must_use] #[must_use]
pub fn new(key: &'a ResourceLocation) -> Self { pub const fn new(key: &'a ResourceLocation) -> Self {
Self { key } Self { key }
} }
} }

View File

@ -19,7 +19,7 @@ pub struct CPlayDisconnect<'a> {
impl<'a> CPlayDisconnect<'a> { impl<'a> CPlayDisconnect<'a> {
#[must_use] #[must_use]
pub fn new(reason: &'a TextComponent) -> Self { pub const fn new(reason: &'a TextComponent) -> Self {
Self { reason } Self { reason }
} }
} }

View File

@ -27,7 +27,7 @@ pub struct CDisguisedChatMessage<'a> {
impl<'a> CDisguisedChatMessage<'a> { impl<'a> CDisguisedChatMessage<'a> {
#[must_use] #[must_use]
pub fn new( pub const fn new(
message: &'a TextComponent, message: &'a TextComponent,
chat_type: VarInt, chat_type: VarInt,
sender_name: &'a TextComponent, sender_name: &'a TextComponent,

View File

@ -23,7 +23,7 @@ pub struct CDisplayObjective {
impl CDisplayObjective { impl CDisplayObjective {
#[must_use] #[must_use]
pub fn new(position: ScoreboardDisplaySlot, score_name: String) -> Self { pub const fn new(position: ScoreboardDisplaySlot, score_name: String) -> Self {
Self { Self {
position: VarInt(position as i32), position: VarInt(position as i32),
score_name, score_name,

View File

@ -20,7 +20,7 @@ pub struct CEntityAnimation {
impl CEntityAnimation { impl CEntityAnimation {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, animation: Animation) -> Self { pub const fn new(entity_id: VarInt, animation: Animation) -> Self {
Self { Self {
entity_id, entity_id,
animation: animation as u8, animation: animation as u8,

View File

@ -28,7 +28,7 @@ pub struct CSetEntityMetadata {
impl CSetEntityMetadata { impl CSetEntityMetadata {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, metadata: Box<[u8]>) -> Self { pub const fn new(entity_id: VarInt, metadata: Box<[u8]>) -> Self {
Self { Self {
entity_id, entity_id,
metadata, metadata,
@ -43,7 +43,7 @@ pub struct Metadata<T> {
} }
impl<T> Metadata<T> { impl<T> Metadata<T> {
pub fn new(index: TrackedId, r#type: MetaDataType, value: T) -> Self { pub const fn new(index: TrackedId, r#type: MetaDataType, value: T) -> Self {
Self { Self {
index, index,
r#type: VarInt(r#type as i32), r#type: VarInt(r#type as i32),

View File

@ -33,7 +33,7 @@ pub struct CEntityPositionSync {
impl CEntityPositionSync { impl CEntityPositionSync {
#[must_use] #[must_use]
pub fn new( pub const fn new(
entity_id: VarInt, entity_id: VarInt,
position: Vector3<f64>, position: Vector3<f64>,
delta: Vector3<f64>, delta: Vector3<f64>,

View File

@ -31,7 +31,7 @@ pub struct CEntitySoundEffect {
impl CEntitySoundEffect { impl CEntitySoundEffect {
#[must_use] #[must_use]
pub fn new( pub const fn new(
sound_event: IdOr<SoundEvent>, sound_event: IdOr<SoundEvent>,
sound_category: SoundCategory, sound_category: SoundCategory,
entity_id: VarInt, entity_id: VarInt,

View File

@ -20,7 +20,7 @@ pub struct CEntityStatus {
impl CEntityStatus { impl CEntityStatus {
#[must_use] #[must_use]
pub fn new(entity_id: i32, entity_status: i8) -> Self { pub const fn new(entity_id: i32, entity_status: i8) -> Self {
Self { Self {
entity_id, entity_id,
entity_status, entity_status,

View File

@ -20,7 +20,7 @@ pub struct CEntityVelocity {
impl CEntityVelocity { impl CEntityVelocity {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, velocity: Vector3<f64>) -> Self { pub const fn new(entity_id: VarInt, velocity: Vector3<f64>) -> Self {
Self { Self {
entity_id, entity_id,
velocity: Velocity(velocity), velocity: Velocity(velocity),

View File

@ -35,7 +35,7 @@ pub struct CExplosion {
impl CExplosion { impl CExplosion {
#[must_use] #[must_use]
pub fn new( pub const fn new(
center: Vector3<f64>, center: Vector3<f64>,
radius: f32, radius: f32,
block_count: i32, block_count: i32,

View File

@ -19,7 +19,7 @@ pub struct CGameEvent {
/// You need to implement all the random stuff somewhere, right? /// You need to implement all the random stuff somewhere, right?
impl CGameEvent { impl CGameEvent {
#[must_use] #[must_use]
pub fn new(event: GameEvent, value: f32) -> Self { pub const fn new(event: GameEvent, value: f32) -> Self {
Self { Self {
event: event as u8, event: event as u8,
value, value,

View File

@ -21,7 +21,7 @@ pub struct CHeadRot {
impl CHeadRot { impl CHeadRot {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, head_yaw: u8) -> Self { pub const fn new(entity_id: VarInt, head_yaw: u8) -> Self {
Self { Self {
entity_id, entity_id,
head_yaw, head_yaw,

View File

@ -21,7 +21,7 @@ pub struct CHurtAnimation {
impl CHurtAnimation { impl CHurtAnimation {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, yaw: f32) -> Self { pub const fn new(entity_id: VarInt, yaw: f32) -> Self {
Self { entity_id, yaw } Self { entity_id, yaw }
} }
} }

View File

@ -35,7 +35,7 @@ pub struct CInitializeWorldBorder {
impl CInitializeWorldBorder { impl CInitializeWorldBorder {
#[expect(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
#[must_use] #[must_use]
pub fn new( pub const fn new(
x: f64, x: f64,
z: f64, z: f64,
old_diameter: f64, old_diameter: f64,

View File

@ -18,7 +18,7 @@ pub struct CKeepAlive {
impl CKeepAlive { impl CKeepAlive {
#[must_use] #[must_use]
pub fn new(keep_alive_id: i64) -> Self { pub const fn new(keep_alive_id: i64) -> Self {
Self { keep_alive_id } Self { keep_alive_id }
} }
} }

View File

@ -27,7 +27,12 @@ pub struct CLevelEvent {
impl CLevelEvent { impl CLevelEvent {
#[must_use] #[must_use]
pub fn new(event: i32, location: BlockPos, data: i32, disable_relative_volume: bool) -> Self { pub const fn new(
event: i32,
location: BlockPos,
data: i32,
disable_relative_volume: bool,
) -> Self {
Self { Self {
event, event,
location, location,

View File

@ -56,7 +56,7 @@ impl<'a> CLogin<'a> {
#[expect(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
#[expect(clippy::fn_params_excessive_bools)] #[expect(clippy::fn_params_excessive_bools)]
#[must_use] #[must_use]
pub fn new( pub const fn new(
entity_id: i32, entity_id: i32,
is_hardcore: bool, is_hardcore: bool,
dimension_names: &'a [ResourceLocation], dimension_names: &'a [ResourceLocation],

View File

@ -28,7 +28,11 @@ pub struct COpenScreen<'a> {
impl<'a> COpenScreen<'a> { impl<'a> COpenScreen<'a> {
#[must_use] #[must_use]
pub fn new(window_id: VarInt, window_type: VarInt, window_title: &'a TextComponent) -> Self { pub const fn new(
window_id: VarInt,
window_type: VarInt,
window_title: &'a TextComponent,
) -> Self {
Self { Self {
sync_id: window_id, sync_id: window_id,
window_type, window_type,

View File

@ -20,7 +20,7 @@ pub struct COpenSignEditor {
impl COpenSignEditor { impl COpenSignEditor {
#[must_use] #[must_use]
pub fn new(location: BlockPos, is_front_text: bool) -> Self { pub const fn new(location: BlockPos, is_front_text: bool) -> Self {
Self { Self {
location, location,
is_front_text, is_front_text,

View File

@ -39,7 +39,7 @@ pub struct CParticle<'a> {
impl<'a> CParticle<'a> { impl<'a> CParticle<'a> {
#[expect(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
#[must_use] #[must_use]
pub fn new( pub const fn new(
force_spawn: bool, force_spawn: bool,
important: bool, important: bool,
position: Vector3<f64>, position: Vector3<f64>,

View File

@ -13,7 +13,7 @@ pub struct CPingResponse {
impl CPingResponse { impl CPingResponse {
#[must_use] #[must_use]
pub fn new(payload: i64) -> Self { pub const fn new(payload: i64) -> Self {
Self { payload } Self { payload }
} }
} }

View File

@ -26,7 +26,7 @@ pub struct CPlayerAbilities {
impl CPlayerAbilities { impl CPlayerAbilities {
#[must_use] #[must_use]
pub fn new(flags: i8, flying_speed: f32, field_of_view: f32) -> Self { pub const fn new(flags: i8, flying_speed: f32, field_of_view: f32) -> Self {
Self { Self {
flags, flags,
flying_speed, flying_speed,

View File

@ -53,7 +53,7 @@ pub struct CPlayerChatMessage {
impl CPlayerChatMessage { impl CPlayerChatMessage {
#[expect(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
#[must_use] #[must_use]
pub fn new( pub const fn new(
global_index: VarInt, global_index: VarInt,
sender: uuid::Uuid, sender: uuid::Uuid,
index: VarInt, index: VarInt,

View File

@ -56,7 +56,7 @@ pub struct Player<'a> {
impl<'a> CPlayerInfoUpdate<'a> { impl<'a> CPlayerInfoUpdate<'a> {
#[must_use] #[must_use]
pub fn new(actions: u8, players: &'a [Player<'a>]) -> Self { pub const fn new(actions: u8, players: &'a [Player<'a>]) -> Self {
Self { actions, players } Self { actions, players }
} }
} }

View File

@ -33,7 +33,7 @@ pub struct CPlayerPosition {
impl CPlayerPosition { impl CPlayerPosition {
#[must_use] #[must_use]
pub fn new( pub const fn new(
teleport_id: VarInt, teleport_id: VarInt,
position: Vector3<f64>, position: Vector3<f64>,
delta: Vector3<f64>, delta: Vector3<f64>,

View File

@ -19,7 +19,7 @@ pub struct CRemovePlayerInfo<'a> {
impl<'a> CRemovePlayerInfo<'a> { impl<'a> CRemovePlayerInfo<'a> {
#[must_use] #[must_use]
pub fn new(players: &'a [uuid::Uuid]) -> Self { pub const fn new(players: &'a [uuid::Uuid]) -> Self {
Self { players } Self { players }
} }
} }

View File

@ -28,7 +28,7 @@ pub struct CPlayerSpawnPosition {
impl CPlayerSpawnPosition { impl CPlayerSpawnPosition {
#[must_use] #[must_use]
pub fn new(location: BlockPos, yaw: f32, pitch: f32, dimension_name: String) -> Self { pub const fn new(location: BlockPos, yaw: f32, pitch: f32, dimension_name: String) -> Self {
Self { Self {
dimension_name, dimension_name,
location, location,

View File

@ -17,7 +17,7 @@ pub struct CRemoveEntities<'a> {
impl<'a> CRemoveEntities<'a> { impl<'a> CRemoveEntities<'a> {
#[must_use] #[must_use]
pub fn new(entity_ids: &'a [VarInt]) -> Self { pub const fn new(entity_ids: &'a [VarInt]) -> Self {
Self { entity_ids } Self { entity_ids }
} }
} }

View File

@ -12,7 +12,7 @@ pub struct CRemoveMobEffect {
impl CRemoveMobEffect { impl CRemoveMobEffect {
#[must_use] #[must_use]
pub fn new(entity_id: VarInt, effect_id: VarInt) -> Self { pub const fn new(entity_id: VarInt, effect_id: VarInt) -> Self {
Self { Self {
entity_id, entity_id,
effect_id, effect_id,

View File

@ -11,7 +11,7 @@ pub struct CResetScore {
impl CResetScore { impl CResetScore {
#[must_use] #[must_use]
pub fn new(entity_name: String, objective_name: Option<String>) -> Self { pub const fn new(entity_name: String, objective_name: Option<String>) -> Self {
Self { Self {
entity_name, entity_name,
objective_name, objective_name,

View File

@ -24,7 +24,7 @@ pub struct CRespawn {
impl CRespawn { impl CRespawn {
#[expect(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
#[must_use] #[must_use]
pub fn new( pub const fn new(
dimension_type: VarInt, dimension_type: VarInt,
dimension_name: ResourceLocation, dimension_name: ResourceLocation,
hashed_seed: i64, hashed_seed: i64,

View File

@ -11,7 +11,7 @@ pub struct CPlayServerLinks<'a> {
impl<'a> CPlayServerLinks<'a> { impl<'a> CPlayServerLinks<'a> {
#[must_use] #[must_use]
pub fn new(links: &'a [Link<'a>]) -> Self { pub const fn new(links: &'a [Link<'a>]) -> Self {
Self { links } Self { links }
} }
} }

View File

@ -11,7 +11,7 @@ pub struct CSetBorderCenter {
impl CSetBorderCenter { impl CSetBorderCenter {
#[must_use] #[must_use]
pub fn new(x: f64, z: f64) -> Self { pub const fn new(x: f64, z: f64) -> Self {
Self { x, z } Self { x, z }
} }
} }

View File

@ -14,7 +14,7 @@ pub struct CSetBorderLerpSize {
impl CSetBorderLerpSize { impl CSetBorderLerpSize {
#[must_use] #[must_use]
pub fn new(old_diameter: f64, new_diameter: f64, speed: VarLong) -> Self { pub const fn new(old_diameter: f64, new_diameter: f64, speed: VarLong) -> Self {
Self { Self {
old_diameter, old_diameter,
new_diameter, new_diameter,

View File

@ -10,7 +10,7 @@ pub struct CSetBorderSize {
impl CSetBorderSize { impl CSetBorderSize {
#[must_use] #[must_use]
pub fn new(diameter: f64) -> Self { pub const fn new(diameter: f64) -> Self {
Self { diameter } Self { diameter }
} }
} }

View File

@ -12,7 +12,7 @@ pub struct CSetBorderWarningDelay {
impl CSetBorderWarningDelay { impl CSetBorderWarningDelay {
#[must_use] #[must_use]
pub fn new(warning_time: VarInt) -> Self { pub const fn new(warning_time: VarInt) -> Self {
Self { warning_time } Self { warning_time }
} }
} }

Some files were not shown because too many files have changed in this diff Show More