From 511d494cd969a7fb3da3bc702c63db5c6c800297 Mon Sep 17 00:00:00 2001 From: Nicholas Novak <34256932+NickyBoy89@users.noreply.github.com> Date: Sat, 28 Oct 2023 22:05:45 -0700 Subject: [PATCH] chore: Removed rust code from repo --- Cargo.lock | 1728 ------------------------------ Cargo.toml | 19 - src/main.rs | 33 - src/simple_server/mod.rs | 1 - src/simple_server/server.rs | 79 -- src/storage/chunk_compression.rs | 2 - src/storage/disk_storage.rs | 128 --- src/storage/mod.rs | 3 - src/storage/world.rs | 213 ---- src/storage_server.rs | 23 - src/tests/insert_one.rs | 108 -- src/tests/mod.rs | 2 - src/tests/performance_testing.rs | 154 --- 13 files changed, 2493 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 Cargo.toml delete mode 100644 src/main.rs delete mode 100644 src/simple_server/mod.rs delete mode 100644 src/simple_server/server.rs delete mode 100644 src/storage/chunk_compression.rs delete mode 100644 src/storage/disk_storage.rs delete mode 100644 src/storage/mod.rs delete mode 100644 src/storage/world.rs delete mode 100644 src/storage_server.rs delete mode 100644 src/tests/insert_one.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/performance_testing.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 0685da7..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,1728 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "const-random", - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" -dependencies = [ - "anstyle", - "windows-sys", -] - -[[package]] -name = "arrow-array" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d02efa7253ede102d45a4e802a129e83bcc3f49884cab795b1ac223918e4318d" -dependencies = [ - "ahash", - "arrow-buffer", - "arrow-data", - "arrow-schema", - "chrono", - "half", - "hashbrown 0.14.0", - "num", -] - -[[package]] -name = "arrow-buffer" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda119225204141138cb0541c692fbfef0e875ba01bfdeaed09e9d354f9d6195" -dependencies = [ - "bytes", - "half", - "num", -] - -[[package]] -name = "arrow-cast" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d825d51b9968868d50bc5af92388754056796dbc62a4e25307d588a1fc84dee" -dependencies = [ - "arrow-array", - "arrow-buffer", - "arrow-data", - "arrow-schema", - "arrow-select", - "chrono", - "half", - "lexical-core", - "num", -] - -[[package]] -name = "arrow-data" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475a4c3699c8b4095ca61cecf15da6f67841847a5f5aac983ccb9a377d02f73a" -dependencies = [ - "arrow-buffer", - "arrow-schema", - "half", - "num", -] - -[[package]] -name = "arrow-ipc" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1248005c8ac549f869b7a840859d942bf62471479c1a2d82659d453eebcd166a" -dependencies = [ - "arrow-array", - "arrow-buffer", - "arrow-cast", - "arrow-data", - "arrow-schema", - "flatbuffers", -] - -[[package]] -name = "arrow-schema" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1d179c117b158853e0101bfbed5615e86fe97ee356b4af901f1c5001e1ce4b" - -[[package]] -name = "arrow-select" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c71e003202e67e9db139e5278c79f5520bb79922261dfe140e4637ee8b6108" -dependencies = [ - "ahash", - "arrow-array", - "arrow-buffer", - "arrow-data", - "arrow-schema", - "num", -] - -[[package]] -name = "async-trait" -version = "0.1.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core", - "bitflags", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "brotli" -version = "3.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets", -] - -[[package]] -name = "clap" -version = "4.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "const-random" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" -dependencies = [ - "const-random-macro", - "proc-macro-hack", -] - -[[package]] -name = "const-random-macro" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" -dependencies = [ - "getrandom", - "once_cell", - "proc-macro-hack", - "tiny-keccak", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "darling" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "deranged" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "flatbuffers" -version = "23.5.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dac53e22462d78c16d64a1cd22371b54cc3fe94aa15e7886a2fa6e5d1ab8640" -dependencies = [ - "bitflags", - "rustc_version", -] - -[[package]] -name = "flate2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "half" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" -dependencies = [ - "cfg-if", - "crunchy", - "num-traits", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "http" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "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.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.4.9", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", - "serde", -] - -[[package]] -name = "integer-encoding" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lexical-core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" -dependencies = [ - "lexical-parse-float", - "lexical-parse-integer", - "lexical-util", - "lexical-write-float", - "lexical-write-integer", -] - -[[package]] -name = "lexical-parse-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" -dependencies = [ - "lexical-parse-integer", - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-parse-integer" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-util" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" -dependencies = [ - "static_assertions", -] - -[[package]] -name = "lexical-write-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" -dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", -] - -[[package]] -name = "lexical-write-integer" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "libc" -version = "0.2.148" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" - -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "lz4" -version = "1.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" -dependencies = [ - "libc", - "lz4-sys", -] - -[[package]] -name = "lz4-sys" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "memchr" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "wasi", - "windows-sys", -] - -[[package]] -name = "num" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "ordered-float" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] - -[[package]] -name = "parquet" -version = "47.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0463cc3b256d5f50408c49a4be3a16674f4c8ceef60941709620a062b1f6bf4d" -dependencies = [ - "ahash", - "arrow-array", - "arrow-buffer", - "arrow-cast", - "arrow-data", - "arrow-ipc", - "arrow-schema", - "arrow-select", - "base64", - "brotli", - "bytes", - "chrono", - "flate2", - "hashbrown 0.14.0", - "lz4", - "num", - "num-bigint", - "paste", - "seq-macro", - "snap", - "thrift", - "twox-hash", - "zstd", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - -[[package]] -name = "proc-macro2" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "semver" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" - -[[package]] -name = "seq-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" - -[[package]] -name = "serde" -version = "1.0.189" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_arrays" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38636132857f68ec3d5f3eb121166d2af33cb55174c4d5ff645db6165cbef0fd" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.189" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.0.1", - "serde", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "snap" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "spatial-db" -version = "0.1.0" -dependencies = [ - "arrow-array", - "axum", - "clap", - "parquet", - "rand", - "serde", - "serde-big-array", - "serde_arrays", - "serde_json", - "serde_with", - "tokio", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "syn" -version = "2.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "thrift" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e54bc85fc7faa8bc175c4bab5b92ba8d9a3ce893d0e9f42cc455c8ab16a9e09" -dependencies = [ - "byteorder", - "integer-encoding", - "ordered-float", -] - -[[package]] -name = "time" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" -dependencies = [ - "deranged", - "itoa", - "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.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" -dependencies = [ - "time-core", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tokio" -version = "1.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" -dependencies = [ - "backtrace", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2 0.5.4", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[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.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "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_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[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_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[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_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "zstd" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "6.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" -dependencies = [ - "cc", - "libc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index ce36e98..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "spatial-db" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -arrow-array = "47.0.0" -axum = "0.6.20" -clap = { version = "4.4.5", features = ["derive"] } -parquet = "47.0.0" -rand = "0.8.5" -serde = { version = "1.0.189", features = ["derive"] } -serde-big-array = "0.5.1" -serde_arrays = "0.1.0" -serde_json = "1.0.107" -serde_with = "3.4.0" -tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index e71ef9f..0000000 --- a/src/main.rs +++ /dev/null @@ -1,33 +0,0 @@ -#![feature(test)] - -extern crate serde; -#[macro_use] -extern crate serde_big_array; - -mod simple_server; -mod storage; -mod storage_server; -use clap::Parser; - -#[cfg(test)] -mod tests; - -#[derive(Parser, Debug)] -#[command(author, version, about, long_about = None)] -struct Args { - /// `http` starts a build-in http server that listens for reads and writes - /// to the database - #[arg(long)] - http: bool, -} - -fn main() { - let args = Args::parse(); - - if args.http { - println!("Proxy was enabled"); - storage_server::main(); - } - - println!("Hello, world!"); -} diff --git a/src/simple_server/mod.rs b/src/simple_server/mod.rs deleted file mode 100644 index 74f47ad..0000000 --- a/src/simple_server/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod server; diff --git a/src/simple_server/server.rs b/src/simple_server/server.rs deleted file mode 100644 index ed5737b..0000000 --- a/src/simple_server/server.rs +++ /dev/null @@ -1,79 +0,0 @@ -use crate::storage::disk_storage::ChunkStorageCache; -use crate::storage::world::{BlockID, BlockPos, BlockRange, ChunkData, ChunkPos}; -use crate::storage_server::StorageServer; - -#[derive(Debug)] -struct MultipleBlocks { - id: BlockID, - range: BlockRange, -} - -#[derive(Debug)] -pub struct SimpleServer { - chunk_storage: ChunkStorageCache, -} - -impl SimpleServer { - pub fn new() -> Self { - SimpleServer { - chunk_storage: ChunkStorageCache::new(), - } - } - - pub fn num_chunks(&self) -> usize { - unimplemented!() - } - - fn chunk_at(&mut self, block_pos: &BlockPos) -> Option { - let chunk_pos = ChunkPos::from(block_pos); - - let chunk = self - .chunk_storage - .fetch_chunk_by_pos(&chunk_pos) - .expect("Finding chunk failed"); - - Some(chunk) - } - - fn create_chunk_at(&mut self, chunk_pos: &ChunkPos) { - self.chunk_storage - .fetch_chunk_by_pos(&chunk_pos) - .expect("Creatinc chunk failed"); - } -} - -impl StorageServer for SimpleServer { - fn change_block(&mut self, target_state: BlockID, world_position: &BlockPos) { - let mut chunk = self.chunk_at(world_position); - - // Test if there is a chunk that already exists - if chunk.is_none() { - self.create_chunk_at(&ChunkPos::from(world_position)); - chunk = self.chunk_at(world_position); - } - - let mut chunk = chunk.expect("Could not find chunk"); - - // Find the section that the block is located in - let current_section = &mut chunk.sections[world_position.y % 16]; - // Find the index that the block is at, and update its state - let chunk_array_index = current_section.index_of_block(&world_position); - current_section.update_block_at_index(&target_state, chunk_array_index); - } - - fn change_block_range(&mut self, target_stage: BlockID, start: &BlockPos, end: &BlockPos) { - unimplemented!() - } - - fn read_block_at(&mut self, pos: &BlockPos) -> BlockID { - let chunk = self.chunk_at(pos); - - if let Some(chunk) = chunk { - let chunk_section = chunk.section_for(pos); - - return chunk_section.get_block_at_index(pos).clone(); - } - - BlockID::Empty - } -} diff --git a/src/storage/chunk_compression.rs b/src/storage/chunk_compression.rs deleted file mode 100644 index 139597f..0000000 --- a/src/storage/chunk_compression.rs +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/storage/disk_storage.rs b/src/storage/disk_storage.rs deleted file mode 100644 index 84c6cf5..0000000 --- a/src/storage/disk_storage.rs +++ /dev/null @@ -1,128 +0,0 @@ -use super::world::{ChunkData, ChunkPos}; -use std::cmp::Ordering; -use std::error::Error; -use std::io::{BufReader, ErrorKind, Write}; -use std::{collections::HashMap, fs::File, time::Instant}; - -const CACHED_CHUNK_FILES: usize = 1; - -/// `ChunkStorageCache` caches a list of the most recently used file handles -/// where chunks are stored from, and allows for faster accessing of the data -/// from chunks -#[derive(Debug)] -pub struct ChunkStorageCache { - // `cached_chunk_files` is a vector of cached file handles that are already open - cached_chunk_files: [Option; CACHED_CHUNK_FILES], - // `cached_file_names` is a list of all the filenames that are contained - // within the cache - cached_file_names: HashMap, - last_used_times: [Instant; CACHED_CHUNK_FILES], -} - -impl ChunkStorageCache { - pub fn new() -> Self { - ChunkStorageCache { - cached_chunk_files: [None; CACHED_CHUNK_FILES], - cached_file_names: HashMap::new(), - last_used_times: [Instant::now(); CACHED_CHUNK_FILES], - } - } - - /// `load_chunk_file` is called whenever a file is missing in the file cache - /// and needs to be loaded from disk - /// - /// This replaces a slot for another file in the cache, according to the - /// caching strategy - fn load_chunk_file(&mut self, chunk_pos: &ChunkPos, file_name: &str) -> &File { - let chunk_file = File::options().write(true).read(true).open(file_name); - - let chunk_file = match chunk_file { - Ok(file) => file, - Err(err) => match err.kind() { - ErrorKind::NotFound => { - let mut new_chunk_file = File::options() - .write(true) - .read(true) - .create(true) - .open(file_name) - .expect("Opening new chunk file failed"); - - let blank_chunk = ChunkData::new(chunk_pos); - - let encoded_chunk = serde_json::to_string(&blank_chunk).unwrap(); - - new_chunk_file - .write_all(encoded_chunk.as_bytes()) - .expect("Error writing data to chunk"); - - new_chunk_file - } - err => panic!("Opening new file for chunk failed with: {:?}", err), - }, - }; - - // Add the newly opened file to the cache - - // Insert the new item to replace the item that was last accessed - // The minimum time should be the oldest time - let (last_used_index, _) = self - .last_used_times - .iter() - .enumerate() - .reduce( - |(fst_index, fst_time), (snd_index, snd_time)| match fst_time.cmp(&snd_time) { - Ordering::Less => (fst_index, fst_time), - Ordering::Equal | Ordering::Greater => (snd_index, snd_time), - }, - ) - .expect("There should always be a last used index"); - - // Next, we have to: - // * Remove the old filename and index mapping from the names - // * Replace the last used time with the curent time - // * Replace the open file with the current one - - if !self.cached_file_names.is_empty() { - // Find the name of the previous entry - let (previous_file_name, _) = self - .cached_file_names - .iter() - .find(|(_, &array_index)| array_index == last_used_index) - .expect("The last used index should always have a name"); - - self.cached_file_names.remove(&previous_file_name.clone()); - } - self.cached_file_names - .insert(file_name.to_string(), last_used_index); - // Replace the timestamp with the new timestamp - self.last_used_times[last_used_index] = Instant::now(); - self.cached_chunk_files[last_used_index] = Some(chunk_file); - - self.cached_chunk_files[last_used_index].as_ref().unwrap() - } - - /// `fetch_chunk_by_pos` takes in the position of a chunk, and returns the - /// data of the chunk from disk - /// - /// This operation is cached, if possible, so that subsequent accesses to - /// the same chunk are handled by the same file - pub fn fetch_chunk_by_pos(&mut self, pos: &ChunkPos) -> Result> { - let file_name = pos.storage_file_name(); - - let file_index = self.cached_file_names.get(file_name.as_str()); - - let chunk_file = match file_index { - Some(index) => self.cached_chunk_files[*index].as_ref().unwrap(), - None => self.load_chunk_file(pos, file_name.as_str()), - }; - - let file_contents = std::io::read_to_string(chunk_file)?; - - let read_data: ChunkData = serde_json::from_str(file_contents.as_str())?; - - // let read_data: ChunkData = serde_json::from_reader(&mut file_buffer)?; - // let read_data = ChunkData::new(&ChunkPos { x: 0, z: 0 }); - - Ok(read_data) - } -} diff --git a/src/storage/mod.rs b/src/storage/mod.rs deleted file mode 100644 index 0565773..0000000 --- a/src/storage/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod chunk_compression; -pub mod disk_storage; -pub mod world; diff --git a/src/storage/world.rs b/src/storage/world.rs deleted file mode 100644 index 0c49169..0000000 --- a/src/storage/world.rs +++ /dev/null @@ -1,213 +0,0 @@ -use core::fmt; -use serde::ser; -use serde::ser::{SerializeSeq, SerializeStruct, Serializer}; -use serde::{Deserialize, Serialize}; -use std::{ - cmp::{max, min}, - fmt::Debug, - fs::File, -}; - -use serde_big_array::BigArray; - -const SECTIONS_PER_CHUNK: usize = 16; -const SLICE_SIZE: usize = 16 * 16; - -const DATABASE_FILE_LOCATION: &str = "./persistence"; - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct ChunkPos { - pub x: isize, - pub z: isize, -} - -impl From<&BlockPos> for ChunkPos { - fn from(value: &BlockPos) -> Self { - ChunkPos { - x: value.x / 16, - z: value.z / 16, - } - } -} - -impl ChunkPos { - pub fn storage_file_name(&self) -> String { - format!("{DATABASE_FILE_LOCATION}/{}.{}.chunk", self.x, self.z) - } -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct ChunkData { - pub pos: ChunkPos, - #[serde(with = "serde_arrays")] - pub sections: [ChunkSection; SECTIONS_PER_CHUNK], -} - -// impl Serialize for ChunkData { -// fn serialize(&self, serializer: S) -> Result -// where -// S: serde::Serializer, -// { -// let mut seq = serializer.serialize_seq(Some(self.sections.len()))?; -// -// for section in self.sections { -// seq.serialize_element(§ion)?; -// } -// seq.end() -// } -// } - -impl ChunkData { - pub fn new(pos: &ChunkPos) -> Self { - ChunkData { - pos: pos.clone(), - sections: [ChunkSection::new(); SECTIONS_PER_CHUNK], - } - } - - pub fn section_for(&self, block_pos: &BlockPos) -> &ChunkSection { - &self.sections[block_pos.y % 16] - } - - pub fn write_to_file(&self, output_file: &mut File) { - let serialized = serde_json::to_string(self).unwrap(); - } - - pub fn read_from_file(chunk_file: &File) -> Self { - unimplemented!() - } -} - -// https://wiki.vg/Chunk_Format -#[derive(Clone, Copy, Serialize, Deserialize, Debug)] -pub struct ChunkSection { - /// The number of non-empty blocks in the section. If completely full, the - /// section contains a 16 x 16 x 16 cube of blocks = 4096 blocks - /// If the section is empty, this is skipped - block_count: u16, - /// The data for all the blocks in the chunk - /// The representation for this may be different based on the number of - /// non-empty blocks - #[serde(with = "serde_arrays")] - block_states: [BlockID; 16 * 16 * 16], -} - -// impl Debug for ChunkSection { -// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { -// write!(f, "ChunkSection {{ blocks: {}, states: ", self.block_count)?; -// if self.block_count > 0 { -// write!(f, "{:?}", self.block_states)?; -// } -// write!(f, " }}") -// } -// } - -impl ChunkSection { - pub fn new() -> Self { - ChunkSection { - block_count: 0, - block_states: [BlockID::Empty; 16 * 16 * 16], - } - } - - pub fn index_of_block(&self, pos: &BlockPos) -> usize { - let base_x = pos.x.rem_euclid(16) as usize; - let base_y = pos.y.rem_euclid(16) as usize; - let base_z = pos.z.rem_euclid(16) as usize; - - (base_y * SLICE_SIZE) + (base_z * 16) + base_x - } - - pub fn update_block_at_index(&mut self, id: &BlockID, index: usize) { - let existing_block = &self.block_states[index]; - match existing_block { - BlockID::Empty => match id { - BlockID::Generic => { - // If the existing block is empty, and the block that we - // are inserting is non-empty, increment the number of blocks - self.block_count += 1; - } - _ => {} - }, - _ => match id { - BlockID::Empty => { - // If the existing block is non-empty, and the block that - // we are inserting is empty, then decrement the number of - // blocks - self.block_count -= 1; - } - _ => {} - }, - } - - self.block_states[index] = id.clone(); - } - - pub fn get_block_at_index(&self, pos: &BlockPos) -> &BlockID { - let array_index = self.index_of_block(pos); - - &self.block_states[array_index] - } -} - -/// `BlockPos` represents the location of a block in world space -#[derive(Debug, Clone, PartialEq)] -pub struct BlockPos { - pub x: isize, - pub y: usize, - pub z: isize, -} - -impl BlockPos { - pub fn new(x: isize, y: usize, z: isize) -> Self { - BlockPos { x, y, z } - } -} - -/// BlockRange represents a range of blocks that have been updated -#[derive(Debug)] -pub struct BlockRange { - pub start: BlockPos, - pub end: BlockPos, -} - -impl BlockRange { - pub fn new(start: &BlockPos, end: &BlockPos) -> Self { - BlockRange { - start: start.clone(), - end: end.clone(), - } - } - pub fn within_range(&self, pos: &BlockPos) -> bool { - let minx = min(self.start.x, self.end.x); - let maxx = max(self.start.x, self.end.x); - - if pos.x < minx || pos.x > maxx { - return false; - } - - let miny = min(self.start.y, self.end.y); - let maxy = max(self.start.y, self.end.y); - - if pos.y < miny || pos.y > maxy { - return false; - } - - let minz = min(self.start.z, self.end.z); - let maxz = max(self.start.z, self.end.z); - - if pos.z < minz || pos.z > maxz { - return false; - } - - true - } -} - -/// BlockID represents the type of block stored -#[repr(u8)] -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] -pub enum BlockID { - Empty, - Generic, -} diff --git a/src/storage_server.rs b/src/storage_server.rs deleted file mode 100644 index 233e321..0000000 --- a/src/storage_server.rs +++ /dev/null @@ -1,23 +0,0 @@ -use crate::storage::world::{BlockID, BlockPos}; -use axum::{routing::get, Router}; - -pub trait StorageServer { - /// `change_block` changes the block at the world position given by `world_position` to the - /// target block id `BlockID` - fn change_block(&mut self, target_state: BlockID, world_position: &BlockPos); - fn change_block_range(&mut self, target_stage: BlockID, start: &BlockPos, end: &BlockPos); - - /// `read_block_at` returns the id of the block at the location specified - /// If no block is present, the returned id will be of the empty type - fn read_block_at(&mut self, pos: &BlockPos) -> BlockID; -} - -#[tokio::main] -pub async fn main() { - let app = Router::new().route("/", get(|| async { "Hello World" })); - - axum::Server::bind(&"0.0.0.0:5000".parse().unwrap()) - .serve(app.into_make_service()) - .await - .unwrap(); -} diff --git a/src/tests/insert_one.rs b/src/tests/insert_one.rs deleted file mode 100644 index 7907ac6..0000000 --- a/src/tests/insert_one.rs +++ /dev/null @@ -1,108 +0,0 @@ -use crate::simple_server::server::SimpleServer; -use crate::storage::world::{BlockPos, BlockRange}; - -#[cfg(test)] -mod tests { - use crate::{storage::world::BlockID, storage_server::StorageServer}; - - use super::*; - #[test] - fn within_two_dimensions() { - // Get two points on the same z axis - let first = BlockPos::new(0, 0, 0); - let second = BlockPos::new(4, 4, 0); - - let range = BlockRange::new(&first, &second); - - let test1 = BlockPos::new(1, 1, 0); - let test2 = BlockPos::new(0, 0, 0); - let test3 = BlockPos::new(0, 4, 0); - let test4 = BlockPos::new(4, 4, 0); - let test5 = BlockPos::new(4, 0, 0); - - assert!(range.within_range(&test1)); - assert!(range.within_range(&test2)); - assert!(range.within_range(&test3)); - assert!(range.within_range(&test4)); - assert!(range.within_range(&test5)); - - let test6 = BlockPos::new(-1, 0, 0); - - assert!(!range.within_range(&test6)); - } - - #[test] - fn test_simple_insert() { - let mut server = SimpleServer::new(); - - server.change_block(BlockID::Generic, &BlockPos::new(0, 0, 0)); - - // Make sure the server only creates one chunk - assert_eq!(server.num_chunks(), 1); - - // Retrieve one value - assert_eq!( - server.read_block_at(&BlockPos::new(0, 0, 0)), - BlockID::Generic - ); - - // Retrieve an empty value in the current chunk - assert_eq!( - server.read_block_at(&BlockPos::new(1, 1, 1)), - BlockID::Empty - ); - - // Retrieve a value in an empty chunk - assert_eq!( - server.read_block_at(&BlockPos::new(32, 32, 32)), - BlockID::Empty - ); - - // Make sure a chunk was not created on that read - assert_eq!(server.num_chunks(), 1); - } - - #[test] - fn test_remove_one_block() { - let mut server = SimpleServer::new(); - - let pos = BlockPos::new(0, 0, 0); - - server.change_block(BlockID::Generic, &pos); - - assert_eq!(server.num_chunks(), 1); - - assert_eq!(server.read_block_at(&pos), BlockID::Generic); - - server.change_block(BlockID::Empty, &pos); - - assert_eq!(server.read_block_at(&pos), BlockID::Empty); - } - - #[test] - fn test_insert_some_blocks() { - let mut server = SimpleServer::new(); - - let blocks = [ - BlockPos::new(0, 2, 0), - BlockPos::new(0, 2, 1), - BlockPos::new(0, 2, -1), - BlockPos::new(1, 2, 0), - BlockPos::new(-1, 2, 0), - BlockPos::new(0, 3, 0), - BlockPos::new(0, 0, 0), - ]; - - for pos in blocks.iter() { - server.change_block(BlockID::Generic, pos); - } - - assert_eq!(server.num_chunks(), 1); - - for pos in blocks.iter() { - let read = server.read_block_at(pos); - println!("Pos: {:?}, {:?}", pos, read); - assert_eq!(read, BlockID::Generic); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e418d65..0000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod insert_one; -mod performance_testing; diff --git a/src/tests/performance_testing.rs b/src/tests/performance_testing.rs deleted file mode 100644 index 327496a..0000000 --- a/src/tests/performance_testing.rs +++ /dev/null @@ -1,154 +0,0 @@ -extern crate test; - -#[cfg(test)] -mod tests { - use super::*; - use crate::{ - simple_server::server::SimpleServer, - storage::world::{BlockID, BlockPos}, - storage_server::StorageServer, - }; - use rand::prelude::*; - use test::Bencher; - - #[bench] - fn bench_add_sequential_elements(b: &mut Bencher) { - let mut server = SimpleServer::new(); - let mut x = 0; - - b.iter(|| { - server.change_block(BlockID::Generic, &BlockPos::new(x, 0, 0)); - x += 1; - }); - } - - #[bench] - fn bench_add_clustered_points(b: &mut Bencher) { - let mut server = SimpleServer::new(); - - let mut rng = rand::thread_rng(); - - static MAX_RANGE: isize = 128; - - b.iter(|| { - let x: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - - server.change_block(BlockID::Generic, &BlockPos::new(x, y, z)); - }); - } - - #[bench] - fn bench_add_spread_out_points(b: &mut Bencher) { - let mut server = SimpleServer::new(); - - let mut rng = rand::thread_rng(); - - static MAX_RANGE: isize = 65536; - - b.iter(|| { - let x: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - - server.change_block(BlockID::Generic, &BlockPos::new(x, y, z)); - }); - } - - #[bench] - fn bench_insert_and_read_clustered(b: &mut Bencher) { - let mut server = SimpleServer::new(); - let mut rng = rand::thread_rng(); - - static NUM_BLOCKS: usize = 1_000; - static MAX_RANGE: isize = 128; - - let mut positions = Vec::with_capacity(NUM_BLOCKS); - - for _ in 0..NUM_BLOCKS { - let x: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - - let pos = BlockPos::new(x, y, z); - - server.change_block(BlockID::Generic, &BlockPos::new(x, y, z)); - - positions.push(pos); - } - - b.iter(|| { - for i in 0..NUM_BLOCKS { - assert_eq!(server.read_block_at(&positions[i]), BlockID::Generic); - } - }); - } - - #[bench] - fn bench_insert_and_read_cache(b: &mut Bencher) { - let mut server = SimpleServer::new(); - let mut rng = rand::thread_rng(); - - static NUM_BLOCKS: usize = 1_000; - static MAX_RANGE: isize = 128; - static EXPANDED_RANGE: isize = 2048; - - let mut positions = Vec::with_capacity(NUM_BLOCKS); - - for _ in 0..NUM_BLOCKS { - let x: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - - let pos = BlockPos::new(x, y, z); - - server.change_block(BlockID::Generic, &BlockPos::new(x, y, z)); - - positions.push(pos); - } - - b.iter(|| { - // Read blocks that are already in the server - for i in 0..NUM_BLOCKS { - assert_eq!(server.read_block_at(&positions[i]), BlockID::Generic); - } - - // Read blocks that might not be in the server, triggering a miss - for _ in 0..NUM_BLOCKS { - let x: isize = rng.gen_range(-EXPANDED_RANGE..EXPANDED_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-EXPANDED_RANGE..EXPANDED_RANGE); - server.read_block_at(&BlockPos::new(x, y, z)); - } - }); - } - - #[bench] - fn bench_clustered_many_misses(b: &mut Bencher) { - let mut server = SimpleServer::new(); - let mut rng = rand::thread_rng(); - - static NUM_BLOCKS: usize = 1_000; - static MAX_RANGE: isize = 128; - static EXPANDED_RANGE: isize = 2048; - - for _ in 0..NUM_BLOCKS { - let x: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-MAX_RANGE..MAX_RANGE); - - server.change_block(BlockID::Generic, &BlockPos::new(x, y, z)); - } - - b.iter(|| { - // Read blocks that might not be in the server, triggering a miss - for _ in 0..NUM_BLOCKS { - let x: isize = rng.gen_range(-EXPANDED_RANGE..EXPANDED_RANGE); - let y: usize = rng.gen::() as usize; - let z: isize = rng.gen_range(-EXPANDED_RANGE..EXPANDED_RANGE); - server.read_block_at(&BlockPos::new(x, y, z)); - } - }); - } -}