diff --git a/frameworks/Rust/hyperlane/.gitignore b/frameworks/Rust/hyperlane/.gitignore new file mode 100644 index 00000000000..af8e65c2e7a --- /dev/null +++ b/frameworks/Rust/hyperlane/.gitignore @@ -0,0 +1,3 @@ +/target +/logs +Cargo.lock \ No newline at end of file diff --git a/frameworks/Rust/hyperlane/Cargo.lock b/frameworks/Rust/hyperlane/Cargo.lock deleted file mode 100644 index 8d66da54a3c..00000000000 --- a/frameworks/Rust/hyperlane/Cargo.lock +++ /dev/null @@ -1,1795 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy 0.7.35", -] - -[[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 = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "async-func" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8882ceb09bc57f9b7a52d48cffab866310aeeb6a5aa1c9420640e7689660c9ee" -dependencies = [ - "tokio", -] - -[[package]] -name = "async-trait" -version = "0.1.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bb8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d8b8e1a22743d9241575c6ba822cf9c8fef34771c86ab7e477a4fbfd254e5" -dependencies = [ - "futures-util", - "parking_lot", - "tokio", -] - -[[package]] -name = "bb8-postgres" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e570e6557cd0f88d28d32afa76644873271a70dc22656df565b2021c4036aa9c" -dependencies = [ - "bb8", - "tokio", - "tokio-postgres", -] - -[[package]] -name = "bitflags" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[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 = "brotli" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" - -[[package]] -name = "cc" -version = "1.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" -dependencies = [ - "shlex", -] - -[[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.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-link", -] - -[[package]] -name = "clonelicious" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c61986b9f0347d401ef41468e7aadba2ab6dfc2547df1862f2563250fbfa8d3" - -[[package]] -name = "color-output" -version = "6.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc537d9d2e7e15fa40da2a6a451afedea17808a63f8339863e3a6b5ae93db596" -dependencies = [ - "hyperlane-time", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[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 = "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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "file-operation" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaba2fa080e689c4ec9a0666c5b7eb074182fdba13a34e97b19b56ac2a855556" -dependencies = [ - "tokio", -] - -[[package]] -name = "flate2" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "float-cmp" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" -dependencies = [ - "num-traits", -] - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "halfbrown" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" -dependencies = [ - "hashbrown", - "serde", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[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-compress" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8646f4e10f8fc48d8f2a595e6ef303189e49e386d6863d771f028c969f0c5e42" -dependencies = [ - "brotli", - "flate2", - "http-constant", -] - -[[package]] -name = "http-constant" -version = "1.33.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3567340a02df4ec03fa5475e2b273aa183d875b3bf09674403407aadda1cd1" - -[[package]] -name = "http-type" -version = "3.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f21786d19bad67be1eb85b528e65722d44812d6e9bed878147f767573a2586" -dependencies = [ - "hex", - "http-compress", - "http-constant", - "lombok-macros", - "serde", - "serde-xml-rs", - "serde_json", - "serde_urlencoded", - "tokio", - "url", -] - -[[package]] -name = "hyperlane" -version = "4.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74319ece1df44e8ddd62a9e1ae13040ba34fd1500eb240fa449ca8fbc7210727" -dependencies = [ - "async-func", - "clonelicious", - "color-output", - "file-operation", - "futures", - "http-compress", - "http-type", - "hyperlane-log", - "lombok-macros", - "once_cell", - "recoverable-spawn", - "recoverable-thread-pool", - "serde", - "serde_json", - "server-manager", - "simd-json", - "std-macro-extensions", - "tokio", -] - -[[package]] -name = "hyperlane-log" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf652414e2c385beb37c36341ae91f6eb686062f3cfff6c0cff8526deafbb65" -dependencies = [ - "file-operation", - "hyperlane-time", - "lombok-macros", - "once_cell", - "recoverable-spawn", -] - -[[package]] -name = "hyperlane-time" -version = "0.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11dcc4ca08d1ebfc1f70e7a40033483219f77909a7ef6c4af302a14aa97da3d2" - -[[package]] -name = "hyperlane_techempower" -version = "0.0.1" -dependencies = [ - "bb8", - "bb8-postgres", - "chrono", - "hyperlane", - "rand", - "serde", - "tokio-postgres", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "libc" -version = "0.2.170" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" - -[[package]] -name = "litemap" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" - -[[package]] -name = "lombok-macros" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe4fc0110b8bdb29b2423a2be59fa7b9b3e0e1b225553514895564420887bc5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "postgres-protocol" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54" -dependencies = [ - "base64", - "byteorder", - "bytes", - "fallible-iterator", - "hmac", - "md-5", - "memchr", - "rand", - "sha2", - "stringprep", -] - -[[package]] -name = "postgres-types" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48" -dependencies = [ - "bytes", - "fallible-iterator", - "postgres-protocol", - "uuid", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy 0.8.23", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" -dependencies = [ - "rand_chacha", - "rand_core", - "zerocopy 0.8.23", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom 0.3.1", -] - -[[package]] -name = "recoverable-spawn" -version = "3.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5081593fb6a36af3e9ca8c4f23735f9d454a252cba0629509baa3947983846d" -dependencies = [ - "once_cell", - "tokio", -] - -[[package]] -name = "recoverable-thread-pool" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4190261c8a4823ceaf4b9cd68bf28deca98aa5697d2e1ec66e8053dac2a817fa" -dependencies = [ - "lombok-macros", - "recoverable-spawn", -] - -[[package]] -name = "redox_syscall" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" -dependencies = [ - "bitflags", -] - -[[package]] -name = "ref-cast" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-xml-rs" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3aa78ecda1ebc9ec9847d5d3aba7d618823446a049ba2491940506da6e2782" -dependencies = [ - "log", - "serde", - "thiserror", - "xml-rs", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.140" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "itoa", - "memchr", - "ryu", - "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 = "server-manager" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5144bc130554928fb304af2e7590742db173a40f82672613dc293f7567e8730e" -dependencies = [ - "tokio", -] - -[[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 = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "simd-json" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" -dependencies = [ - "getrandom 0.2.15", - "halfbrown", - "ref-cast", - "serde", - "serde_json", - "simdutf8", - "value-trait", -] - -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[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.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" - -[[package]] -name = "socket2" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "std-macro-extensions" -version = "0.21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b44c771c1591df90e3b49f618362dc1c431a8df6a7a6cc69dbe00757b158522" - -[[package]] -name = "stringprep" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" -dependencies = [ - "unicode-bidi", - "unicode-normalization", - "unicode-properties", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-postgres" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0" -dependencies = [ - "async-trait", - "byteorder", - "bytes", - "fallible-iterator", - "futures-channel", - "futures-util", - "log", - "parking_lot", - "percent-encoding", - "phf", - "pin-project-lite", - "postgres-protocol", - "postgres-types", - "rand", - "socket2", - "tokio", - "tokio-util", - "whoami", -] - -[[package]] -name = "tokio-util" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "unicode-bidi" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-properties" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" - -[[package]] -name = "url" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - -[[package]] -name = "value-trait" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9170e001f458781e92711d2ad666110f153e4e50bfd5cbd02db6547625714187" -dependencies = [ - "float-cmp", - "halfbrown", - "itoa", - "ryu", -] - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "whoami" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" -dependencies = [ - "redox_syscall", - "wasite", - "web-sys", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-link" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "wit-bindgen-rt" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "xml-rs" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" -dependencies = [ - "zerocopy-derive 0.8.23", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/frameworks/Rust/hyperlane/Cargo.toml b/frameworks/Rust/hyperlane/Cargo.toml index cb0eccc2e0b..8b909a01df4 100644 --- a/frameworks/Rust/hyperlane/Cargo.toml +++ b/frameworks/Rust/hyperlane/Cargo.toml @@ -18,13 +18,10 @@ exclude = [ ] [dependencies] -hyperlane = "4.31.1" -bb8 = "0.9.0" -bb8-postgres = "0.9.0" +hyperlane = "4.36.1" rand = "0.9.0" -tokio-postgres = { version = "0.7.13", features = ["with-uuid-0_8"] } -chrono = "0.4.40" serde = "1.0.219" +sqlx = { version = "0.8.3", features = ["runtime-tokio", "postgres"] } [profile.dev] incremental = false @@ -43,3 +40,6 @@ panic = "unwind" debug = false codegen-units = 1 strip = "debuginfo" + +[features] +dev = [] diff --git a/frameworks/Rust/hyperlane/README.md b/frameworks/Rust/hyperlane/README.md index 96bf0620a7e..20ab5eec3c4 100644 --- a/frameworks/Rust/hyperlane/README.md +++ b/frameworks/Rust/hyperlane/README.md @@ -6,7 +6,7 @@ Hyperlane is a lightweight and high-performance Rust HTTP server library designe ## Database -PostgreSQL +PostgreSQL. ## Test URLs @@ -20,8 +20,20 @@ PostgreSQL ### Test 3: Multi Row Query - http://localhost:8080/queries?q=20 + http://localhost:8080/query?q=20 -### Test 4: Plaintext +### Test 4: Fortunes (Template rendering) + + http://localhost:8080/fortunes + +### Test 5: Update Query + + http://localhost:8080/upda?q=20 + +### Test 6: Plaintext http://localhost:8080/plaintext + +### Test 7: Caching + + http://localhost:8080/cached-quer?c=20 diff --git a/frameworks/Rust/hyperlane/benchmark_config.json b/frameworks/Rust/hyperlane/benchmark_config.json index b52090969ec..1f810752e18 100644 --- a/frameworks/Rust/hyperlane/benchmark_config.json +++ b/frameworks/Rust/hyperlane/benchmark_config.json @@ -6,11 +6,14 @@ "dockerfile": "hyperlane.dockerfile", "json_url": "/json", "plaintext_url": "/plaintext", + "fortune_url": "/fortunes", "db_url": "/db", - "query_url": "/queries?q=", + "query_url": "/query?q=", + "update_url": "/upda?q=", + "cached_query_url": "/cached-quer?c=", "port": 8080, "approach": "Realistic", - "classification": "Micro", + "classification": "Platform", "database": "Postgres", "framework": "hyperlane", "language": "Rust", diff --git a/frameworks/Rust/hyperlane/src/constant.rs b/frameworks/Rust/hyperlane/src/constant.rs index adc58ac641e..e22ac57c0b0 100644 --- a/frameworks/Rust/hyperlane/src/constant.rs +++ b/frameworks/Rust/hyperlane/src/constant.rs @@ -3,8 +3,13 @@ pub static DATABASE_TYPE: &str = "postgres"; pub static DATABASE_HOST: &str = "tfb-database"; pub static DATABASE_USER_NAME: &str = "benchmarkdbuser"; pub static DATABASE_USER_PASSWORD: &str = "benchmarkdbpass"; -pub static DATABASE_PORT: usize = 5432; +pub static DATABASE_PORT: usize = 5_432; pub static DATABASE_NAME: &str = "hello_world"; -pub static TABLE_NAME: &str = "World"; +pub static TABLE_NAME_WORLD: &str = "World"; +pub static TABLE_NAME_FORTUNE: &str = "Fortune"; pub static ROW_LIMIT: i32 = 500; -pub static HYPERLANE: &str = "hyperlane"; +pub static RANDOM_MAX: i32 = 10_000; +pub static RANDOM_MAX_ADD_ONE: u32 = 10_001; +pub static KEY_ID: &str = "id"; +pub static KEY_RANDOM_NUMBER: &str = "randomnumber"; +pub static KEY_MESSAGE: &str = "message"; diff --git a/frameworks/Rust/hyperlane/src/db.rs b/frameworks/Rust/hyperlane/src/db.rs index 81120b548bb..d1d51e8ee11 100644 --- a/frameworks/Rust/hyperlane/src/db.rs +++ b/frameworks/Rust/hyperlane/src/db.rs @@ -1,92 +1,108 @@ use crate::*; +#[inline] pub async fn get_db_connection() -> DbPoolConnection { - let db_pool: DbPoolConnection = DB.read().await.clone().unwrap(); + if let Some(db_pool) = DB.read().await.clone() { + return db_pool; + }; + let db_pool: DbPoolConnection = connection_db().await; + { + let mut db_pool_lock: RwLockWriteGuard<'_, Option> = DB.write().await; + *db_pool_lock = Some(db_pool.clone()); + } db_pool } +#[inline] +#[cfg(feature = "dev")] pub async fn create_batabase() { let db_pool: DbPoolConnection = get_db_connection().await; - let connection: DbConnection = db_pool.get().await.unwrap(); - let db_exists: bool = connection - .query_one( - "SELECT EXISTS(SELECT 1 FROM pg_database WHERE datname = $1);", - &[&DATABASE_NAME], - ) - .await - .unwrap() - .get(0); - if !db_exists { - println_warning!( - "database `", - DATABASE_NAME, - "` not found. Creating database..." - ); - connection - .batch_execute(&format!("CREATE DATABASE {};", DATABASE_NAME)) - .await - .unwrap(); - println_success!("database `", DATABASE_NAME, "` created successfully"); - } - println_success!("database `", DATABASE_NAME, "` ready"); + let _ = query(&format!("CREATE DATABASE {};", DATABASE_NAME)) + .execute(&db_pool) + .await; } +#[inline] +#[cfg(feature = "dev")] pub async fn create_table() { let db_pool: DbPoolConnection = get_db_connection().await; - let connection: DbConnection = db_pool.get().await.unwrap(); - connection - .batch_execute(&format!( - "CREATE TABLE IF NOT EXISTS {} ( - id SERIAL PRIMARY KEY, - randomNumber INTEGER NOT NULL - );", - TABLE_NAME - )) - .await - .unwrap(); - println_success!("table `", TABLE_NAME, "` ready"); + let _ = query(&format!( + "CREATE TABLE IF NOT EXISTS {} ( + id SERIAL PRIMARY KEY, randomNumber INT NOT NULL + );", + TABLE_NAME_WORLD + )) + .execute(&db_pool) + .await; + let _ = query(&format!( + "CREATE TABLE IF NOT EXISTS {} ( + id SERIAL PRIMARY KEY, message VARCHAR NOT NULL + );", + TABLE_NAME_FORTUNE + )) + .execute(&db_pool) + .await; } +#[inline] +#[cfg(feature = "dev")] pub async fn insert_records() { let db_pool: DbPoolConnection = get_db_connection().await; - let connection: DbConnection = db_pool.get().await.unwrap(); - let row: Row = connection - .query_one(&format!("SELECT COUNT(*) FROM {}", TABLE_NAME), &[]) + let row: PgRow = query(&format!("SELECT COUNT(*) FROM {}", TABLE_NAME_WORLD)) + .fetch_one(&db_pool) .await .unwrap(); let count: i64 = row.get(0); - let limit: i64 = ROW_LIMIT as i64; + let limit: i64 = RANDOM_MAX as i64; if count >= limit { - println_warning!(format!( - "table '{}' already has {} records. No need to insert.", - TABLE_NAME, count - )); return; } let missing_count: i64 = limit - count; - println_warning!(format!( - "table '{}' has {} records. Inserting {} missing records...", - TABLE_NAME, count, missing_count - )); - let mut rng: rand::prelude::ThreadRng = rand::rng(); let mut values: Vec = Vec::new(); for _ in 0..missing_count { - let random_number: i32 = rng.random_range(1..=10000); + let random_number: i32 = get_random_id(); values.push(format!("(DEFAULT, {})", random_number)); } - let query: String = format!( + let sql: String = format!( "INSERT INTO {} (id, randomNumber) VALUES {}", - TABLE_NAME, + TABLE_NAME_WORLD, values.join(",") ); - connection.batch_execute(&query).await.unwrap(); - println_success!(format!( - "successfully inserted {} missing records into '{}' table.", - TABLE_NAME, missing_count - )); + let _ = query(&sql).execute(&db_pool).await; + let mut values: Vec = Vec::new(); + for _ in 0..missing_count { + let random_number: i32 = get_random_id(); + values.push(format!("(DEFAULT, {})", random_number)); + } + let sql: String = format!( + "INSERT INTO {} (id, message) VALUES {}", + TABLE_NAME_FORTUNE, + values.join(",") + ); + let _ = query(&sql).execute(&db_pool).await; } -pub async fn init_db() { +#[inline] +pub async fn init_cache() { + let mut res: Vec = Vec::with_capacity(RANDOM_MAX as usize); + let db_pool: DbPoolConnection = get_db_connection().await; + let sql: String = format!( + "SELECT id, randomNumber FROM {} LIMIT {}", + TABLE_NAME_WORLD, RANDOM_MAX + ); + if let Ok(rows) = query(&sql).fetch_all(&db_pool).await { + for row in rows { + let id: i32 = row.get(KEY_ID); + let random_number: i32 = row.get(KEY_RANDOM_NUMBER); + res.push(QueryRow::new(id, random_number)); + } + } + let mut cache: RwLockWriteGuard<'_, Vec> = CACHE.write().await; + *cache = res; +} + +#[inline] +pub async fn connection_db() -> DbPoolConnection { let db_url: &str = match option_env!("POSTGRES_URL") { Some(it) => it, _ => &format!( @@ -99,37 +115,123 @@ pub async fn init_db() { DATABASE_NAME ), }; - println_warning!("db url: ", db_url); - let config: Config = db_url.parse::().unwrap(); - let db_manager: PostgresConnectionManager = - PostgresConnectionManager::new(config, NoTls); - let db_pool: DbPoolConnection = Pool::builder().build(db_manager).await.unwrap(); + let pool_size: u32 = (get_thread_count() >> 2).max(10).min(100) as u32; + let max_pool_size: u32 = option_env!("POSTGRES_MAX_POOL_SIZE") + .unwrap_or(&pool_size.to_string()) + .parse::() + .unwrap_or(pool_size); + let min_pool_size: u32 = option_env!("POSTGRES_MIN_POOL_SIZE") + .unwrap_or(&pool_size.to_string()) + .parse::() + .unwrap_or(pool_size); + let pool: DbPoolConnection = PgPoolOptions::new() + .max_connections(max_pool_size) + .min_connections(min_pool_size) + .max_lifetime(None) + .test_before_acquire(false) + .idle_timeout(None) + .connect(db_url) + .await + .unwrap(); + pool +} + +#[inline] +pub async fn get_update_data( + limit: Queries, +) -> (String, Vec, Vec, Vec) { + let db_pool: DbPoolConnection = get_db_connection().await; + let mut query_res_list: Vec = Vec::with_capacity(limit as usize); + let rows: Vec = get_some_row_id(limit, &db_pool).await; + let mut sql = format!("UPDATE {} SET randomNumber = CASE id ", TABLE_NAME_WORLD); + let mut id_list: Vec = Vec::with_capacity(rows.len()); + let mut value_list: Vec = Vec::with_capacity(rows.len() * 2); + let mut random_numbers: Vec = Vec::with_capacity(rows.len()); + for (i, row) in rows.iter().enumerate() { + let new_random_number: i32 = get_random_id() as i32; + id_list.push(row.id); + random_numbers.push(new_random_number); + value_list.push(format!("WHEN ${} THEN ${}", i * 2 + 1, i * 2 + 2)); + query_res_list.push(QueryRow::new(row.id, new_random_number)); + } + sql.push_str(&value_list.join(" ")); + let id_params: String = id_list + .iter() + .enumerate() + .map(|(i, _)| format!("${}", (rows.len() * 2 + 1) + i)) + .collect::>() + .join(","); + sql.push_str(&format!( + " ELSE randomNumber END WHERE id IN ({})", + id_params + )); + (sql, query_res_list, id_list, random_numbers) +} + +#[inline] +pub async fn init_db() { { let mut db_pool_lock: RwLockWriteGuard<'_, Option> = DB.write().await; - *db_pool_lock = Some(db_pool.clone()); + *db_pool_lock = Some(connection_db().await); + } + #[cfg(feature = "dev")] + { + create_batabase().await; + create_table().await; + insert_records().await; } - create_batabase().await; - create_table().await; - insert_records().await; + init_cache().await; +} + +#[inline] +pub async fn random_world_row(db_pool: &DbPoolConnection) -> QueryRow { + let random_id: Queries = get_random_id(); + query_world_row(db_pool, random_id).await } -pub async fn random_world_row() -> Result> { - let random_id: i32 = rand::rng().random_range(1..ROW_LIMIT); +#[inline] +pub async fn query_world_row(db_pool: &DbPoolConnection, id: Queries) -> QueryRow { + let sql: String = format!( + "SELECT id, randomNumber FROM {} WHERE id = {} LIMIT 1", + TABLE_NAME_WORLD, id + ); + if let Ok(rows) = query(&sql).fetch_one(db_pool).await { + let random_number: i32 = rows.get(KEY_RANDOM_NUMBER); + return QueryRow::new(id as i32, random_number); + } + return QueryRow::new(id as i32, 1); +} + +#[inline] +pub async fn update_world_rows(limit: Queries) -> Vec { let db_pool: DbPoolConnection = get_db_connection().await; - let connection: DbConnection = db_pool - .get() - .await - .map_err(|e| io::Error::new(io::ErrorKind::Other, format!("timeout: {}", e)))?; - let stmt: Statement = connection - .prepare(&format!( - "SELECT id, randomNumber FROM {} WHERE id = $1", - TABLE_NAME - )) - .await?; - if let Some(rows) = connection.query_opt(&stmt, &[&random_id]).await? { - let id: i32 = rows.get(0); - let random_number: i32 = rows.get(1); - return Ok(QueryRow::new(id, random_number)); + let (sql, data, id_list, random_numbers) = get_update_data(limit).await; + let mut query_builder: query::Query<'_, Postgres, postgres::PgArguments> = query(&sql); + for (id, random_number) in id_list.iter().zip(random_numbers.iter()) { + query_builder = query_builder.bind(id).bind(random_number); + } + for id in &id_list { + query_builder = query_builder.bind(id); + } + let _ = query_builder.execute(&db_pool).await; + data +} + +#[inline] +pub async fn all_world_row() -> Vec { + let db_pool: DbPoolConnection = get_db_connection().await; + let sql: String = format!("SELECT id, message FROM {}", TABLE_NAME_FORTUNE); + let res: Vec = query(&sql).fetch_all(&db_pool).await.unwrap_or_default(); + return res; +} + +#[inline] +pub async fn get_some_row_id(limit: Queries, db_pool: &DbPoolConnection) -> Vec { + let mut res: Vec = Vec::with_capacity(limit as usize); + for _ in 0..limit { + let id: i32 = get_random_id(); + let tem: QueryRow = query_world_row(db_pool, id).await; + res.push(tem); } - return Ok(QueryRow::new(0, 0)); + res } diff --git a/frameworks/Rust/hyperlane/src/lazy.rs b/frameworks/Rust/hyperlane/src/lazy.rs index 5b701e371bd..6826b018008 100644 --- a/frameworks/Rust/hyperlane/src/lazy.rs +++ b/frameworks/Rust/hyperlane/src/lazy.rs @@ -2,3 +2,4 @@ use crate::*; pub static DB: Lazy>> = Lazy::new(|| Arc::new(RwLock::new(None))); +pub static CACHE: Lazy>> = Lazy::new(|| arc_rwlock(vec![])); diff --git a/frameworks/Rust/hyperlane/src/main.rs b/frameworks/Rust/hyperlane/src/main.rs index d0145b343da..ef4a7838faa 100644 --- a/frameworks/Rust/hyperlane/src/main.rs +++ b/frameworks/Rust/hyperlane/src/main.rs @@ -8,36 +8,31 @@ pub(crate) mod server; pub(crate) mod r#type; pub(crate) mod utils; -pub(crate) use bb8::{Pool, PooledConnection}; -pub(crate) use bb8_postgres::PostgresConnectionManager; -pub(crate) use chrono::{DateTime, Utc}; pub(crate) use constant::*; pub(crate) use db::*; pub(crate) use hyperlane::{ once_cell::sync::Lazy, serde::*, serde_json::json, - tokio::sync::{RwLock, RwLockWriteGuard}, + tokio::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard}, *, }; pub(crate) use lazy::*; pub(crate) use r#type::*; -pub(crate) use rand::Rng; +pub(crate) use rand::{rngs::SmallRng, Rng, SeedableRng}; pub(crate) use request_middleware::*; pub(crate) use response_middleware::*; pub(crate) use route::*; - pub(crate) use server::*; -pub(crate) use std::time::SystemTime; -pub(crate) use std::{io, sync::Arc}; -pub(crate) use tokio_postgres::{Config, NoTls, Row, Statement}; +pub(crate) use sqlx::{ + postgres::{PgPoolOptions, PgRow}, + *, +}; +pub(crate) use std::{fmt, sync::Arc}; pub(crate) use utils::*; #[tokio::main] async fn main() { - println_warning!("start connect db"); init_db().await; - println_success!("connect db finish"); - println_warning!("start init server"); run_server().await; } diff --git a/frameworks/Rust/hyperlane/src/request_middleware.rs b/frameworks/Rust/hyperlane/src/request_middleware.rs index b1ffc0fd2fa..fe810b0a1d5 100644 --- a/frameworks/Rust/hyperlane/src/request_middleware.rs +++ b/frameworks/Rust/hyperlane/src/request_middleware.rs @@ -1,17 +1,15 @@ use crate::*; +#[inline] pub async fn request(controller_data: ControllerData) { let _ = controller_data .set_response_header(CONNECTION, CONNECTION_KEEP_ALIVE) .await - .set_response_header( - CONTENT_TYPE, - format!("{}; {}", APPLICATION_JSON, CHARSET_UTF_8), - ) + .set_response_header(CONTENT_TYPE, APPLICATION_JSON) .await .set_response_header(SERVER, HYPERLANE) .await - .set_response_header(DATE, generate_rfc1123_timestamp()) + .set_response_header(DATE, current_date_gmt()) .await .set_response_status_code(200) .await; diff --git a/frameworks/Rust/hyperlane/src/response_middleware.rs b/frameworks/Rust/hyperlane/src/response_middleware.rs index 81fb0c368e9..dcf3b096b10 100644 --- a/frameworks/Rust/hyperlane/src/response_middleware.rs +++ b/frameworks/Rust/hyperlane/src/response_middleware.rs @@ -1,5 +1,6 @@ use crate::*; +#[inline] pub async fn response(controller_data: ControllerData) { let _ = controller_data.send().await; } diff --git a/frameworks/Rust/hyperlane/src/route.rs b/frameworks/Rust/hyperlane/src/route.rs index fce11dbc1ca..e52db693195 100644 --- a/frameworks/Rust/hyperlane/src/route.rs +++ b/frameworks/Rust/hyperlane/src/route.rs @@ -1,5 +1,6 @@ use crate::*; +#[inline] pub async fn json(controller_data: ControllerData) { let json: serde_json::Value = json!({ "message": RESPONSEDATA @@ -9,6 +10,7 @@ pub async fn json(controller_data: ControllerData) { .await; } +#[inline] pub async fn plaintext(controller_data: ControllerData) { let _ = controller_data .set_response_header(CONTENT_TYPE, TEXT_PLAIN) @@ -17,28 +19,89 @@ pub async fn plaintext(controller_data: ControllerData) { .await; } +#[inline] pub async fn db(controller_data: ControllerData) { - let query_row: QueryRow = random_world_row().await.unwrap(); + let db_connection: DbPoolConnection = get_db_connection().await; + let query_row: QueryRow = random_world_row(&db_connection).await; let _ = controller_data .set_response_body(serde_json::to_string(&query_row).unwrap_or_default()) .await; } +#[inline] pub async fn queries(controller_data: ControllerData) { let queries: Queries = controller_data .get_request_query("q") .await .and_then(|queries| queries.parse::().ok()) .unwrap_or_default() - .min(ROW_LIMIT as usize) + .min(ROW_LIMIT as Queries) .max(1); - let mut data: Vec = Vec::with_capacity(queries); + let mut data: Vec = Vec::with_capacity(queries as usize); + let db_pool: DbPoolConnection = get_db_connection().await; for _ in 0..queries { - let _ = random_world_row().await.map(|row| { - data.push(row); - }); + let row: QueryRow = random_world_row(&db_pool).await; + data.push(row); } let _ = controller_data .set_response_body(serde_json::to_string(&data).unwrap_or_default()) .await; } + +#[inline] +pub async fn fortunes(controller_data: ControllerData) { + let all_rows: Vec = all_world_row().await; + let mut fortunes_list: Vec = all_rows + .iter() + .map(|row| { + let id: i32 = row.get(KEY_ID); + let message: String = row.get(KEY_MESSAGE); + Fortunes::new(id, message) + }) + .collect(); + fortunes_list.push(Fortunes::new( + 0, + "Additional fortune added at request time.".to_owned(), + )); + fortunes_list.sort_by(|it, next| it.message.cmp(&next.message)); + let res: String = FortunesTemplate::new(fortunes_list).to_string(); + controller_data + .set_response_header(CONTENT_TYPE, content_type_charset(TEXT_HTML, UTF8)) + .await + .set_response_body(res) + .await; +} + +#[inline] +pub async fn updates(controller_data: ControllerData) { + let queries: Queries = controller_data + .get_request_query("q") + .await + .and_then(|queries| queries.parse::().ok()) + .unwrap_or_default() + .min(ROW_LIMIT as Queries) + .max(1); + let res: Vec = update_world_rows(queries).await; + let _ = controller_data + .set_response_body(serde_json::to_string(&res).unwrap_or_default()) + .await; +} + +#[inline] +pub async fn cached_queries(controller_data: ControllerData) { + let count: Queries = controller_data + .get_request_query("c") + .await + .and_then(|queries| queries.parse::().ok()) + .unwrap_or_default() + .min(ROW_LIMIT as Queries) + .max(1); + let mut res: Vec = Vec::with_capacity(count as usize); + let cache: RwLockReadGuard<'_, Vec> = CACHE.read().await; + for i in 0..count { + res.push(cache[i as usize].clone()); + } + let _ = controller_data + .set_response_body(serde_json::to_string(&res).unwrap_or_default()) + .await; +} diff --git a/frameworks/Rust/hyperlane/src/server.rs b/frameworks/Rust/hyperlane/src/server.rs index 7042eab442b..91dc1aeea08 100644 --- a/frameworks/Rust/hyperlane/src/server.rs +++ b/frameworks/Rust/hyperlane/src/server.rs @@ -1,18 +1,22 @@ use crate::*; +#[inline] pub async fn run_server() { let mut server: Server = Server::new(); server.host("0.0.0.0").await; server.port(8080).await; server.log_dir("./logs").await; server.log_interval_millis(1_000_000_000).await; - server.disable_print().await; + server.disable_inner_log().await; + server.disable_inner_print().await; server.route("/json", json).await; server.route("/plaintext", plaintext).await; server.route("/db", db).await; - server.route("/queries", queries).await; + server.route("/query", queries).await; + server.route("/fortunes", fortunes).await; + server.route("/upda", updates).await; + server.route("/cached-quer", cached_queries).await; server.request_middleware(request).await; server.response_middleware(response).await; - println_success!("server initialization completed"); server.listen().await; } diff --git a/frameworks/Rust/hyperlane/src/type.rs b/frameworks/Rust/hyperlane/src/type.rs index 5e524ede2e9..3fb320ba049 100644 --- a/frameworks/Rust/hyperlane/src/type.rs +++ b/frameworks/Rust/hyperlane/src/type.rs @@ -1,21 +1,61 @@ use crate::*; -pub type DbPoolConnection = bb8::Pool>; -pub type DbConnection<'a> = PooledConnection<'a, PostgresConnectionManager>; -pub type Queries = usize; +pub type DbPoolConnection = Pool; +pub type Queries = i32; #[allow(bad_style)] -#[derive(Serialize)] +#[derive(Serialize, Default, Clone)] pub struct QueryRow { - id: i32, - randomNumber: i32, + pub id: Queries, + pub randomNumber: Queries, } impl QueryRow { - pub fn new(id: i32, random_number: i32) -> Self { + #[inline] + pub fn new(id: Queries, random_number: Queries) -> Self { Self { - id: id, + id, randomNumber: random_number, } } } + +#[derive(Serialize)] +pub struct Fortunes { + pub id: Queries, + pub message: String, +} + +impl Fortunes { + #[inline] + pub fn new(id: Queries, message: String) -> Self { + Self { id, message } + } +} + +#[derive(Serialize)] +pub struct FortunesTemplate(pub Vec); + +impl FortunesTemplate { + #[inline] + pub fn new(list: Vec) -> Self { + Self(list) + } +} + +impl fmt::Display for FortunesTemplate { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let fortunes: &Vec = &self.0; + let _ = write!(f, "Fortunes"); + for tem in fortunes.iter() { + let row: String = format!( + "", + tem.id, + escape_html(&tem.message) + ); + let _ = write!(f, "{}", row); + } + let _ = write!(f, "
idmessage
{}{}
"); + Ok(()) + } +} diff --git a/frameworks/Rust/hyperlane/src/utils.rs b/frameworks/Rust/hyperlane/src/utils.rs index c189f0be8db..9552fe79074 100644 --- a/frameworks/Rust/hyperlane/src/utils.rs +++ b/frameworks/Rust/hyperlane/src/utils.rs @@ -1,6 +1,26 @@ +use rand::rng; + use crate::*; -pub fn generate_rfc1123_timestamp() -> String { - let now: DateTime = SystemTime::now().into(); - now.format("%a, %d %b %Y %H:%M:%S GMT").to_string() +#[inline] +pub fn escape_html(input: &str) -> String { + let mut result: String = String::new(); + for ch in input.chars() { + match ch { + '<' => result.push_str("<"), + '>' => result.push_str(">"), + '&' => result.push_str("&"), + '"' => result.push_str("""), + '\'' => result.push_str("'"), + _ => result.push(ch), + } + } + result +} + +#[inline] +pub fn get_random_id() -> Queries { + let mut rng: SmallRng = SmallRng::from_rng(&mut rng()); + let random_id: u32 = rng.random_range(1..RANDOM_MAX_ADD_ONE); + random_id as Queries }