diff --git a/pgml-sdks/pgml/.gitignore b/pgml-sdks/pgml/.gitignore index 2d5a692e0..a20f70eac 100644 --- a/pgml-sdks/pgml/.gitignore +++ b/pgml-sdks/pgml/.gitignore @@ -167,3 +167,6 @@ cython_debug/ # local scratch pad scratch.sql scratch.py + +# Some SDK specific things +pgml.h diff --git a/pgml-sdks/pgml/Cargo.lock b/pgml-sdks/pgml/Cargo.lock index fdb5066eb..784b528a7 100644 --- a/pgml-sdks/pgml/Cargo.lock +++ b/pgml-sdks/pgml/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -32,18 +32,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -62,47 +62,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -110,19 +111,19 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -134,27 +135,17 @@ dependencies = [ "num-traits", ] -[[package]] -name = "atomic-write-file" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" -dependencies = [ - "nix", - "rand", -] - [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -191,9 +182,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -209,9 +200,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -221,18 +212,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -240,11 +228,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -252,14 +246,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] name = "clap" -version = "4.4.18" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -267,39 +261,39 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "colored" @@ -357,9 +351,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -372,9 +366,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -409,9 +403,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -450,9 +444,9 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" +checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" dependencies = [ "nix", "windows-sys 0.52.0", @@ -488,7 +482,6 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", "syn 1.0.109", ] @@ -502,8 +495,8 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.48", + "strsim", + "syn 2.0.66", ] [[package]] @@ -525,14 +518,14 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core 0.20.9", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -569,15 +562,15 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" dependencies = [ "serde", ] @@ -590,9 +583,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -605,9 +598,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -632,21 +625,15 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "finl_unicode" -version = "1.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -760,7 +747,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -805,9 +792,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -816,15 +803,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -832,7 +819,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.2", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -847,9 +834,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -861,7 +848,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -873,11 +860,17 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -914,9 +907,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -948,9 +941,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -1035,20 +1028,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] [[package]] name = "indicatif" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", "instant", @@ -1071,7 +1064,7 @@ checksum = "0122b7114117e64a63ac49f752a5ca4624d534c7b1c7de796ac196381cd2d947" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1092,9 +1085,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1107,15 +1100,21 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1136,15 +1135,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1160,9 +1159,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -1199,15 +1198,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1215,9 +1214,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lopdf" @@ -1256,9 +1255,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -1283,18 +1282,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -1304,11 +1303,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1372,12 +1370,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", + "cfg_aliases", "libc", ] @@ -1426,19 +1425,18 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -1447,9 +1445,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -1473,9 +1471,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -1488,11 +1486,11 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -1509,7 +1507,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1520,18 +1518,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.2.2+3.2.1" +version = "300.3.0+3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bbfad0063610ac26ee79f7484739e2b07555a75c42453b89263830b5c8103bc" +checksum = "eba8804a1c5765b18c4b3f907e6897ebabeedebc9830e1a0046c4a4cf44663e1" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -1548,9 +1546,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1558,22 +1556,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem-rfc7468" @@ -1631,9 +1629,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1664,9 +1662,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "portable-atomic" @@ -1688,9 +1686,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -1783,9 +1781,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1822,9 +1820,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -1849,11 +1847,20 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1863,9 +1870,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1874,15 +1881,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -1920,16 +1927,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1967,7 +1975,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1979,17 +1987,17 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1998,9 +2006,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "ring", "rustls-webpki", @@ -2028,9 +2036,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2081,12 +2089,12 @@ dependencies = [ [[package]] name = "sea-query-attr" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878cf3d57f0e5bfacd425cdaccc58b4c06d68a7b71c63fc28710a20c88676808" +checksum = "168a31e0ef5a791ad26aa97c502eaed8d2a1ffdc22b3249f9947c1e12be6b477" dependencies = [ "darling 0.14.4", - "heck", + "heck 0.4.1", "quote", "syn 1.0.109", ] @@ -2109,20 +2117,20 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a82fcb49253abcb45cdcb2adf92956060ec0928635eb21b4f7a6d8f25ab0bc" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "thiserror", ] [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -2131,9 +2139,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -2156,29 +2164,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -2207,7 +2215,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.2", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -2224,7 +2232,7 @@ dependencies = [ "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2281,9 +2289,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -2309,18 +2317,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2361,9 +2369,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2374,9 +2382,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" dependencies = [ "ahash", "atoi", @@ -2384,7 +2392,6 @@ dependencies = [ "bytes", "crc", "crossbeam-queue", - "dotenvy", "either", "event-listener", "futures-channel", @@ -2394,7 +2401,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.2", + "indexmap 2.2.6", "log", "memchr", "once_cell", @@ -2419,9 +2426,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2", "quote", @@ -2432,14 +2439,13 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ - "atomic-write-file", "dotenvy", "either", - "heck", + "heck 0.4.1", "hex", "once_cell", "proc-macro2", @@ -2459,13 +2465,13 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "bytes", "crc", @@ -2503,13 +2509,13 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "crc", "dotenvy", @@ -2530,7 +2536,6 @@ dependencies = [ "rand", "serde", "serde_json", - "sha1", "sha2", "smallvec", "sqlx-core", @@ -2544,9 +2549,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" dependencies = [ "atoi", "flume", @@ -2569,21 +2574,15 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2609,9 +2608,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -2658,15 +2657,15 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", @@ -2676,29 +2675,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2706,9 +2705,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -2727,9 +2726,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -2752,9 +2751,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -2769,13 +2768,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2790,9 +2789,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -2801,16 +2800,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -2839,7 +2837,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2916,13 +2914,19 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -2931,9 +2935,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode_categories" @@ -2978,9 +2982,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", "serde", @@ -3006,9 +3010,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3029,11 +3033,17 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[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.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3041,24 +3051,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -3068,9 +3078,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3078,28 +3088,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -3119,9 +3129,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +dependencies = [ + "redox_syscall 0.4.1", + "wasite", +] [[package]] name = "winapi" @@ -3141,11 +3155,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -3160,7 +3174,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -3178,7 +3192,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -3198,17 +3212,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -3219,9 +3234,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -3231,9 +3246,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -3243,9 +3258,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -3255,9 +3276,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -3267,9 +3288,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -3279,9 +3300,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -3291,9 +3312,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -3307,26 +3328,26 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/pgml-sdks/pgml/Cargo.toml b/pgml-sdks/pgml/Cargo.toml index 7837e62fb..008e5d838 100644 --- a/pgml-sdks/pgml/Cargo.toml +++ b/pgml-sdks/pgml/Cargo.toml @@ -52,3 +52,4 @@ serde_with = "3.8.1" default = [] python = ["dep:pyo3", "dep:pyo3-asyncio"] javascript = ["dep:neon"] +c = [] diff --git a/pgml-sdks/pgml/c/Makefile b/pgml-sdks/pgml/c/Makefile new file mode 100644 index 000000000..192766cfe --- /dev/null +++ b/pgml-sdks/pgml/c/Makefile @@ -0,0 +1,20 @@ +BINARY_NAME=pgml +HEADER=${BINARY_NAME}.h +PGML_LIB=../target/debug/ + +bindings: + cargo b --features c + rustup default nightly + cbindgen --config cbindgen.toml --output ${HEADER} ../ + rustup default stable + +build: bindings + gcc -Wall -o ./example -Iinclude/ -L${PGML_LIB} -l ${BINARY_NAME} example.c + +run: build + LD_LIBRARY_PATH=${PGML_LIB} ./example + +clean: + rm ${HEADER} + rm -rf ./example + diff --git a/pgml-sdks/pgml/c/cbindgen.toml b/pgml-sdks/pgml/c/cbindgen.toml new file mode 100644 index 000000000..bc8424a26 --- /dev/null +++ b/pgml-sdks/pgml/c/cbindgen.toml @@ -0,0 +1,9 @@ +language = "C" +header = "// Copyright (c) 2024 PostgresML Team" +include_guard = "PGML_H" +autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" +style = "type" + +[parse.expand] +crates = ["pgml"] +features = ["c"] diff --git a/pgml-sdks/pgml/c/example.c b/pgml-sdks/pgml/c/example.c new file mode 100644 index 000000000..fc85d6523 --- /dev/null +++ b/pgml-sdks/pgml/c/example.c @@ -0,0 +1,50 @@ +#include + +#include "pgml.h" + +int main() { + // Create the Collection and Pipeline + CollectionC * collection = pgml_collectionc_new("test_c", NULL); + PipelineC * pipeline = pgml_pipelinec_new("test_c", "{\"text\": {\"splitter\": {\"model\": \"recursive_character\"},\"semantic_search\": {\"model\": \"intfloat/e5-small\"}}}"); + + // Add the Pipeline to the Collection + pgml_collectionc_add_pipeline(collection, pipeline); + + // Upsert the documents + char * documents_to_upsert[2] = {"{\"id\": \"doc1\", \"text\": \"test1\"}", "{\"id\": \"doc2\", \"text\": \"test2\"}"}; + pgml_collectionc_upsert_documents(collection, documents_to_upsert, 2, NULL); + + // Retrieve the documents + unsigned long r_size = 0; + char** documents = pgml_collectionc_get_documents(collection, NULL, &r_size); + + // Print the documents + printf("\n\nPrinting documents:\n"); + int i; + for (i = 0; i < r_size; ++i) { + printf("Document %u -> %s\n", i, documents[i]); + } + + // Search over the documents + r_size = 0; + char** results = pgml_collectionc_vector_search(collection, "{\"query\": {\"fields\": {\"text\": {\"query\": \"Test query!\"}}}, \"limit\": 5}", pipeline, &r_size); + printf("\n\nPrinting results:\n"); + for (i = 0; i < r_size; ++i) { + printf("Result %u -> %s\n", i, results[i]); + } + + // Test the TransformerPipeline + TransformerPipelineC * t_pipeline = pgml_transformerpipelinec_new("text-generation", "meta-llama/Meta-Llama-3-8B-Instruct", NULL, NULL); + GeneralJsonAsyncIteratorC * t_pipeline_iter = pgml_transformerpipelinec_transform_stream(t_pipeline, "\"AI is going to\"", "{\"max_new_tokens\": 100}", NULL); + while (!pgml_generaljsonasynciteratorc_done(t_pipeline_iter)) { + char * res = pgml_generaljsonasynciteratorc_next(t_pipeline_iter); + printf("Token -> %s\n", res); + } + + // cleanup + pgml_transformerpipelinec_delete(t_pipeline); + pgml_pipelinec_delete(pipeline); + pgml_collectionc_delete(collection); + + return 0; +} diff --git a/pgml-sdks/pgml/src/builtins.rs b/pgml-sdks/pgml/src/builtins.rs index 531ae4fa3..0a1d60b71 100644 --- a/pgml-sdks/pgml/src/builtins.rs +++ b/pgml-sdks/pgml/src/builtins.rs @@ -14,6 +14,9 @@ use crate::{get_or_initialize_pool, query_runner::QueryRunner, types::Json}; #[cfg(feature = "python")] use crate::{query_runner::QueryRunnerPython, types::JsonPython}; +#[cfg(feature = "c")] +use crate::{languages::c::JsonC, query_runner::QueryRunnerC}; + #[alias_methods(new, query, transform, embed, embed_batch)] impl Builtins { pub fn new(database_url: Option) -> Self { @@ -117,7 +120,7 @@ impl Builtins { .0 .as_array() .with_context(|| "embed_batch takes an array of strings")? - .into_iter() + .iter() .map(|v| { v.as_str() .with_context(|| "only text embeddings are supported") diff --git a/pgml-sdks/pgml/src/collection.rs b/pgml-sdks/pgml/src/collection.rs index b5a34bbbd..957f15f02 100644 --- a/pgml-sdks/pgml/src/collection.rs +++ b/pgml-sdks/pgml/src/collection.rs @@ -70,6 +70,9 @@ impl RAGStream { } } +#[cfg(feature = "c")] +use crate::{languages::c::JsonC, pipeline::PipelineC, query_builder::QueryBuilderC}; + /// Our project tasks #[derive(Debug, Clone)] pub enum ProjectTask { diff --git a/pgml-sdks/pgml/src/languages/c.rs b/pgml-sdks/pgml/src/languages/c.rs new file mode 100644 index 000000000..9118b0cd4 --- /dev/null +++ b/pgml-sdks/pgml/src/languages/c.rs @@ -0,0 +1,89 @@ +use crate::types::{GeneralJsonAsyncIterator, GeneralJsonIterator, Json}; +use futures::stream::Stream; +use rust_bridge::c::CustomInto; +use std::pin::Pin; + +pub type JsonC = std::ffi::c_char; + +unsafe impl CustomInto for *mut JsonC { + unsafe fn custom_into(self) -> Json { + let s = std::ffi::CStr::from_ptr(self).to_str().unwrap(); + serde_json::from_str::(s).unwrap().into() + } +} + +unsafe impl CustomInto<*mut JsonC> for Json { + unsafe fn custom_into(self) -> *mut JsonC { + let s = serde_json::to_string(&self).unwrap(); + std::ffi::CString::new(s).unwrap().into_raw() + } +} + +pub struct GeneralJsonIteratorC { + wrapped: *mut std::iter::Peekable> + Send>>, +} + +unsafe impl CustomInto<*mut GeneralJsonIteratorC> for GeneralJsonIterator { + unsafe fn custom_into(self) -> *mut GeneralJsonIteratorC { + Box::into_raw(Box::new(GeneralJsonIteratorC { + wrapped: Box::into_raw(Box::new(self.0.peekable())), + })) + } +} + +#[no_mangle] +pub unsafe extern "C" fn pgml_generaljsoniteratorc_done( + iterator: *mut GeneralJsonIteratorC, +) -> bool { + let c = Box::leak(Box::from_raw(iterator)); + (*c.wrapped).peek().is_none() +} + +#[no_mangle] +pub unsafe extern "C" fn pgml_generaljsoniteratorc_next( + iterator: *mut GeneralJsonIteratorC, +) -> *mut JsonC { + let c = Box::leak(Box::from_raw(iterator)); + let b = Box::leak(Box::from_raw(c.wrapped)); + (*b).next().unwrap().unwrap().custom_into() +} + +type PeekableStream = + futures::stream::Peekable> + Send>>>; + +pub struct GeneralJsonAsyncIteratorC { + wrapped: *mut PeekableStream, +} + +unsafe impl CustomInto<*mut GeneralJsonAsyncIteratorC> for GeneralJsonAsyncIterator { + unsafe fn custom_into(self) -> *mut GeneralJsonAsyncIteratorC { + use futures::stream::StreamExt; + Box::into_raw(Box::new(GeneralJsonAsyncIteratorC { + wrapped: Box::into_raw(Box::new(self.0.peekable())), + })) + } +} + +#[no_mangle] +pub unsafe extern "C" fn pgml_generaljsonasynciteratorc_done( + iterator: *mut GeneralJsonAsyncIteratorC, +) -> bool { + crate::get_or_set_runtime().block_on(async move { + let c = Box::leak(Box::from_raw(iterator)); + let s = Box::leak(Box::from_raw(c.wrapped)); + let mut s = Pin::new(s); + let res = s.as_mut().peek_mut().await; + res.is_none() + }) +} + +#[no_mangle] +pub unsafe extern "C" fn pgml_generaljsonasynciteratorc_next( + iterator: *mut GeneralJsonAsyncIteratorC, +) -> *mut JsonC { + crate::get_or_set_runtime().block_on(async move { + use futures::stream::StreamExt; + let c = Box::leak(Box::from_raw(iterator)); + (*c.wrapped).next().await.unwrap().unwrap().custom_into() + }) +} diff --git a/pgml-sdks/pgml/src/languages/mod.rs b/pgml-sdks/pgml/src/languages/mod.rs index dda671ec1..43340b02b 100644 --- a/pgml-sdks/pgml/src/languages/mod.rs +++ b/pgml-sdks/pgml/src/languages/mod.rs @@ -3,3 +3,6 @@ pub mod javascript; #[cfg(feature = "python")] pub mod python; + +#[cfg(feature = "c")] +pub mod c; diff --git a/pgml-sdks/pgml/src/model.rs b/pgml-sdks/pgml/src/model.rs index 096465f06..539c6d1cd 100644 --- a/pgml-sdks/pgml/src/model.rs +++ b/pgml-sdks/pgml/src/model.rs @@ -11,6 +11,9 @@ use crate::{ #[cfg(feature = "python")] use crate::types::JsonPython; +#[cfg(feature = "c")] +use crate::languages::c::JsonC; + /// A few notes on the following enums: /// - Sqlx does provide type derivation for enums, but it's not very good /// - Queries using these enums require a number of additional queries to get their oids and diff --git a/pgml-sdks/pgml/src/open_source_ai.rs b/pgml-sdks/pgml/src/open_source_ai.rs index 74cb6e82b..d7810327d 100644 --- a/pgml-sdks/pgml/src/open_source_ai.rs +++ b/pgml-sdks/pgml/src/open_source_ai.rs @@ -13,6 +13,12 @@ use crate::{ #[cfg(feature = "python")] use crate::types::{GeneralJsonAsyncIteratorPython, GeneralJsonIteratorPython, JsonPython}; +#[cfg(feature = "c")] +use crate::{ + languages::c::JsonC, + languages::c::{GeneralJsonAsyncIteratorC, GeneralJsonIteratorC}, +}; + /// A drop in replacement for OpenAI #[derive(alias, Debug, Clone)] pub struct OpenSourceAI { diff --git a/pgml-sdks/pgml/src/pipeline.rs b/pgml-sdks/pgml/src/pipeline.rs index 02b059db3..e082e9e4b 100644 --- a/pgml-sdks/pgml/src/pipeline.rs +++ b/pgml-sdks/pgml/src/pipeline.rs @@ -19,6 +19,9 @@ use crate::{ #[cfg(feature = "python")] use crate::types::JsonPython; +#[cfg(feature = "c")] +use crate::languages::c::JsonC; + type ParsedSchema = HashMap; #[derive(Deserialize)] diff --git a/pgml-sdks/pgml/src/query_builder.rs b/pgml-sdks/pgml/src/query_builder.rs index ca496d3a0..46b4255b0 100644 --- a/pgml-sdks/pgml/src/query_builder.rs +++ b/pgml-sdks/pgml/src/query_builder.rs @@ -12,6 +12,9 @@ use crate::{pipeline::Pipeline, types::Json, Collection}; #[cfg(feature = "python")] use crate::{pipeline::PipelinePython, types::JsonPython}; +#[cfg(feature = "c")] +use crate::{languages::c::JsonC, pipeline::PipelineC}; + #[derive(alias, Clone, Debug)] pub struct QueryBuilder { collection: Collection, @@ -19,7 +22,7 @@ pub struct QueryBuilder { pipeline: Option, } -#[alias_methods(limit, filter, vector_recall, to_full_string, fetch_all)] +#[alias_methods(limit, filter, vector_recall, to_full_string, fetch_all(skip = "C"))] impl QueryBuilder { pub fn new(collection: Collection) -> Self { let query = json!({ diff --git a/pgml-sdks/pgml/src/query_runner.rs b/pgml-sdks/pgml/src/query_runner.rs index 623a09662..cb5ba77cd 100644 --- a/pgml-sdks/pgml/src/query_runner.rs +++ b/pgml-sdks/pgml/src/query_runner.rs @@ -8,6 +8,9 @@ use crate::{get_or_initialize_pool, types::Json}; #[cfg(feature = "python")] use crate::types::JsonPython; +#[cfg(feature = "c")] +use crate::languages::c::JsonC; + #[derive(Clone, Debug)] enum BindValue { String(String), diff --git a/pgml-sdks/pgml/src/rag_query_builder.rs b/pgml-sdks/pgml/src/rag_query_builder.rs index 4f4279260..df8e48914 100644 --- a/pgml-sdks/pgml/src/rag_query_builder.rs +++ b/pgml-sdks/pgml/src/rag_query_builder.rs @@ -311,7 +311,7 @@ pub async fn build_rag_query( [role_expr, cm.content_expr], ) }); - let inputs_expr = Expr::cust_with_exprs(format!("{dollar_string}"), prompt_exprs); + let inputs_expr = Expr::cust_with_exprs(dollar_string, prompt_exprs); if stream { Expr::cust_with_exprs( diff --git a/pgml-sdks/pgml/src/splitter.rs b/pgml-sdks/pgml/src/splitter.rs index a0847c879..b7dd6c74d 100644 --- a/pgml-sdks/pgml/src/splitter.rs +++ b/pgml-sdks/pgml/src/splitter.rs @@ -11,6 +11,9 @@ use crate::{ #[cfg(feature = "python")] use crate::types::JsonPython; +#[cfg(feature = "c")] +use crate::languages::c::JsonC; + #[allow(dead_code)] #[derive(Debug, Clone)] pub(crate) struct SplitterDatabaseData { diff --git a/pgml-sdks/pgml/src/transformer_pipeline.rs b/pgml-sdks/pgml/src/transformer_pipeline.rs index f7911a56d..18160198d 100644 --- a/pgml-sdks/pgml/src/transformer_pipeline.rs +++ b/pgml-sdks/pgml/src/transformer_pipeline.rs @@ -16,6 +16,9 @@ use crate::{get_or_initialize_pool, types::Json}; #[cfg(feature = "python")] use crate::types::{GeneralJsonAsyncIteratorPython, JsonPython}; +#[cfg(feature = "c")] +use crate::{languages::c::GeneralJsonAsyncIteratorC, languages::c::JsonC}; + #[alias_methods(new, transform, transform_stream)] impl TransformerPipeline { /// Creates a new [TransformerPipeline] diff --git a/pgml-sdks/rust-bridge/rust-bridge-macros/src/c.rs b/pgml-sdks/rust-bridge/rust-bridge-macros/src/c.rs new file mode 100644 index 000000000..3f83b66ad --- /dev/null +++ b/pgml-sdks/rust-bridge/rust-bridge-macros/src/c.rs @@ -0,0 +1,404 @@ +use proc_macro2::Ident; +use quote::{format_ident, quote}; +use std::str::FromStr; +use syn::{visit::Visit, DeriveInput, ItemImpl, Type}; + +use crate::{ + common::{AttributeArgs, GetImplMethod, SupportedLanguage}, + types::{OutputType, SupportedType}, +}; + +pub fn generate_c_alias(parsed: DeriveInput) -> proc_macro::TokenStream { + let name_ident = format_ident!("{}C", parsed.ident); + let wrapped_type_ident = parsed.ident; + + let expanded = quote! { + #[cfg(feature = "c")] + pub struct #name_ident { + pub wrapped: #wrapped_type_ident + } + + #[cfg(feature = "c")] + unsafe impl rust_bridge::c::CustomInto<*mut #name_ident> for #wrapped_type_ident { + unsafe fn custom_into(self) -> *mut #name_ident { + Box::into_raw(Box::new( + #name_ident { + wrapped: self + } + )) + } + } + + #[cfg(feature = "c")] + unsafe impl rust_bridge::c::CustomInto<#wrapped_type_ident> for *mut #name_ident { + unsafe fn custom_into(self) -> #wrapped_type_ident { + let c = Box::from_raw(self); + c.wrapped + } + } + + #[cfg(feature = "c")] + unsafe impl rust_bridge::c::CustomInto<&'static mut #wrapped_type_ident> for *mut #name_ident { + unsafe fn custom_into(self) -> &'static mut #wrapped_type_ident { + let c = Box::leak(Box::from_raw(self)); + &mut c.wrapped + } + } + + #[cfg(feature = "c")] + unsafe impl rust_bridge::c::CustomInto<&'static #wrapped_type_ident> for *mut #name_ident { + unsafe fn custom_into(self) -> &'static #wrapped_type_ident { + let c = Box::leak(Box::from_raw(self)); + &c.wrapped + } + } + }; + + proc_macro::TokenStream::from(expanded) +} + +pub fn generate_c_methods( + parsed: ItemImpl, + attribute_args: &AttributeArgs, +) -> proc_macro::TokenStream { + let mut methods = Vec::new(); + + let wrapped_type_ident = match *parsed.self_ty { + Type::Path(p) => p.path.segments.first().unwrap().ident.clone(), + _ => panic!("Error getting struct ident for impl block"), + }; + let name_ident = format_ident!("{}C", wrapped_type_ident); + + for item in parsed.items { + // We only create methods for functions listed in the attribute args + match &item { + syn::ImplItem::Fn(f) => { + let method_name = f.sig.ident.to_string(); + if !attribute_args.should_alias_method(&method_name, SupportedLanguage::C) { + continue; + } + } + _ => continue, + } + + // Get ImplMethod details - see: https://docs.rs/syn/latest/syn/visit/index.html + let mut method = GetImplMethod::default(); + method.visit_impl_item(&item); + if !method.exists { + continue; + } + let method_ident = method.method_ident.clone(); + + let (mut c_function_arguments, c_argument_prep, rust_function_arguments) = + get_method_arguments(&wrapped_type_ident, &name_ident, &method); + + let method_name = format_ident!( + "pgml_{}_{}", + name_ident.to_string().to_lowercase(), + method_ident + ); + + let (return_part, augment_r_size) = + rust_output_to_c_output(&wrapped_type_ident, &method.output_type); + + if augment_r_size { + c_function_arguments.extend(quote! { + , r_size: *mut std::ffi::c_ulong + }) + } + + let async_part = if method.is_async { + quote! { .await } + } else { + quote! {} + }; + + let (ret_part, augment_part) = if augment_r_size { + ( + quote! { let (ret, ar_size) }, + quote! {*r_size = ar_size as std::ffi::c_ulong; }, + ) + } else { + (quote! { let ret }, quote! {}) + }; + + let rust_call_part = match &method.output_type { + crate::types::OutputType::Result(_) => { + quote! { + #ret_part = #wrapped_type_ident::#method_ident(#rust_function_arguments)#async_part.unwrap().custom_into(); + #augment_part + ret + } + } + crate::types::OutputType::Default => quote! { + #wrapped_type_ident::#method_ident(#rust_function_arguments)#async_part; + }, + crate::types::OutputType::Other(_) => quote! { + #ret_part = #wrapped_type_ident::#method_ident(#rust_function_arguments)#async_part.custom_into(); + #augment_part + ret + }, + }; + + let method = if method.is_async { + quote! { + #[cfg(feature = "c")] + #[no_mangle] + pub unsafe extern "C" fn #method_name(#c_function_arguments) #return_part { + use rust_bridge::c::CustomInto; + use rust_bridge::c::CustomIntoVec; + crate::get_or_set_runtime().block_on(async move { + #c_argument_prep + #rust_call_part + }) + } + } + } else { + quote! { + #[cfg(feature = "c")] + #[no_mangle] + pub unsafe extern "C" fn #method_name(#c_function_arguments) #return_part { + use rust_bridge::c::CustomInto; + use rust_bridge::c::CustomIntoVec; + #c_argument_prep + #rust_call_part + } + } + }; + + methods.push(method); + } + + let method_name = format_ident!("pgml_{}_delete", name_ident.to_string().to_lowercase()); + let destructor = quote! { + #[cfg(feature = "c")] + #[no_mangle] + pub unsafe extern "C" fn #method_name(ptr: *mut #name_ident) { + drop(Box::from_raw(ptr)) + } + }; + + methods.push(destructor); + + proc_macro::TokenStream::from(quote! { + #(#methods)* + }) +} + +fn get_method_arguments( + wrapped_type_ident: &Ident, + name_ident: &Ident, + method: &GetImplMethod, +) -> ( + proc_macro2::TokenStream, + proc_macro2::TokenStream, + proc_macro2::TokenStream, +) { + let mut c_function_arguments = Vec::new(); + let mut c_argument_prep = Vec::new(); + let mut rust_function_arguments = Vec::new(); + + if let Some(receiver) = &method.receiver { + c_function_arguments.push(format!("s: *mut {name_ident}")); + if receiver.to_string().contains('&') { + c_argument_prep.push(format!( + "let s: &mut {wrapped_type_ident} = s.custom_into();" + )); + } else { + c_argument_prep.push(format!("let s: {wrapped_type_ident} = s.custom_into();")); + } + rust_function_arguments.push("s".to_string()); + } + + for (argument_name, argument_type) in &method.method_arguments { + let argument_name_without_mut = argument_name.replacen("mut", "", 1); + let ( + c_function_arguments_, + c_function_argument_types, + c_argument_prep_, + rust_function_arguments_, + ) = get_c_types(&argument_name_without_mut, argument_type); + + let c_function_arguments_ = c_function_arguments_ + .into_iter() + .zip(c_function_argument_types) + .map(|(argument_name, argument_type)| format!("{argument_name}: {argument_type}")) + .collect::>() + .join(","); + + c_function_arguments.push(c_function_arguments_); + c_argument_prep.push(c_argument_prep_); + rust_function_arguments.push(rust_function_arguments_); + } + + ( + proc_macro2::TokenStream::from_str(&c_function_arguments.join(",")).unwrap(), + proc_macro2::TokenStream::from_str(&c_argument_prep.join("\n")).unwrap(), + proc_macro2::TokenStream::from_str(&rust_function_arguments.join(",")).unwrap(), + ) +} + +fn get_c_types( + argument_name: &str, + ty: &SupportedType, +) -> (Vec, Vec, String, String) { + let t = ty.to_language_string(&None); + let c_to_rust = format!("let {argument_name}: {t} = {argument_name}.custom_into();"); + match ty { + SupportedType::Reference(r) => { + let (c_function_arguments, c_function_argument_types, _, _) = + get_c_types(argument_name, &r.ty); + ( + c_function_arguments, + c_function_argument_types, + c_to_rust, + argument_name.to_string(), + ) + } + SupportedType::str | SupportedType::String => ( + vec![format!("{argument_name}")], + vec!["*mut std::ffi::c_char".to_string()], + c_to_rust, + argument_name.to_string(), + ), + SupportedType::Option(r) => { + let (c_function_arguments, mut c_function_argument_types, _, _) = + get_c_types(argument_name, r); + + let v = c_function_argument_types.last_mut().unwrap(); + if !v.starts_with('*') { + *v = format!("*mut {v}"); + } + + ( + c_function_arguments, + c_function_argument_types, + c_to_rust, + argument_name.to_string(), + ) + } + SupportedType::bool => ( + vec![format!("{argument_name}")], + vec!["bool".to_string()], + "".to_string(), + argument_name.to_string(), + ), + SupportedType::Vec(v) => { + let (mut c_function_arguments, mut c_function_argument_types, _, _) = + get_c_types(argument_name, v); + + let v = c_function_argument_types.last_mut().unwrap(); + *v = v.replacen("*mut", "*mut *mut", 1); + c_function_arguments.push("v_size".to_string()); + c_function_argument_types.push("std::ffi::c_ulong".to_string()); + let c_argument_prep = "let v_size: usize = v_size as usize;".to_string(); + let c_to_rust = + format!("{c_argument_prep}\nlet {argument_name}: {t} = {argument_name}.custom_into_vec(v_size);"); + + ( + c_function_arguments, + c_function_argument_types, + c_to_rust, + argument_name.to_string(), + ) + } + SupportedType::HashMap(_) => panic!("HashMap arguments not supported in c"), + SupportedType::Tuple(_) => panic!("Tuple arguments not supported in c"), + SupportedType::S => unreachable!(), + SupportedType::i64 => ( + vec![format!("{argument_name}")], + vec!["std::ffi::c_long".to_string()], + format!("let {argument_name}: {t} = {argument_name} as {t};"), + argument_name.to_string(), + ), + SupportedType::u64 => ( + vec![format!("{argument_name}")], + vec!["std::ffi::c_ulong".to_string()], + format!("let {argument_name}: {t} = {argument_name} as {t};"), + argument_name.to_string(), + ), + SupportedType::i32 => ( + vec![format!("{argument_name}")], + vec!["std::ffi::c_int".to_string()], + format!("let {argument_name}: {t} = {argument_name} as {t};"), + argument_name.to_string(), + ), + SupportedType::f64 => ( + vec![format!("{argument_name}")], + vec!["std::ffi::c_double".to_string()], + format!("let {argument_name}: {t} = {argument_name} as {t};"), + argument_name.to_string(), + ), + SupportedType::CustomType(s) => ( + vec![format!("{argument_name}")], + vec![format!("*mut {s}C")], + c_to_rust, + argument_name.to_string(), + ), + } +} + +fn rust_type_to_c_type( + wrapped_type_ident: &Ident, + ty: &SupportedType, +) -> Option<(proc_macro2::TokenStream, bool)> { + match ty { + // SupportedType::Reference(r) => rust_type_to_c_type(wrapped_type_ident, &r.ty), + SupportedType::str | SupportedType::String => Some((quote! {*mut std::ffi::c_char}, false)), + SupportedType::bool => Some((quote! { bool }, false)), + SupportedType::Vec(v) => { + let (ty, _) = rust_type_to_c_type(wrapped_type_ident, v).unwrap(); + Some((quote! { *mut #ty }, true)) + } + // SupportedType::HashMap(_) => panic!("HashMap arguments not supported in c"), + // SupportedType::Option(r) => { + // let mut t = get_c_types(r); + // if !t.0.contains('*') { + // t.0 = format!("*mut {}", t.0); + // } + // t + // } + SupportedType::Tuple(t) => { + if !t.is_empty() { + panic!("Tuple arguments not supported in c") + } else { + None + } + } + SupportedType::S => { + let ty = format_ident!("{wrapped_type_ident}C"); + Some((quote! { *mut #ty }, false)) + } // SupportedType::i64 => ("std::ffi::c_longlong".to_string(), None), + // SupportedType::u64 => ("std::ffi::c_ulonglong".to_string(), None), + // SupportedType::i32 => ("std::ffi::c_long".to_string(), None), + // SupportedType::f64 => ("std::ffi::c_double".to_string(), None), + SupportedType::CustomType(s) => { + let ty = format_ident!("{s}C"); + Some((quote! {*mut #ty}, false)) + } + _ => panic!("rust_type_to_c_type not implemented for {:?}", ty), + } +} + +fn rust_output_to_c_output( + wrapped_type_ident: &Ident, + output: &OutputType, +) -> (proc_macro2::TokenStream, bool) { + match output { + crate::types::OutputType::Result(r) => { + if let Some((ty, augment_r_size)) = rust_type_to_c_type(wrapped_type_ident, r) { + (quote! { -> #ty }, augment_r_size) + } else { + (quote! {}, false) + } + } + crate::types::OutputType::Default => (quote! {}, false), + crate::types::OutputType::Other(r) => { + if let Some((ty, augment_r_size)) = rust_type_to_c_type(wrapped_type_ident, r) { + (quote! { -> #ty }, augment_r_size) + } else { + (quote! {}, false) + } + } + } +} diff --git a/pgml-sdks/rust-bridge/rust-bridge-macros/src/common.rs b/pgml-sdks/rust-bridge/rust-bridge-macros/src/common.rs index f17b4b63a..dc9ec066b 100644 --- a/pgml-sdks/rust-bridge/rust-bridge-macros/src/common.rs +++ b/pgml-sdks/rust-bridge/rust-bridge-macros/src/common.rs @@ -1,30 +1,130 @@ -use proc_macro2::Ident; +use proc_macro2::{Group, Ident}; use quote::{format_ident, ToTokens}; use syn::{ - parse::Parser, + parse::{Parse, Parser}, punctuated::Punctuated, + token, visit::{self, Visit}, - ImplItemFn, ReturnType, Token, Visibility, + Expr, ExprAssign, ImplItemFn, Lit, ReturnType, Token, Visibility, }; use crate::types::{GetOutputType, GetSupportedType, OutputType, SupportedType}; +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum SupportedLanguage { + C, + Python, + JavaScript, +} + +impl From<&str> for SupportedLanguage { + fn from(value: &str) -> Self { + match value { + "C" => SupportedLanguage::C, + "Python" => SupportedLanguage::Python, + "JavaScript" => SupportedLanguage::JavaScript, + _ => panic!("Cannot convert {value} to SupportedLanguage"), + } + } +} + pub struct AttributeArgs { - pub args: Vec, + args: Vec, +} + +#[derive(Debug, Clone)] +struct Item { + method: String, + language_exceptions: Vec, +} + +#[derive(Debug)] +enum AdditionalAttribute { + Skip(SupportedLanguage), +} + +impl From<&ExprAssign> for AdditionalAttribute { + fn from(value: &ExprAssign) -> Self { + let a_ty = match &*value.left { + Expr::Path(p) => p.into_token_stream().to_string(), + _ => panic!( + r#"Getting left value - Expected additional attributes to look something like: #[alias_methods(new(skip = "c"))]"# + ), + }; + match a_ty.as_str() { + "skip" => { + let skip_method = match &*value.right { + Expr::Lit(l) => match &l.lit { + Lit::Str(l) => l.value().as_str().into(), + _ => { + panic!( + r#"Getting Lit value - Expected additional attributes to look something like: #[alias_methods(new(skip = "c"))]"# + ) + } + }, + _ => panic!( + r#"Getting Lit - Expected additional attributes to look something like: #[alias_methods(new(skip = "c"))]"# + ), + }; + AdditionalAttribute::Skip(skip_method) + } + _ => panic!("Currently only skip additional attributes are supported"), + } + } +} + +impl Parse for Item { + fn parse(input: syn::parse::ParseStream) -> syn::Result { + let method: Ident = input.parse()?; + let lookahead = input.lookahead1(); + if !lookahead.peek(token::Paren) { + Ok(Self { + method: method.to_string(), + language_exceptions: Vec::new(), + }) + } else { + let group: Group = input.parse()?; + let group_parser = Punctuated::::parse_terminated; + let parsed_group = group_parser + .parse(group.stream().into()) + .expect("Error parsing attributes for custom_methods macro"); + let a_atts: Vec = parsed_group + .into_pairs() + .map(|p| p.value().into()) + .collect(); + // Update this part as needed + let mut language_exceptions = Vec::new(); + for att in a_atts { + match att { + AdditionalAttribute::Skip(a) => language_exceptions.push(a), + } + } + Ok(Self { + method: method.to_string(), + language_exceptions, + }) + } + } } impl AttributeArgs { pub fn new(attributes: proc_macro::TokenStream) -> Self { - let attribute_parser = Punctuated::::parse_terminated; + let attribute_parser = Punctuated::::parse_terminated; let parsed_attributes = attribute_parser .parse(attributes) .expect("Error parsing attributes for custom_methods macro"); - let args: Vec = parsed_attributes + let args: Vec = parsed_attributes .into_pairs() - .map(|p| p.value().to_string()) + .map(|p| p.value().clone()) .collect(); Self { args } } + + pub fn should_alias_method(&self, method_name: &str, language: SupportedLanguage) -> bool { + self.args + .iter() + .any(|item| item.method == method_name && !item.language_exceptions.contains(&language)) + } } #[derive(Debug)] diff --git a/pgml-sdks/rust-bridge/rust-bridge-macros/src/javascript.rs b/pgml-sdks/rust-bridge/rust-bridge-macros/src/javascript.rs index 6aa5cf667..41b1396d9 100644 --- a/pgml-sdks/rust-bridge/rust-bridge-macros/src/javascript.rs +++ b/pgml-sdks/rust-bridge/rust-bridge-macros/src/javascript.rs @@ -3,7 +3,7 @@ use std::fs::OpenOptions; use std::io::{Read, Write}; use syn::{visit::Visit, DeriveInput, ItemImpl, Type}; -use crate::common::{AttributeArgs, GetImplMethod}; +use crate::common::{AttributeArgs, GetImplMethod, SupportedLanguage}; use crate::types::{OutputType, SupportedType}; pub fn generate_javascript_alias(parsed: DeriveInput) -> proc_macro::TokenStream { @@ -112,7 +112,8 @@ pub fn generate_javascript_methods( match &item { syn::ImplItem::Fn(f) => { let method_name = f.sig.ident.to_string(); - if !attribute_args.args.contains(&method_name) { + if !attribute_args.should_alias_method(&method_name, SupportedLanguage::JavaScript) + { continue; } } @@ -300,7 +301,6 @@ pub fn generate_javascript_methods( if let Ok(path) = path { let mut file = OpenOptions::new() .create(true) - .write(true) .append(true) .read(true) .open(path) diff --git a/pgml-sdks/rust-bridge/rust-bridge-macros/src/lib.rs b/pgml-sdks/rust-bridge/rust-bridge-macros/src/lib.rs index e6dc81c73..467fcf08f 100644 --- a/pgml-sdks/rust-bridge/rust-bridge-macros/src/lib.rs +++ b/pgml-sdks/rust-bridge/rust-bridge-macros/src/lib.rs @@ -1,5 +1,6 @@ use syn::{parse_macro_input, DeriveInput, ItemImpl}; +mod c; mod common; mod javascript; mod python; @@ -11,9 +12,11 @@ pub fn alias(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let parsed = parse_macro_input!(input as DeriveInput); let python_tokens = python::generate_python_alias(parsed.clone()); + let c_tokens = c::generate_c_alias(parsed.clone()); let javascript_tokens = javascript::generate_javascript_alias(parsed); output.extend(python_tokens); + output.extend(c_tokens); output.extend(javascript_tokens); output } @@ -29,9 +32,11 @@ pub fn alias_methods( let parsed: ItemImpl = syn::parse(input).unwrap(); let python_tokens = python::generate_python_methods(parsed.clone(), &attribute_args); + let c_tokens = c::generate_c_methods(parsed.clone(), &attribute_args); let javascript_tokens = javascript::generate_javascript_methods(parsed, &attribute_args); output.extend(python_tokens); + output.extend(c_tokens); output.extend(javascript_tokens); output } diff --git a/pgml-sdks/rust-bridge/rust-bridge-macros/src/python.rs b/pgml-sdks/rust-bridge/rust-bridge-macros/src/python.rs index 1b472e899..d58929fe3 100644 --- a/pgml-sdks/rust-bridge/rust-bridge-macros/src/python.rs +++ b/pgml-sdks/rust-bridge/rust-bridge-macros/src/python.rs @@ -3,7 +3,7 @@ use std::fs::OpenOptions; use std::io::{Read, Write}; use syn::{visit::Visit, DeriveInput, ItemImpl, Type}; -use crate::common::{AttributeArgs, GetImplMethod}; +use crate::common::{AttributeArgs, GetImplMethod, SupportedLanguage}; use crate::types::{OutputType, SupportedType}; const STUB_TOP: &str = r#" @@ -192,7 +192,7 @@ pub fn generate_python_methods( match &item { syn::ImplItem::Fn(f) => { let method_name = f.sig.ident.to_string(); - if !attribute_args.args.contains(&method_name) { + if !attribute_args.should_alias_method(&method_name, SupportedLanguage::Python) { continue; } } @@ -373,7 +373,6 @@ pub fn generate_python_methods( if let Ok(path) = path { let mut file = OpenOptions::new() .create(true) - .write(true) .append(true) .read(true) .open(path) diff --git a/pgml-sdks/rust-bridge/rust-bridge-macros/src/types.rs b/pgml-sdks/rust-bridge/rust-bridge-macros/src/types.rs index 99947b1da..6629995a3 100644 --- a/pgml-sdks/rust-bridge/rust-bridge-macros/src/types.rs +++ b/pgml-sdks/rust-bridge/rust-bridge-macros/src/types.rs @@ -37,9 +37,9 @@ pub enum SupportedType { CustomType(String), } -impl ToString for SupportedType { - fn to_string(&self) -> String { - self.to_language_string(&None) +impl std::fmt::Display for SupportedType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.to_language_string(&None)) } } diff --git a/pgml-sdks/rust-bridge/rust-bridge-traits/src/c.rs b/pgml-sdks/rust-bridge/rust-bridge-traits/src/c.rs new file mode 100644 index 000000000..c06ac59d8 --- /dev/null +++ b/pgml-sdks/rust-bridge/rust-bridge-traits/src/c.rs @@ -0,0 +1,96 @@ +/// Very similar to the `Into` trait, but we can implement it on foreign types. +pub unsafe trait CustomInto { + unsafe fn custom_into(self) -> T; +} + +pub unsafe trait CustomIntoVec { + unsafe fn custom_into_vec(self, size: usize) -> Vec; +} + +unsafe impl CustomIntoVec for *mut *mut T2 +where + *mut T2: CustomInto, +{ + unsafe fn custom_into_vec(self, size: usize) -> Vec { + let mut result = vec![]; + let strings = std::slice::from_raw_parts_mut(self, size); + for s in strings { + let res = s.custom_into(); + result.push(res) + } + result + } +} + +unsafe impl<'a> CustomInto<&'a str> for *mut std::ffi::c_char { + unsafe fn custom_into(self) -> &'a str { + std::ffi::CStr::from_ptr(self).to_str().unwrap() + } +} + +unsafe impl CustomInto for *mut std::ffi::c_char { + unsafe fn custom_into(self) -> String { + std::ffi::CStr::from_ptr(self).to_str().unwrap().to_string() + } +} + +unsafe impl CustomInto<*mut std::ffi::c_char> for String { + unsafe fn custom_into(self) -> *mut std::ffi::c_char { + std::ffi::CString::new(self).unwrap().into_raw() + } +} + +unsafe impl CustomInto for *mut std::ffi::c_int { + unsafe fn custom_into(self) -> i32 { + *self + } +} + +unsafe impl CustomInto for *mut std::ffi::c_double { + unsafe fn custom_into(self) -> f64 { + *self + } +} + +unsafe impl CustomInto> for *mut T2 +where + *mut T2: CustomInto, +{ + unsafe fn custom_into(self) -> Option { + if self.is_null() { + None + } else { + Some(self.custom_into()) + } + } +} + +unsafe impl CustomInto<(*mut T1, usize)> for Vec +where + T2: CustomInto, +{ + unsafe fn custom_into(self) -> (*mut T1, usize) { + let size = self.len(); + let v: Vec = self.into_iter().map(|v| v.custom_into()).collect(); + (v.leak().as_mut_ptr(), size) + } +} + +macro_rules! gen_custom_into { + ($t1:ty) => { + unsafe impl CustomInto<$t1> for $t1 { + unsafe fn custom_into(self) -> $t1 { + self + } + } + }; +} + +gen_custom_into!(()); +gen_custom_into!(bool); + +unsafe impl> CustomInto> for Vec { + unsafe fn custom_into(self) -> Vec { + self.into_iter().map(|x| x.custom_into()).collect() + } +} diff --git a/pgml-sdks/rust-bridge/rust-bridge-traits/src/lib.rs b/pgml-sdks/rust-bridge/rust-bridge-traits/src/lib.rs index 351c28c06..7cba7c727 100644 --- a/pgml-sdks/rust-bridge/rust-bridge-traits/src/lib.rs +++ b/pgml-sdks/rust-bridge/rust-bridge-traits/src/lib.rs @@ -1,3 +1,3 @@ -pub mod python; - +pub mod c; pub mod javascript; +pub mod python; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy