diff --git a/luda-editor/new-server/database/database/Cargo.lock b/luda-editor/new-server/database/database/Cargo.lock index 139295cf5..f89edcc0b 100644 --- a/luda-editor/new-server/database/database/Cargo.lock +++ b/luda-editor/new-server/database/database/Cargo.lock @@ -83,272 +83,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "aws-credential-types" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" -dependencies = [ - "aws-smithy-async", - "aws-smithy-runtime-api", - "aws-smithy-types", - "zeroize", -] - -[[package]] -name = "aws-runtime" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75588e7ee5e8496eed939adac2035a6dbab9f7eb2acdd9ab2d31856dab6f3955" -dependencies = [ - "aws-credential-types", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "fastrand", - "http 0.2.12", - "http-body 0.4.6", - "percent-encoding", - "pin-project-lite", - "tracing", - "uuid", -] - -[[package]] -name = "aws-sdk-s3" -version = "1.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724119d8fd2d2638b9979673f3b5c2979fa388c9ca27815e3cb5ad6234fac3f5" -dependencies = [ - "ahash 0.8.11", - "aws-credential-types", - "aws-runtime", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-checksums", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "bytes", - "fastrand", - "hex", - "hmac", - "http 0.2.12", - "http-body 0.4.6", - "lru 0.12.3", - "once_cell", - "percent-encoding", - "regex-lite", - "sha2", - "tracing", - "url", -] - -[[package]] -name = "aws-sigv4" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58b56f1cbe6fd4d0c2573df72868f20ab1c125ca9c9dbce17927a463433a2e57" -dependencies = [ - "aws-credential-types", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "crypto-bigint 0.5.5", - "form_urlencoded", - "hex", - "hmac", - "http 0.2.12", - "http 1.1.0", - "once_cell", - "p256", - "percent-encoding", - "ring", - "sha2", - "subtle", - "time", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-smithy-async" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" -dependencies = [ - "futures-util", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "aws-smithy-checksums" -version = "0.60.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6242d6a54d3b4b83458f4abd7057ba93c4419dc71e8217e9acd3a748d656d99e" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "crc32c", - "crc32fast", - "hex", - "http 0.2.12", - "http-body 0.4.6", - "md-5", - "pin-project-lite", - "sha1", - "sha2", - "tracing", -] - -[[package]] -name = "aws-smithy-eventstream" -version = "0.60.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" -dependencies = [ - "aws-smithy-types", - "bytes", - "crc32fast", -] - -[[package]] -name = "aws-smithy-http" -version = "0.60.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" -dependencies = [ - "aws-smithy-eventstream", - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "bytes-utils", - "futures-core", - "http 0.2.12", - "http-body 0.4.6", - "once_cell", - "percent-encoding", - "pin-project-lite", - "pin-utils", - "tracing", -] - -[[package]] -name = "aws-smithy-json" -version = "0.60.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" -dependencies = [ - "aws-smithy-types", -] - -[[package]] -name = "aws-smithy-runtime" -version = "1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d3965f6417a92a6d1009c5958a67042f57e46342afb37ca58f9ad26744ec73" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "fastrand", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "http-body 1.0.0", - "hyper", - "hyper-rustls", - "once_cell", - "pin-project-lite", - "pin-utils", - "rustls", - "tokio", - "tracing", -] - -[[package]] -name = "aws-smithy-runtime-api" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4179bd8a1c943e1aceb46c5b9fc014a561bd6c35a2153e816ba29076ee49d245" -dependencies = [ - "aws-smithy-async", - "aws-smithy-types", - "bytes", - "http 0.2.12", - "http 1.1.0", - "pin-project-lite", - "tokio", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-smithy-types" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6764ba7e1c5ede1c9f9e4046645534f06c2581402461c559b481a420330a83" -dependencies = [ - "base64-simd", - "bytes", - "bytes-utils", - "futures-core", - "http 0.2.12", - "http 1.1.0", - "http-body 0.4.6", - "http-body 1.0.0", - "http-body-util", - "itoa", - "num-integer", - "pin-project-lite", - "pin-utils", - "ryu", - "serde", - "time", - "tokio", - "tokio-util", -] - -[[package]] -name = "aws-smithy-xml" -version = "0.60.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" -dependencies = [ - "xmlparser", -] - -[[package]] -name = "aws-types" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f734808d43702a67e57d478a12e227d4d038d0b90c9005a78c87890d3805922" -dependencies = [ - "aws-credential-types", - "aws-smithy-async", - "aws-smithy-runtime-api", - "aws-smithy-types", - "http 0.2.12", - "rustc_version", - "tracing", -] - [[package]] name = "backtrace" version = "0.3.72" @@ -364,34 +98,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bitflags" version = "1.3.2" @@ -416,15 +122,6 @@ dependencies = [ "wyz", ] -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -465,16 +162,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" -[[package]] -name = "bytes-utils" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" -dependencies = [ - "bytes", - "either", -] - [[package]] name = "cc" version = "1.1.8" @@ -493,37 +180,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - [[package]] name = "crc" version = "3.2.1" @@ -539,24 +195,6 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" -[[package]] -name = "crc32c" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" -dependencies = [ - "rustc_version", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - [[package]] name = "critical-section" version = "1.1.2" @@ -588,47 +226,15 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "database" version = "0.1.0" dependencies = [ "anyhow", - "aws-sdk-s3", "bytes", "crc", "document", + "libc", "lz4_flex", "migration", "quick_cache", @@ -638,25 +244,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - [[package]] name = "derivative" version = "2.2.0" @@ -677,17 +264,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - [[package]] name = "displaydoc" version = "0.2.4" @@ -711,44 +287,12 @@ dependencies = [ "serializer", ] -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", -] - [[package]] name = "either" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct", - "crypto-bigint 0.4.9", - "der", - "digest", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - [[package]] name = "embedded-io" version = "0.4.0" @@ -768,7 +312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -783,22 +327,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core", - "subtle", -] - [[package]] name = "filetime" version = "0.2.23" @@ -808,15 +336,9 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "windows-sys", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -832,55 +354,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -900,36 +373,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hash32" version = "0.2.1" @@ -981,129 +424,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper", - "log", - "rustls", - "rustls-native-certs", - "tokio", - "tokio-rustls", -] - [[package]] name = "icu_collections" version = "1.5.0" @@ -1234,28 +554,12 @@ dependencies = [ "utf8_iter", ] -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", -] - [[package]] name = "inventory" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - [[package]] name = "js-sys" version = "0.3.69" @@ -1267,9 +571,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libsqlite3-sys" @@ -1319,15 +623,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "lru" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" -dependencies = [ - "hashbrown 0.14.5", -] - [[package]] name = "lz4_flex" version = "0.11.3" @@ -1346,16 +641,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - [[package]] name = "memchr" version = "2.7.2" @@ -1380,17 +665,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "namui-type" version = "0.1.0" @@ -1399,7 +673,7 @@ dependencies = [ "auto_ops", "derivative", "derive-macro", - "lru 0.11.1", + "lru", "num", "ordered-float", "postcard", @@ -1439,15 +713,9 @@ name = "num-complex" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +dependencies = [ + "num-traits", +] [[package]] name = "num-integer" @@ -1504,12 +772,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - [[package]] name = "ordered-float" version = "4.2.1" @@ -1522,23 +784,6 @@ dependencies = [ "serde", ] -[[package]] -name = "outref" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" - -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -1559,7 +804,7 @@ dependencies = [ "libc", "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.52.5", + "windows-targets", ] [[package]] @@ -1574,22 +819,6 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der", - "spki", -] - [[package]] name = "pkg-config" version = "0.3.30" @@ -1608,12 +837,6 @@ dependencies = [ "serde", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "proc-macro2" version = "1.0.86" @@ -1686,7 +909,6 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", "serde", ] @@ -1728,12 +950,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "regex-lite" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" - [[package]] name = "rend" version = "0.4.2" @@ -1743,32 +959,6 @@ dependencies = [ "bytecheck", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac", - "zeroize", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - [[package]] name = "rkyv" version = "0.7.44" @@ -1837,65 +1027,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1921,59 +1053,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "seahash" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags 2.6.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.23" @@ -2008,38 +1093,6 @@ dependencies = [ "rkyv", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest", - "rand_core", -] - [[package]] name = "simdutf8" version = "0.1.4" @@ -2052,31 +1105,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "spin" version = "0.9.8" @@ -2086,16 +1120,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2108,12 +1132,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "1.0.109" @@ -2164,36 +1182,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tinystr" version = "0.7.6" @@ -2226,13 +1214,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", - "bytes", - "libc", - "mio", "pin-project-lite", - "socket2", "tokio-macros", - "windows-sys 0.48.0", ] [[package]] @@ -2246,72 +1229,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "twox-hash" version = "1.6.3" @@ -2322,24 +1239,12 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.5.1" @@ -2399,21 +1304,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vsimd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2474,37 +1364,13 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -2513,46 +1379,28 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.5" @@ -2565,48 +1413,24 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.5" @@ -2645,12 +1469,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "xmlparser" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" - [[package]] name = "yoke" version = "0.7.4" @@ -2716,12 +1534,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - [[package]] name = "zerovec" version = "0.10.2" diff --git a/luda-editor/new-server/database/database/Cargo.toml b/luda-editor/new-server/database/database/Cargo.toml index ed8808aaa..19ffdf524 100644 --- a/luda-editor/new-server/database/database/Cargo.toml +++ b/luda-editor/new-server/database/database/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] anyhow = { version = "1.0.86", features = ["backtrace"] } -aws-sdk-s3 = "1.34.0" +# aws-sdk-s3 = "1.34.0" quick_cache = "0.5.1" -tokio = { version = "1.38", features = ["rt", "time", "macros"] } +tokio = { version = "1.38", features = ["rt", "time", "macros", "sync"] } migration = { path = "../schema/migration" } document = { path = "../schema/document" } tar = "0.4.41" @@ -16,3 +16,7 @@ rusqlite = { version = "0.32.1", features = ["bundled"] } bytes = "1.8.0" rayon = "1.10.0" crc = "3.2.1" +libc = "0.2.161" + +[profile.release] +debug = true diff --git a/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/mod.rs b/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/mod.rs similarity index 79% rename from luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/mod.rs rename to luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/mod.rs index df597d60c..18d00aff6 100644 --- a/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/mod.rs +++ b/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/mod.rs @@ -1,6 +1,7 @@ -//! # B+IdTree +//! # B+128Tree //! -//! B+IdTree is a B+Tree implementation for storing 128bit Keys. +//! B+128Tree is a B+Tree implementation for storing 128bit Keys. +//! The key is also the value. //! All node size is 4KB, which will be called a page. //! Page Offset size is 32 bit. //! B+IdTree can store 2^32 pages, total Keys are 2^32 * 255 = 2^40. @@ -25,13 +26,21 @@ use operator::Operator; use std::{ collections::HashMap, fs::File, - io::{Read, Result, Seek, SeekFrom}, + io::{Read, Seek, SeekFrom}, mem::MaybeUninit, path::Path, }; use wal::*; -pub struct BpIdTree { +#[cfg(test)] +type Result = anyhow::Result; + +#[cfg(not(test))] +type Result = std::io::Result; + +pub type Key = u128; + +pub struct BP128Tree { file: File, wal: Wal, header: Header, @@ -39,7 +48,7 @@ pub struct BpIdTree { pages: HashMap, } -impl BpIdTree { +impl BP128Tree { pub fn open(path: impl AsRef) -> Result { let path = path.as_ref(); @@ -47,6 +56,7 @@ impl BpIdTree { let mut file = std::fs::OpenOptions::new() .write(true) + .read(true) .create(true) .truncate(false) .open(path)?; @@ -60,24 +70,30 @@ impl BpIdTree { Self::read_from_file(file, wal) } - pub fn insert(&mut self, key: u128) -> Result<()> { + pub fn insert(&mut self, key: Key) -> Result<()> { let done = Operator::new(&self.header, &self.pages, &mut self.file).insert(key)?; - self.wal.write_logs(done.logs)?; + self.apply_operator_done(done) + } + pub fn delete(&mut self, key: Key) -> Result<()> { + todo!() + } + pub fn iter(&self) -> Result> { + // TODO + Ok(std::iter::empty()) + } + fn apply_operator_done(&mut self, done: operator::Done) -> Result<()> { + self.wal.update_pages(&done.updated_pages)?; if let Some(header) = done.updated_header { self.header = header; } + for (page_offset, page) in done.pages_read_from_file { + self.pages.insert(page_offset, page); + } for (page_offset, page) in done.updated_pages { self.pages.insert(page_offset, page); } Ok(()) } - pub fn delete(&mut self, key: u128) -> Result<()> { - todo!() - } - pub fn iter(&self) -> Result> { - // TODO - Ok(std::iter::empty()) - } fn read_from_file(mut file: File, wal: Wal) -> Result { let header = unsafe { @@ -191,7 +207,7 @@ struct InternalNode { leaf_type: u8, _padding: [u8; 3], key_count: u32, - keys: [u128; INTERNAL_NODE_KEY_LEN], + keys: [Key; INTERNAL_NODE_KEY_LEN], child_offsets: [PageOffset; INTERNAL_NODE_KEY_LEN + 1], _padding_1: u32, } @@ -199,7 +215,7 @@ impl AsSlice for InternalNode {} impl InternalNode { pub fn new( - key: u128, + key: Key, left_side_child_offset: PageOffset, right_side_child_offset: PageOffset, ) -> Self { @@ -219,7 +235,7 @@ impl InternalNode { _padding_1: 0, } } - fn key_index(&self, key: u128) -> Option { + fn key_index(&self, key: Key) -> Option { self.keys .iter() .take(self.key_count as usize) @@ -227,7 +243,7 @@ impl InternalNode { .find(|(_, &key1)| key < key1) .map(|(i, _)| i) } - fn find_child_node_offset_for(&self, key: u128) -> PageOffset { + fn find_child_node_offset_for(&self, key: Key) -> PageOffset { self.key_index(key) .map(|i| self.child_offsets[i]) .unwrap_or(self.child_offsets[self.key_count as usize]) @@ -235,7 +251,11 @@ impl InternalNode { fn is_full(&self) -> bool { self.key_count == self.keys.len() as u32 } - fn insert(&mut self, key: u128, right_side_child_offset: PageOffset) -> Option { + fn insert( + &mut self, + key: Key, + right_side_child_offset: PageOffset, + ) -> Option<(InternalNode, Key)> { let key_index = self.key_index(key).unwrap_or(self.key_count as usize); if !self.is_full() { @@ -264,26 +284,24 @@ impl InternalNode { offsets }; - let floor = one_plus_keys.len() / 2; - let ceil = one_plus_keys.len() - floor; + let right_key_count = one_plus_keys.len() / 2; + let left_key_count = one_plus_keys.len() - right_key_count - 1; + let center_key_index = left_key_count; let mut right_node = unsafe { std::mem::zeroed::() }; - let key_count = floor - 1; - let offset_count = key_count + 1; - right_node.key_count = key_count as u32; - right_node.keys[..key_count] - .copy_from_slice(&one_plus_keys[(one_plus_keys.len() - key_count)..]); - right_node.child_offsets[..offset_count].copy_from_slice( - &one_plus_child_offsets[(one_plus_child_offsets.len() - offset_count)..], - ); + right_node.key_count = right_key_count as u32; + right_node.keys[..right_key_count].copy_from_slice(&one_plus_keys[center_key_index + 1..]); + right_node.child_offsets[..right_key_count + 1] + .copy_from_slice(&one_plus_child_offsets[center_key_index + 1..]); + + self.key_count = left_key_count as u32; + self.keys[..left_key_count].copy_from_slice(&one_plus_keys[..center_key_index]); + self.child_offsets[..left_key_count + 1] + .copy_from_slice(&one_plus_child_offsets[..center_key_index + 1]); - let key_count = ceil; - let offset_count = key_count + 1; - self.key_count = key_count as u32; - self.keys[..key_count].copy_from_slice(&one_plus_keys[..key_count]); - self.child_offsets[..offset_count].copy_from_slice(&one_plus_child_offsets[..offset_count]); + let center_key = one_plus_keys[center_key_index]; - Some(right_node) + Some((right_node, center_key)) } } @@ -295,7 +313,7 @@ struct LeafNode { leaf_type: u8, _padding: [u8; 3], id_count: u32, - keys: [u128; LEAF_NODE_KEYS_LEN], + keys: [Key; LEAF_NODE_KEYS_LEN], } impl AsSlice for LeafNode {} @@ -315,7 +333,7 @@ impl LeafNode { /// Return new splitted leaf node and new key if it's full. /// New leaf node will have half of the keys, bigger values. - fn insert(&mut self, key: u128) -> Option<(LeafNode, u128)> { + fn insert(&mut self, key: Key) -> Option<(LeafNode, Key)> { let offset = self .keys .iter() @@ -398,7 +416,7 @@ impl Node { struct Page { data: [u8; 4096], } - +impl AsSlice for Page {} impl Page { fn new() -> Self { Self { data: [0; 4096] } @@ -493,33 +511,54 @@ mod tests { let mut internal_node = InternalNode::new(1, PageOffset::new(0), PageOffset::new(1)); for i in 1..INTERNAL_NODE_KEY_LEN { assert!(internal_node - .insert(i as u128 + 1, PageOffset::new(i as u32 + 1)) + .insert(i as Key + 1, PageOffset::new(i as u32 + 1)) .is_none()); } - let right_node = internal_node + let (right_node, center_key) = internal_node .insert( - INTERNAL_NODE_KEY_LEN as u128 + 1, + INTERNAL_NODE_KEY_LEN as Key + 1, PageOffset::new(INTERNAL_NODE_KEY_LEN as u32 + 2), ) .unwrap(); - let floor = INTERNAL_NODE_KEY_LEN / 2; - let ceil = INTERNAL_NODE_KEY_LEN - floor; + assert_eq!(center_key, ((INTERNAL_NODE_KEY_LEN + 1) / 2) as Key); - assert_eq!(internal_node.key_count, ceil as u32); - assert_eq!(right_node.key_count, internal_node.key_count - 1); + assert_eq!( + internal_node.key_count + right_node.key_count, + INTERNAL_NODE_KEY_LEN as u32 + ); for i in 0..internal_node.key_count as usize { - assert_eq!(internal_node.keys[i], i as u128 + 1); + assert_eq!(internal_node.keys[i], i as Key + 1); assert_eq!(internal_node.child_offsets[i].value, i as u32); } for i in 0..right_node.key_count as usize { - assert_eq!(right_node.keys[i], i as u128 + 3 + floor as u128); + assert_eq!(right_node.keys[i], i as Key + 1 + center_key as Key); assert_eq!( right_node.child_offsets[i].value, - i as u32 + 2 + floor as u32 + i as u32 + center_key as u32 ); } } + + #[test] + fn test_insert_1to10000() { + let path = Path::new("./test").join("test_insert_1to10000"); + if path.exists() { + std::fs::remove_file(&path).unwrap(); + } + let wal_path = path.with_extension("wal"); + if wal_path.exists() { + std::fs::remove_file(&wal_path).unwrap(); + } + std::fs::create_dir_all(path.parent().unwrap()).unwrap(); + let mut tree = BP128Tree::open(path).unwrap(); + for i in 1..=1000 { + // let start = std::time::Instant::now(); + tree.insert(i as Key).unwrap(); + // println!("{:?}", start.elapsed()); + } + panic!(); + } } diff --git a/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/operator.rs b/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/operator.rs similarity index 65% rename from luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/operator.rs rename to luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/operator.rs index c41ac7201..7e2c8ccec 100644 --- a/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/operator.rs +++ b/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/operator.rs @@ -1,9 +1,9 @@ use super::*; -use std::collections::{hash_map::Entry, HashMap}; +use std::collections::{btree_map, hash_map, BTreeMap, HashMap}; pub struct Operator<'a> { pages_cached: &'a HashMap, - pages_updated: HashMap, + pages_updated: BTreeMap, pages_read_from_file: HashMap, updated_header: Option
, original_header: &'a Header, @@ -18,7 +18,7 @@ impl<'a> Operator<'a> { ) -> Operator<'a> { Operator { pages_cached, - pages_updated: HashMap::new(), + pages_updated: Default::default(), pages_read_from_file: HashMap::new(), updated_header: None, original_header: header, @@ -39,7 +39,10 @@ impl<'a> Operator<'a> { *self.page_mut(right_node_offset)?.as_leaf_node_mut() = right_half; if route.is_empty() { + assert_eq!(leaf_node_offset, self.header().root_node_offset); + let internal_node_offset = self.new_page()?; + let internal_node = self.page_mut(internal_node_offset)?.as_internal_node_mut(); *internal_node = InternalNode::new(key, leaf_node_offset, right_node_offset); @@ -47,37 +50,43 @@ impl<'a> Operator<'a> { return Ok(self.done()); } - for parent_offset in route.iter().rev().cloned() { - let parent_node = self.page_mut(parent_offset)?.as_internal_node_mut(); - parent_node.insert(key, right_node_offset); + let mut key = key; + let mut right_node_offset = right_node_offset; - // let Some((half, key, key)) = parent_node.insert(new_leaf_node_offset, key) else { - // return Ok(self.done()); - // }; - } + let mut must_be_last = false; - todo!() + for node_offset in route.iter().rev().cloned() { + if must_be_last { + unreachable!(); + } - // - Otherwise, before inserting the new record - // - Split the node. - // - original node has ⌈(K+1)/2⌉ items - // - new node has ⌊(K+1)/2⌋ items - // - Copy ⌈(K+1)/2⌉-th key to the parent, and insert the new node to the parent. - // - Repeat until a parent is found that need not split. - // - Insert the new record into the new node. - // - If the root splits, treat it as if it has an empty parent and split as outline above. + let internal_node = self.page_mut(node_offset)?.as_internal_node_mut(); + let Some((right_node, center_key)) = internal_node.insert(key, right_node_offset) + else { + return Ok(self.done()); + }; + right_node_offset = self.new_page()?; + *self.page_mut(right_node_offset)?.as_internal_node_mut() = right_node; + + if node_offset != self.header().root_node_offset { + key = center_key; + continue; + } + + let new_root_node_offset = self.new_page()?; + let new_root_node = InternalNode::new(center_key, node_offset, right_node_offset); + *self.page_mut(new_root_node_offset)?.as_internal_node_mut() = new_root_node; + must_be_last = true; + } + + Ok(self.done()) } fn done(self) -> Done { - todo!() - // Done { - // updated_pages: self.pages_updated, - // logs: self.logs, - // updated_header: if self.is_header_updated { - // Some(self.original_header) - // } else { - // None - // }, - // } + Done { + updated_header: self.updated_header, + pages_read_from_file: self.pages_read_from_file, + updated_pages: self.pages_updated, + } } fn find_route_for_insertion(&mut self, key: u128) -> Result> { let mut node_offset = self.original_header.root_node_offset; @@ -99,7 +108,7 @@ impl<'a> Operator<'a> { } else if let Some(page) = self.pages_cached.get(&page_offset) { Ok(page) } else { - if let Entry::Vacant(e) = self.pages_read_from_file.entry(page_offset) { + if let hash_map::Entry::Vacant(e) = self.pages_read_from_file.entry(page_offset) { let page = read_page_from_file(self.file, page_offset)?; e.insert(page); } @@ -108,12 +117,13 @@ impl<'a> Operator<'a> { } } fn page_mut(&mut self, page_offset: PageOffset) -> Result<&mut Page> { - if let Entry::Vacant(e) = self.pages_updated.entry(page_offset) { + if let btree_map::Entry::Vacant(e) = self.pages_updated.entry(page_offset) { let page = { if let Some(page) = self.pages_cached.get(&page_offset) { *page } else { - if let Entry::Vacant(e) = self.pages_read_from_file.entry(page_offset) { + if let hash_map::Entry::Vacant(e) = self.pages_read_from_file.entry(page_offset) + { let page = read_page_from_file(self.file, page_offset)?; e.insert(page); } @@ -152,17 +162,6 @@ impl<'a> Operator<'a> { Ok(Some(page_offset)) } - fn push_free_page(&mut self) -> Result<()> { - if self.header().free_page_stack_top_page_offset.is_null() { - // let page_offset = self.allocate_page()?; - // self.wal.update_free_page_stack_top_page_offset(page_offset)?; - // self.header.free_page_stack_top_page_offset = page_offset; - - // let stack_top = page.into_free_page_stack_node(); - } - - todo!() - } fn allocate_page(&mut self) -> Result { let page_offset = self.header_mut().next_page_offset.fetch_increase(); let page = Page::new(); @@ -172,23 +171,17 @@ impl<'a> Operator<'a> { Ok(page_offset) } fn header(&self) -> &Header { - self.updated_header - .as_ref() - .unwrap_or_else(|| &self.original_header) + self.updated_header.as_ref().unwrap_or(self.original_header) } fn header_mut(&mut self) -> &mut Header { - self.updated_header - .get_or_insert_with(|| self.original_header.clone()) + self.updated_header.get_or_insert(*self.original_header) } } -pub enum OperationLog { - UpdatePage { page_offset: PageOffset, page: Page }, -} - pub struct Done { - pub updated_pages: HashMap, - pub logs: Vec, + pub updated_pages: BTreeMap, + pub pages_read_from_file: HashMap, + /// If header was updated, `updated_pages` will contain the updated header page too. pub updated_header: Option
, } diff --git a/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/wal.rs b/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/wal.rs new file mode 100644 index 000000000..31e10a54b --- /dev/null +++ b/luda-editor/new-server/database/database/src/document_store/nfs/bp128tree/wal.rs @@ -0,0 +1,212 @@ +//! # Wal File +//! +//! [Header][Body][Header][Body]... +//! + +use super::{super::crc, *}; +use bytes::BufMut; +use libc::c_int; +use std::{ + collections::BTreeMap, + ffi::CString, + fs::{File, OpenOptions}, + io::{BufReader, BufWriter, Read, Seek, Write}, + os::unix::fs::OpenOptionsExt, +}; + +pub struct Wal { + // buf_writer: BufWriter, + file: File, + dirty: bool, +} + +impl Wal { + pub(crate) fn open(path: std::path::PathBuf) -> Result { + let file = OpenOptions::new() + .create(true) + .read(true) + .write(true) + .truncate(false) + .custom_flags(libc::O_DIRECT) + .open(path)?; + + Ok(Self { + dirty: file.metadata()?.len() != 0, + // buf_writer: BufWriter::new(file), + file, + }) + } + + fn file(&self) -> &File { + // self.buf_writer.get_ref() + &self.file + } + + pub(crate) fn flush(&mut self, file: &mut File) -> Result<()> { + if !self.dirty { + return Ok(()); + } + + let wal_file_len = self.file().metadata()?.len(); + if wal_file_len == 0 { + return Ok(()); + } + + let mut reader = BufReader::new(self.file()); + reader.seek(SeekFrom::Start(0))?; + + while reader.stream_position()? < wal_file_len { + let header = unsafe { + let mut header = MaybeUninit::::uninit(); + reader.read_exact(std::slice::from_raw_parts_mut( + header.as_mut_ptr() as *mut u8, + size_of::(), + ))?; + header.assume_init() + }; + + match header.body_types { + // Init + 0 => { + let root_node_offset = PageOffset::new(1); + + let header = Header { + free_page_stack_top_page_offset: PageOffset::NULL, + root_node_offset, + next_page_offset: PageOffset::new(2), + _padding: [0; 1021], + }; + + let root_node = LeafNode::new(); + + let mut bytes = Vec::with_capacity(size_of::
() + size_of::()); + bytes.put_slice(header.as_slice()); + bytes.put_slice(root_node.as_slice()); + + file.set_len(0)?; + file.write_all(&bytes)?; + file.sync_all()?; + } + // PutPage + 1 => { + let body = unsafe { + let mut body = MaybeUninit::::uninit(); + reader.read_exact(std::slice::from_raw_parts_mut( + body.as_mut_ptr() as *mut u8, + header.body_length as usize, + ))?; + body.assume_init() + }; + + file.seek(body.page_offset.file_pos())?; + file.write_all(body.page.as_slice())?; + } + _ => unreachable!(), + } + } + + self.file().set_len(0)?; + self.file().sync_all()?; + self.dirty = false; + + Ok(()) + } + + pub(crate) fn write_init(&mut self) -> Result<()> { + println!("write_init"); + self.write_wal(Init)?; + self.sync_all()?; + Ok(()) + } + + pub(crate) fn update_pages(&mut self, pages: &BTreeMap) -> Result<()> { + for (offset, page) in pages { + let put_page = PutPage { + page_offset: *offset, + page: *page, + }; + + self.write_wal(put_page)?; + } + + self.sync_all()?; + + Ok(()) + } + fn write_wal(&mut self, body: Body) -> Result<()> { + self.dirty = true; + + let body_bytes = body.as_slice(); + let header = WalHeader { + checksum: crc().checksum(body_bytes), + body_length: body_bytes.len() as u32, + body_types: Body::body_types(), + }; + + // store header and body in a multiple of 512 bytes + let header_size = size_of::(); + let body_size = body_bytes.len(); + let padding_size = (512 - ((header_size + body_size) % 512)) % 512; + let bytes_size = header_size + body_size + padding_size; + assert_eq!(bytes_size % 512, 0); + let mut bytes = Vec::with_capacity(bytes_size); + bytes.put_slice(header.as_slice()); + bytes.put_slice(body_bytes); + bytes.resize(bytes_size, 0); + + println!("bytes.len(): {}", bytes.len()); + // self.file.write_all(&bytes)?; + let mut bytes = [0u8; 1024]; + let align_offset = bytes.as_ptr().align_offset(512); + println!("align_offset: {}", align_offset); + let bytes_aligned_512 = bytes.get_mut(align_offset..align_offset + 512).unwrap(); + println!("bytes_aligned_512.len(): {}", bytes_aligned_512.len()); + assert_eq!(bytes_aligned_512.as_ptr().align_offset(512), 0); + let written = self.file.write(bytes_aligned_512)?; + + println!("written: {}", written); + Ok(()) + } + + fn sync_all(&mut self) -> Result<()> { + // self.file.flush()?; + // let now = std::time::Instant::now(); + // self.file().sync_all()?; + // println!("sync_all: {:?}", now.elapsed()); + + Ok(()) + } +} + +#[repr(C)] +struct WalHeader { + checksum: u64, + body_length: u32, + body_types: u8, +} +impl AsSlice for WalHeader {} + +#[repr(C)] +struct Init; +impl AsSlice for Init {} +impl WalBody for Init { + fn body_types() -> u8 { + 0 + } +} + +#[repr(C)] +struct PutPage { + page_offset: PageOffset, + page: Page, +} +impl AsSlice for PutPage {} +impl WalBody for PutPage { + fn body_types() -> u8 { + 1 + } +} + +trait WalBody: AsSlice { + fn body_types() -> u8; +} diff --git a/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/wal.rs b/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/wal.rs deleted file mode 100644 index 2e02abf93..000000000 --- a/luda-editor/new-server/database/database/src/document_store/nfs/bp_id_tree/wal.rs +++ /dev/null @@ -1,187 +0,0 @@ -//! # Wal File -//! -//! [Header][Body][Header][Body]... -//! -//! - Header -//! - Body Checksum: u64 -//! - Body Length: u32 -//! - Body types: u8 -//! -//! - Init(0) Body -//! - nothing -//! -//! - InsertToLeafNode(1) Body -//! - NodeIndex: PageIndex -//! - Id: u128 - -use super::{super::crc, *}; -use bytes::BufMut; -use std::{ - fs::File, - io::{BufReader, Read, Result, Seek, Write}, -}; - -pub struct Wal { - file: File, - dirty: bool, -} - -impl Wal { - pub(crate) fn open(path: std::path::PathBuf) -> Result { - let file = std::fs::OpenOptions::new() - .create(true) - .append(true) - .open(path)?; - - Ok(Self { file, dirty: true }) - } - - pub(crate) fn flush(&mut self, file: &mut File) -> Result<()> { - if !self.dirty { - return Ok(()); - } - - let wal_file_len = self.file.metadata()?.len(); - let mut reader = BufReader::new(&mut self.file); - - while wal_file_len > reader.stream_position()? { - let header = unsafe { - let mut header = MaybeUninit::::uninit(); - reader.read_exact(std::slice::from_raw_parts_mut( - header.as_mut_ptr() as *mut u8, - size_of::(), - ))?; - header.assume_init() - }; - - match header.body_types { - // Init - 0 => { - let root_node_offset = PageOffset::new(1); - - let header = Header { - free_page_stack_top_page_offset: PageOffset::NULL, - root_node_offset, - next_page_offset: PageOffset::new(2), - _padding: [0; 1021], - }; - - let root_node = LeafNode::new(); - - let mut bytes = Vec::with_capacity(size_of::
() + size_of::()); - bytes.put_slice(header.as_slice()); - bytes.put_slice(root_node.as_slice()); - - file.set_len(0)?; - file.write_all(&bytes)?; - file.sync_all()?; - } - // InsertToLeafNode - 1 => { - let body = unsafe { - let mut body = MaybeUninit::::uninit(); - reader.read_exact(std::slice::from_raw_parts_mut( - body.as_mut_ptr() as *mut u8, - header.body_length as usize, - ))?; - body.assume_init() - }; - - let mut node = read_page_from_file(file, body.node_offset)?.into_leaf_node(); - node.insert(body.id); - write_node_to_file(file, body.node_offset, node.into_node())?; - } - _ => unreachable!(), - } - } - - if wal_file_len > 0 { - self.file.set_len(0)?; - self.file.sync_all()?; - } - self.dirty = false; - - Ok(()) - } - - pub(crate) fn write_init(&mut self) -> Result<()> { - self.dirty = true; - - let body = []; - let header = WalHeader { - checksum: crc().checksum(&body), - body_length: body.len() as u32, - body_types: 0u8, - }; - - self.file.write_all(header.as_slice())?; - self.file.sync_all()?; - Ok(()) - } - - pub(crate) fn write_insert_to_leaf_node( - &mut self, - node_offset: PageOffset, - id: u128, - ) -> Result<()> { - self.dirty = true; - - let body = InsertToLeafNodeBody { node_offset, id }; - let body_bytes = body.as_slice(); - let header = WalHeader { - checksum: crc().checksum(body_bytes), - body_length: body_bytes.len() as u32, - body_types: 1u8, - }; - - let mut bytes = [0u8; size_of::() + size_of::()]; - { - let mut bytes = bytes.as_mut(); - bytes.put_slice(header.as_slice()); - bytes.put_slice(body_bytes); - } - - self.file.write_all(&bytes)?; - self.file.sync_all()?; - Ok(()) - } - - pub(crate) fn allocate_page(&self) -> Result<()> { - todo!() - } - - pub(crate) fn update_free_page_stack_top_page_offset( - &self, - page_offset: PageOffset, - ) -> Result<()> { - todo!() - } - - pub(crate) fn write_logs(&self, logs: Vec) -> Result<()> { - todo!() - } -} - -fn write_node_to_file(file: &mut File, node_offset: PageOffset, node: Node) -> Result<()> { - file.seek(node_offset.file_pos())?; - - file.write_all(node.as_slice())?; - file.sync_all()?; - - Ok(()) -} - -#[repr(C)] -struct WalHeader { - checksum: u64, - body_length: u32, - body_types: u8, -} -impl AsSlice for WalHeader {} - -#[repr(C)] -struct InsertToLeafNodeBody { - node_offset: PageOffset, - id: u128, -} -impl AsSlice for InsertToLeafNodeBody {} diff --git a/luda-editor/new-server/database/database/src/document_store/nfs/mod.rs b/luda-editor/new-server/database/database/src/document_store/nfs/mod.rs index c79bda461..7674accb7 100644 --- a/luda-editor/new-server/database/database/src/document_store/nfs/mod.rs +++ b/luda-editor/new-server/database/database/src/document_store/nfs/mod.rs @@ -1,4 +1,4 @@ -mod bp_id_tree; +mod bp128tree; mod db_thread; mod document_store_impl; mod flush_wals; @@ -27,7 +27,7 @@ impl NfsV4DocStore { pub fn new(mount_point: impl AsRef) -> Self { // remove below. { - let mut tree = bp_id_tree::BpIdTree::open(&mount_point).unwrap(); + let mut tree = bp128tree::BP128Tree::open(&mount_point).unwrap(); _ = tree.insert(5); _ = tree.delete(5); _ = tree.iter();