Compare commits

...
8 Commits
12 changed files with 582 additions and 204 deletions
Generated
+239 -173
View File
@@ -19,9 +19,9 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "1.1.4" version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -34,13 +34,13 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.91" version = "0.1.92"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 3.0.3", "syn 3.0.4",
] ]
[[package]] [[package]]
@@ -49,6 +49,12 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "autocfg"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]] [[package]]
name = "backtrace" name = "backtrace"
version = "0.3.76" version = "0.3.76"
@@ -72,9 +78,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.23.0" version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b25655df2c3cdd83c5e5b293b88acd880332b2ddadd7c30ac43144fdc0033da9" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
[[package]] [[package]]
name = "bindgen" name = "bindgen"
@@ -104,11 +110,11 @@ checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
version = "0.10.4" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
dependencies = [ dependencies = [
"generic-array", "hybrid-array",
] ]
[[package]] [[package]]
@@ -125,9 +131,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.4.0" version = "1.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" checksum = "0ad534f4357a5264cce5019c989cf66a4f0dc4e0d1b1d15f8aacec0ff7360273"
dependencies = [ dependencies = [
"find-msvc-tools", "find-msvc-tools",
"jobserver", "jobserver",
@@ -152,9 +158,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]] [[package]]
name = "clang-sys" name = "clang-sys"
version = "1.8.1" version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a"
dependencies = [ dependencies = [
"glob", "glob",
"libc", "libc",
@@ -189,10 +195,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "cpufeatures" name = "const-oid"
version = "0.2.17" version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
[[package]]
name = "cpufeatures"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@@ -205,12 +217,11 @@ checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
[[package]] [[package]]
name = "crypto-common" name = "crypto-common"
version = "0.1.7" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
dependencies = [ dependencies = [
"generic-array", "hybrid-array",
"typenum",
] ]
[[package]] [[package]]
@@ -221,7 +232,7 @@ checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-utils", "crossbeam-utils",
"hashbrown", "hashbrown 0.14.5",
"lock_api", "lock_api",
"once_cell", "once_cell",
"parking_lot_core", "parking_lot_core",
@@ -229,30 +240,37 @@ dependencies = [
[[package]] [[package]]
name = "digest" name = "digest"
version = "0.10.7" version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [ dependencies = [
"block-buffer", "block-buffer",
"const-oid",
"crypto-common", "crypto-common",
] ]
[[package]] [[package]]
name = "displaydoc" name = "displaydoc"
version = "0.2.6" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.119", "syn 3.0.4",
] ]
[[package]] [[package]]
name = "either" name = "either"
version = "1.17.0" version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]] [[package]]
name = "errno" name = "errno"
@@ -266,19 +284,20 @@ dependencies = [
[[package]] [[package]]
name = "eyre" name = "eyre"
version = "0.6.12" version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" checksum = "c08309dbcc659c5549a24ddb9b27027640641b282ef5768267c7e675558986a3"
dependencies = [ dependencies = [
"autocfg",
"indenter", "indenter",
"once_cell", "once_cell",
] ]
[[package]] [[package]]
name = "find-msvc-tools" name = "find-msvc-tools"
version = "0.1.9" version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890"
[[package]] [[package]]
name = "form_urlencoded" name = "form_urlencoded"
@@ -291,9 +310,9 @@ dependencies = [
[[package]] [[package]]
name = "futures" name = "futures"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a88cf1f829d945f548cf8fec32c61b1f202b6d93b45848602fc02af4b12ad218" checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@@ -306,9 +325,9 @@ dependencies = [
[[package]] [[package]]
name = "futures-channel" name = "futures-channel"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
@@ -316,15 +335,15 @@ dependencies = [
[[package]] [[package]]
name = "futures-core" name = "futures-core"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
[[package]] [[package]]
name = "futures-executor" name = "futures-executor"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-task", "futures-task",
@@ -333,38 +352,38 @@ dependencies = [
[[package]] [[package]]
name = "futures-io" name = "futures-io"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
[[package]] [[package]]
name = "futures-macro" name = "futures-macro"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.119", "syn 3.0.4",
] ]
[[package]] [[package]]
name = "futures-sink" name = "futures-sink"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
[[package]] [[package]]
name = "futures-task" name = "futures-task"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
[[package]] [[package]]
name = "futures-util" name = "futures-util"
version = "0.3.33" version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@@ -377,16 +396,6 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "generic-array"
version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.3.4" version = "0.3.4"
@@ -428,6 +437,12 @@ version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
[[package]] [[package]]
name = "hex" name = "hex"
version = "0.4.3" version = "0.4.3"
@@ -436,9 +451,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]] [[package]]
name = "http" name = "http"
version = "1.4.2" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
dependencies = [ dependencies = [
"bytes", "bytes",
"itoa", "itoa",
@@ -456,9 +471,9 @@ dependencies = [
[[package]] [[package]]
name = "http-body-util" name = "http-body-util"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
@@ -474,10 +489,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]] [[package]]
name = "hyper" name = "hybrid-array"
version = "1.11.0" version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d22053281f852e11534f5198498373cbb59295120a20771d90f7ed1897490a72" checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b"
dependencies = [
"typenum",
]
[[package]]
name = "hyper"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43"
dependencies = [ dependencies = [
"atomic-waker", "atomic-waker",
"bytes", "bytes",
@@ -518,9 +542,9 @@ dependencies = [
[[package]] [[package]]
name = "icu_collections" name = "icu_collections"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513"
dependencies = [ dependencies = [
"displaydoc", "displaydoc",
"potential_utf", "potential_utf",
@@ -532,9 +556,9 @@ dependencies = [
[[package]] [[package]]
name = "icu_locale_core" name = "icu_locale_core"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb"
dependencies = [ dependencies = [
"displaydoc", "displaydoc",
"litemap", "litemap",
@@ -545,9 +569,9 @@ dependencies = [
[[package]] [[package]]
name = "icu_normalizer" name = "icu_normalizer"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f"
dependencies = [ dependencies = [
"icu_collections", "icu_collections",
"icu_normalizer_data", "icu_normalizer_data",
@@ -559,16 +583,17 @@ dependencies = [
[[package]] [[package]]
name = "icu_normalizer_data" name = "icu_normalizer_data"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0"
[[package]] [[package]]
name = "icu_properties" name = "icu_properties"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148"
dependencies = [ dependencies = [
"displaydoc",
"icu_collections", "icu_collections",
"icu_locale_core", "icu_locale_core",
"icu_properties_data", "icu_properties_data",
@@ -579,15 +604,15 @@ dependencies = [
[[package]] [[package]]
name = "icu_properties_data" name = "icu_properties_data"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa"
[[package]] [[package]]
name = "icu_provider" name = "icu_provider"
version = "2.2.0" version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"
dependencies = [ dependencies = [
"displaydoc", "displaydoc",
"icu_locale_core", "icu_locale_core",
@@ -626,10 +651,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5"
[[package]] [[package]]
name = "ipnet" name = "indexmap"
version = "2.12.0" version = "2.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb"
dependencies = [
"equivalent",
"hashbrown 0.17.1",
]
[[package]]
name = "ipnet"
version = "2.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78"
[[package]] [[package]]
name = "itertools" name = "itertools"
@@ -658,9 +693,9 @@ dependencies = [
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.103" version = "0.3.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures-util", "futures-util",
@@ -684,7 +719,6 @@ name = "ldctl"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"color-eyre", "color-eyre",
"futures",
"ldp", "ldp",
"tokio", "tokio",
"tracing", "tracing",
@@ -693,16 +727,17 @@ dependencies = [
[[package]] [[package]]
name = "ldp" name = "ldp"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"base64 0.23.0", "base64 0.23.1",
"bytes", "bytes",
"futures", "futures",
"http", "http",
"oxigraph", "oxigraph",
"parse_link_header", "parse_link_header",
"reqwest-middleware", "reqwest-middleware",
"sfv",
"slotmap", "slotmap",
"thiserror", "thiserror",
"tracing", "tracing",
@@ -726,9 +761,9 @@ dependencies = [
[[package]] [[package]]
name = "litemap" name = "litemap"
version = "0.8.2" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
@@ -741,9 +776,9 @@ dependencies = [
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.33" version = "0.4.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
[[package]] [[package]]
name = "matchers" name = "matchers"
@@ -756,9 +791,9 @@ dependencies = [
[[package]] [[package]]
name = "md-5" name = "md-5"
version = "0.10.6" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"digest", "digest",
@@ -787,9 +822,9 @@ dependencies = [
[[package]] [[package]]
name = "mio" name = "mio"
version = "1.2.2" version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8"
dependencies = [ dependencies = [
"libc", "libc",
"wasi", "wasi",
@@ -832,15 +867,15 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]] [[package]]
name = "owo-colors" name = "owo-colors"
version = "4.3.0" version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" checksum = "13c45bb4a6ae1280ec0803b1ef9d3455eb50f01efbbe1447ab020f1d54fba9d8"
[[package]] [[package]]
name = "oxigraph" name = "oxigraph"
version = "0.5.9" version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d945cbe78640ab719a73697b9bd250054ea82c60470754efea79c21d5fc1cd1" checksum = "7f6632dd080bd07676f06e70254ff5862c9943e9483d700fa7258df73a3f9a6a"
dependencies = [ dependencies = [
"dashmap", "dashmap",
"getrandom 0.3.4", "getrandom 0.3.4",
@@ -876,9 +911,9 @@ checksum = "54b4ed3a7192fa19f5f48f99871f2755047fabefd7f222f12a1df1773796a102"
[[package]] [[package]]
name = "oxjsonld" name = "oxjsonld"
version = "0.2.5" version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6e1380a504a8571763f13b8bcad629ff90d0300d47d8a519f3c6c599625840e" checksum = "86a3e89e005662e60327027f45ec7cefd0472404e01831b5d83a3ac522cfabe0"
dependencies = [ dependencies = [
"json-event-parser", "json-event-parser",
"oxiri", "oxiri",
@@ -889,9 +924,9 @@ dependencies = [
[[package]] [[package]]
name = "oxrdf" name = "oxrdf"
version = "0.3.3" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0afd5c28e4a399c57ee2bc3accd40c7b671fdc7b6537499f14e95b265af7d7e0" checksum = "4be15186205eb60ddbdc2fb47cb25df472c7f399bbe119b68c0972b6b6dd46ea"
dependencies = [ dependencies = [
"hex", "hex",
"oxilangtag", "oxilangtag",
@@ -904,9 +939,9 @@ dependencies = [
[[package]] [[package]]
name = "oxrdfio" name = "oxrdfio"
version = "0.2.5" version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "696223589ecbcab06b1a5df9b527dc25b0c656160cca38752fdb3878a5d3dd03" checksum = "17b3fe3bb34179c376ab04f2a1b32616b0babab574b3b7eef64d587e60d5e1db"
dependencies = [ dependencies = [
"oxjsonld", "oxjsonld",
"oxrdf", "oxrdf",
@@ -917,9 +952,9 @@ dependencies = [
[[package]] [[package]]
name = "oxrdfxml" name = "oxrdfxml"
version = "0.2.3" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd5516ae083d09bc57ec65ed5ee97701481725de6ffaa83d968ab42a96157ba1" checksum = "71853d12051879f3e424c6864e978f5f5cbecd8e86a9817adbccaefccac9d61d"
dependencies = [ dependencies = [
"oxilangtag", "oxilangtag",
"oxiri", "oxiri",
@@ -930,9 +965,9 @@ dependencies = [
[[package]] [[package]]
name = "oxrocksdb-sys" name = "oxrocksdb-sys"
version = "0.5.9" version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6977c1d1827fcbf14480e768e4dede0b39c2961f6028497d012f9c04bcda91c6" checksum = "01fcf5ae1e1295a612bef72fc64cd81e1ac3d1bd3243ef84d330f2962a8335e1"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"cc", "cc",
@@ -940,18 +975,18 @@ dependencies = [
[[package]] [[package]]
name = "oxsdatatypes" name = "oxsdatatypes"
version = "0.2.2" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06fa874d87eae638daae9b4e3198864fe2cce68589f227c0b2cf5b62b1530516" checksum = "c17c2ae62ac34fda465f6331105906c0e17b4e088dac3249e1f229b962062503"
dependencies = [ dependencies = [
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "oxttl" name = "oxttl"
version = "0.2.3" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f03fd471bd54c23d76631c0a2677aa4bb308d905f6e491ee35dcb0732b7c5c6c" checksum = "b1d0fe19fa62a6a102f85b052bbd86e3cdc3360cd6a338d01bab1a6743bf1d8e"
dependencies = [ dependencies = [
"memchr", "memchr",
"oxilangtag", "oxilangtag",
@@ -1035,9 +1070,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]] [[package]]
name = "potential_utf" name = "potential_utf"
version = "0.1.5" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
dependencies = [ dependencies = [
"zerovec", "zerovec",
] ]
@@ -1138,6 +1173,26 @@ dependencies = [
"bitflags", "bitflags",
] ]
[[package]]
name = "ref-cast"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3"
dependencies = [
"ref-cast-impl",
]
[[package]]
name = "ref-cast-impl"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.4",
]
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.13.1" version = "1.13.1"
@@ -1152,9 +1207,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.16" version = "0.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@@ -1269,14 +1324,25 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 3.0.3", "syn 3.0.4",
]
[[package]]
name = "sfv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "890ef0e5532daf21fdaa3dbaf991417187f3a87ab69231fe69be942495746480"
dependencies = [
"base64 0.22.1",
"indexmap",
"ref-cast",
] ]
[[package]] [[package]]
name = "sha1" name = "sha1"
version = "0.10.7" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
@@ -1285,9 +1351,9 @@ dependencies = [
[[package]] [[package]]
name = "sha2" name = "sha2"
version = "0.10.9" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
@@ -1348,9 +1414,9 @@ dependencies = [
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.15.2" version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f"
[[package]] [[package]]
name = "socket2" name = "socket2"
@@ -1364,9 +1430,9 @@ dependencies = [
[[package]] [[package]]
name = "sparesults" name = "sparesults"
version = "0.3.3" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e13362decdcbeb3fefadff1631238c835c112027221e83d217cc5779f5a81c2" checksum = "5dfa99dba6f5155ef4fdd75b78f794ea0c729e17b07d84eb88ae3c1278d1758d"
dependencies = [ dependencies = [
"json-event-parser", "json-event-parser",
"memchr", "memchr",
@@ -1377,9 +1443,9 @@ dependencies = [
[[package]] [[package]]
name = "spareval" name = "spareval"
version = "0.2.6" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8eab80b96dc836e4cf8fda72daa67ccc0244dc5303be5d4566e8fd04adbdde5" checksum = "85b51144836ff9ca2f792b7a2422c4170ff04460d86cd8f2f764cf53e339cbec"
dependencies = [ dependencies = [
"hex", "hex",
"json-event-parser", "json-event-parser",
@@ -1400,9 +1466,9 @@ dependencies = [
[[package]] [[package]]
name = "spargebra" name = "spargebra"
version = "0.4.6" version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46715eb957d1fe960cbbc0b713da8f78e2cb19df315b48fb09c9467a1c84f656" checksum = "bef3c186ffb9bf2dde7c5edd5528583f309fcb819b5773cf0e313194a990304f"
dependencies = [ dependencies = [
"oxilangtag", "oxilangtag",
"oxiri", "oxiri",
@@ -1414,9 +1480,9 @@ dependencies = [
[[package]] [[package]]
name = "sparopt" name = "sparopt"
version = "0.3.6" version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aed7a854b8ea67618f8ce69aabb0e904d7704226060e9d5a2930eb3136c3fa3b" checksum = "973ee503ab3d6c3de66b4b459233cd5b22b44dad0fb7b8d0931daf73d2ede935"
dependencies = [ dependencies = [
"oxrdf", "oxrdf",
"rand", "rand",
@@ -1442,9 +1508,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "3.0.3" version = "3.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -1473,22 +1539,22 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "2.0.19" version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9" checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "2.0.19" version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 3.0.3", "syn 3.0.4",
] ]
[[package]] [[package]]
@@ -1502,9 +1568,9 @@ dependencies = [
[[package]] [[package]]
name = "tinystr" name = "tinystr"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643"
dependencies = [ dependencies = [
"displaydoc", "displaydoc",
"zerovec", "zerovec",
@@ -1529,13 +1595,13 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.7.1" version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6328af13490e73a9b4694030fafd93f8c8c6a9dede33e821c3fc63eddf8042ba" checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.119", "syn 3.0.4",
] ]
[[package]] [[package]]
@@ -1741,9 +1807,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.126" version = "0.2.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@@ -1754,9 +1820,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.76" version = "0.4.77"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@@ -1764,9 +1830,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.126" version = "0.2.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@@ -1774,9 +1840,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.126" version = "0.2.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"proc-macro2", "proc-macro2",
@@ -1787,9 +1853,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.126" version = "0.2.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -1809,9 +1875,9 @@ dependencies = [
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.103" version = "0.3.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@@ -1840,9 +1906,9 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
[[package]] [[package]]
name = "writeable" name = "writeable"
version = "0.6.3" version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
[[package]] [[package]]
name = "yoke" name = "yoke"
@@ -1869,18 +1935,18 @@ dependencies = [
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.55" version = "0.8.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.55" version = "0.8.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -1910,9 +1976,9 @@ dependencies = [
[[package]] [[package]]
name = "zerotrie" name = "zerotrie"
version = "0.2.4" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
dependencies = [ dependencies = [
"displaydoc", "displaydoc",
"yoke", "yoke",
@@ -1921,9 +1987,9 @@ dependencies = [
[[package]] [[package]]
name = "zerovec" name = "zerovec"
version = "0.11.6" version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"
dependencies = [ dependencies = [
"yoke", "yoke",
"zerofrom", "zerofrom",
@@ -1932,11 +1998,11 @@ dependencies = [
[[package]] [[package]]
name = "zerovec-derive" name = "zerovec-derive"
version = "0.11.3" version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.119", "syn 3.0.4",
] ]
+2 -1
View File
@@ -12,11 +12,12 @@ async-trait = "0.1"
base64 = "0.23" base64 = "0.23"
bytes = "1.12" bytes = "1.12"
futures = "0.3" futures = "0.3"
http = "1.4" http = "1.5"
color-eyre = "0.6" color-eyre = "0.6"
oxigraph = "0.5" oxigraph = "0.5"
parse_link_header = "0.4" parse_link_header = "0.4"
reqwest-middleware = { version = "0.5", features = ["stream"] } reqwest-middleware = { version = "0.5", features = ["stream"] }
sfv = "0.15"
slotmap = "1.1" slotmap = "1.1"
thiserror = "2" thiserror = "2"
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
+4 -1
View File
@@ -4,9 +4,12 @@ version = "0.0.0"
edition = "2024" edition = "2024"
publish = false publish = false
[[bin]]
name = "ldctl"
doc = false
[dependencies] [dependencies]
ldp.workspace = true ldp.workspace = true
futures.workspace = true
color-eyre.workspace = true color-eyre.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
+4 -2
View File
@@ -1,14 +1,15 @@
[package] [package]
name = "ldp" name = "ldp"
version = "0.0.0" version = "0.1.0"
edition = "2024" edition = "2024"
description = "A library to assist with the creation and maintenance of remote RDF data via LDP" description = "A library to assist with the creation and maintenance of remote RDF data via LDP"
documentation = "https://docs.rs/ldp"
readme = "README.md" readme = "README.md"
license = "GPL-3.0-only" license = "GPL-3.0-only"
keywords = ["ldp", "rdf", "sparql"] keywords = ["ldp", "rdf", "sparql"]
categories = ["database", "web-programming::http-client"] categories = ["database", "web-programming::http-client"]
homepage = "https://graphofliberty.org" homepage = "https://graphofliberty.org"
repository = "https://code.graphofliberty.org/graphofliberty/ldp" repository = "https://code.graphofliberty.org/gl/ldp"
[features] [features]
keyed = ["dep:slotmap"] keyed = ["dep:slotmap"]
@@ -22,6 +23,7 @@ http.workspace = true
oxigraph.workspace = true oxigraph.workspace = true
parse_link_header.workspace = true parse_link_header.workspace = true
reqwest-middleware.workspace = true reqwest-middleware.workspace = true
sfv.workspace = true
slotmap = { optional = true, workspace = true } slotmap = { optional = true, workspace = true }
thiserror.workspace = true thiserror.workspace = true
tracing.workspace = true tracing.workspace = true
+29
View File
@@ -0,0 +1,29 @@
use crate::vocab;
use oxigraph::model::NamedNodeRef;
/// The type of [Container](https://www.w3.org/TR/ldp/#ldpc).
#[derive(Clone, Debug, PartialEq)]
pub enum ContainerType {
Basic,
Direct,
Indirect,
}
impl ContainerType {
pub fn as_named_node_ref(&self) -> NamedNodeRef<'_> {
match self {
ContainerType::Basic => vocab::ldp::BASIC_CONTAINER,
ContainerType::Direct => vocab::ldp::DIRECT_CONTAINER,
ContainerType::Indirect => vocab::ldp::INDIRECT_CONTAINER,
}
}
pub fn from_named_node_ref(node: NamedNodeRef<'_>) -> Option<Self> {
match node {
vocab::ldp::BASIC_CONTAINER => Some(ContainerType::Basic),
vocab::ldp::DIRECT_CONTAINER => Some(ContainerType::Direct),
vocab::ldp::INDIRECT_CONTAINER => Some(ContainerType::Indirect),
_ => None,
}
}
}
-1
View File
@@ -3,4 +3,3 @@ use reqwest_middleware::reqwest::header::HeaderName;
pub const X_STATE_TOKEN: HeaderName = HeaderName::from_static("x-state-token"); pub const X_STATE_TOKEN: HeaderName = HeaderName::from_static("x-state-token");
pub const X_IF_STATE_TOKEN: HeaderName = HeaderName::from_static("x-if-state-token"); pub const X_IF_STATE_TOKEN: HeaderName = HeaderName::from_static("x-if-state-token");
pub const PREFER: HeaderName = HeaderName::from_static("prefer"); pub const PREFER: HeaderName = HeaderName::from_static("prefer");
pub const PREFERENCE_APPLIED: HeaderName = HeaderName::from_static("preference-applied");
+10 -4
View File
@@ -1,21 +1,27 @@
#![cfg_attr(doc, doc = include_str!("../README.md"))] #![cfg_attr(doc, doc = include_str!("../README.md"))]
mod container;
mod error; mod error;
pub mod header; mod header;
pub mod middleware; pub mod middleware;
pub mod model; pub mod model;
mod prefer;
mod rdf_source; mod rdf_source;
mod resource; mod resource;
pub mod traverse; mod traverse;
pub mod vocab; pub mod vocab;
pub use http;
pub use oxigraph; pub use oxigraph;
pub use reqwest_middleware; pub use reqwest_middleware;
pub use reqwest_middleware::reqwest; pub use reqwest_middleware::reqwest;
pub use container::ContainerType;
pub use error::{Error, Result}; pub use error::{Error, Result};
pub use prefer::{Preference, header_for_preferences};
pub use rdf_source::{ pub use rdf_source::{
RdfSource, RdfSourceUpdateRequest, RdfSourceUpdateResponse, SerializationOptions, RdfSource, RdfSourceUpdateRequest, RdfSourceUpdateResponse, SerializationOptions,
}; };
pub use resource::{Resource, ResourceRequest, ResourceRequestBuilder, ResponseFormat}; pub use resource::{
Resource, ResourceRequest, ResourceRequestBuilder, ResourceType, ResponseFormat,
};
pub use traverse::Traverse;
+2
View File
@@ -1,3 +1,5 @@
//! This module contains functionality related to the content of RDF documents.
mod dataset; mod dataset;
#[cfg(feature = "keyed")] #[cfg(feature = "keyed")]
mod keyed_dataset; mod keyed_dataset;
+59
View File
@@ -0,0 +1,59 @@
use crate::vocab;
use http::{HeaderMap, HeaderValue};
use oxigraph::model::{NamedNode, NamedNodeRef};
/// [Request preferences](https://www.w3.org/TR/ldp/#prefer-parameters)
#[derive(Clone, Debug)]
pub enum Preference {
Containment,
Membership,
MinimalContainer,
Other(NamedNode),
}
impl Preference {
pub fn as_named_node_ref(&self) -> NamedNodeRef<'_> {
match self {
Preference::Containment => vocab::ldp::PREFER_CONTAINMENT,
Preference::Membership => vocab::ldp::PREFER_MEMBERSHIP,
Preference::MinimalContainer => vocab::ldp::PREFER_MINIMAL_CONTAINER,
Preference::Other(preference) => preference.as_ref(),
}
}
}
pub fn header_for_preferences<'a, I, J>(include: I, omit: J) -> crate::Result<HeaderMap>
where
I: IntoIterator<Item = &'a Preference>,
J: IntoIterator<Item = &'a Preference>,
{
let include_str = include
.into_iter()
.map(|preference| preference.as_named_node_ref().as_str().to_string())
.collect::<Vec<_>>()
.join(" ");
let omit_str = omit
.into_iter()
.map(|preference| preference.as_named_node_ref().as_str().to_string())
.collect::<Vec<_>>()
.join(" ");
let mut value = String::from("return=representation");
if !include_str.is_empty() {
value = format!("{value}; include=\"{include_str}\"");
}
if !omit_str.is_empty() {
value = format!("{value}; omit=\"{omit_str}\"");
}
let header_value =
HeaderValue::from_str(&value).expect("Failed to produce Prefer header value");
Ok(HeaderMap::from_iter([(
crate::header::PREFER,
header_value,
)]))
}
+29 -7
View File
@@ -1,3 +1,4 @@
use crate::resource::ResourceType;
use bytes::BufMut; use bytes::BufMut;
use http::{StatusCode, header}; use http::{StatusCode, header};
use oxigraph::io::{RdfFormat, RdfSerializer}; use oxigraph::io::{RdfFormat, RdfSerializer};
@@ -11,8 +12,11 @@ use reqwest_middleware::reqwest::Url;
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct RdfSource<D> { pub struct RdfSource<D> {
pub(crate) origin: Url, pub(crate) origin: Url,
pub(crate) described_by: Option<Url>, pub(crate) origin_type: Option<ResourceType>,
pub(crate) state_token: Option<String>, pub(crate) state_token: Option<String>,
pub(crate) described_by: Option<Url>,
pub(crate) file_name: Option<String>,
pub(crate) size: Option<usize>,
pub(crate) dataset: D, pub(crate) dataset: D,
} }
@@ -23,8 +27,11 @@ impl<D: Default> RdfSource<D> {
pub fn new(origin: Url) -> Self { pub fn new(origin: Url) -> Self {
Self { Self {
origin, origin,
described_by: None, origin_type: None,
state_token: None, state_token: None,
described_by: None,
file_name: None,
size: None,
dataset: Default::default(), dataset: Default::default(),
} }
} }
@@ -36,11 +43,9 @@ impl<D> RdfSource<D> {
&self.origin &self.origin
} }
/// The URL at which the RDF description of the resource is located. /// The type of Resource that was originally fetched.
/// pub fn origin_type(&self) -> Option<&ResourceType> {
/// This is the URL at which updates are submitted. self.origin_type.as_ref()
pub fn described_by(&self) -> Option<&Url> {
self.described_by.as_ref()
} }
/// The state token of the resource. /// The state token of the resource.
@@ -50,6 +55,23 @@ impl<D> RdfSource<D> {
self.state_token.as_deref() self.state_token.as_deref()
} }
/// The URL at which the RDF description of the resource is located.
///
/// This is the URL at which updates are submitted.
pub fn described_by(&self) -> Option<&Url> {
self.described_by.as_ref()
}
/// The name of the file that was originally fetched.
pub fn origin_file_name(&self) -> Option<&str> {
self.file_name.as_deref()
}
/// The size of the file that was originally fetched.
pub fn origin_size(&self) -> Option<usize> {
self.size
}
/// The underlying dataset. /// The underlying dataset.
pub fn dataset(&self) -> &D { pub fn dataset(&self) -> &D {
&self.dataset &self.dataset
+184 -14
View File
@@ -1,5 +1,6 @@
use crate::container::ContainerType;
use crate::rdf_source::RdfSource; use crate::rdf_source::RdfSource;
use crate::vocab; use crate::{Preference, prefer, vocab};
use bytes::Bytes; use bytes::Bytes;
use futures::Stream; use futures::Stream;
use http::Method; use http::Method;
@@ -7,6 +8,9 @@ use oxigraph::io::{RdfFormat, RdfParser};
use oxigraph::model::{GraphNameRef, NamedNodeRef, Quad}; use oxigraph::model::{GraphNameRef, NamedNodeRef, Quad};
use reqwest_middleware::reqwest::{Client, Response, StatusCode, Url, header}; use reqwest_middleware::reqwest::{Client, Response, StatusCode, Url, header};
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware, RequestBuilder}; use reqwest_middleware::{ClientBuilder, ClientWithMiddleware, RequestBuilder};
use sfv::{Item, TokenRef};
use std::collections::BTreeSet;
use std::str::FromStr;
use tracing::error; use tracing::error;
/// Builds an HTTP request for a [Resource](https://www.w3.org/TR/ldp/#ldpr). /// Builds an HTTP request for a [Resource](https://www.w3.org/TR/ldp/#ldpr).
@@ -37,6 +41,8 @@ pub struct ResourceRequestBuilder {
follow_described_by: bool, follow_described_by: bool,
validate_support: bool, validate_support: bool,
formats: Vec<RdfFormat>, formats: Vec<RdfFormat>,
include_preferences: Vec<Preference>,
omit_preferences: Vec<Preference>,
} }
impl ResourceRequestBuilder { impl ResourceRequestBuilder {
@@ -56,10 +62,17 @@ impl ResourceRequestBuilder {
follow_described_by: true, follow_described_by: true,
validate_support: true, validate_support: true,
formats: Vec::new(), formats: Vec::new(),
include_preferences: Vec::new(),
omit_preferences: Vec::new(),
} }
} }
/// If the HTTP response includes a [describedby](https://www.w3.org/TR/ldp/#link-relation-describedby) link rel, then it will be followed. /// If the HTTP response includes a [describedby](https://www.w3.org/TR/ldp/#link-relation-describedby)
/// link rel, then it will be followed. The original URL may be accessed using [`Resource::origin`],
/// and the link rel may be accessed using [`Resource::described_by`].
///
/// Note: If your intention is to fetch a NonRDFSource (e.g. a PDF, video, etc.), this value
/// must be `false`.
/// ///
/// Default value: `true`. /// Default value: `true`.
#[must_use] #[must_use]
@@ -102,6 +115,18 @@ impl ResourceRequestBuilder {
self self
} }
/// Include a representation preference according to [section 7.2](https://www.w3.org/TR/ldp/#prefer-parameters).
pub fn include_preference(mut self, preference: Preference) -> Self {
self.include_preferences.push(preference);
self
}
/// Omit a representation preference according to [section 7.2](https://www.w3.org/TR/ldp/#prefer-parameters).
pub fn omit_preference(mut self, preference: Preference) -> Self {
self.omit_preferences.push(preference);
self
}
/// Build the request. /// Build the request.
pub fn build(self) -> ResourceRequest { pub fn build(self) -> ResourceRequest {
ResourceRequest { builder: self } ResourceRequest { builder: self }
@@ -140,7 +165,7 @@ impl ResourceRequest {
if response.status() == StatusCode::OK { if response.status() == StatusCode::OK {
let headers = response.headers(); let headers = response.headers();
for link in headers.get_all(header::LINK) { for link in headers.get_all(header::LINK) {
let link = link.to_str().unwrap_or(""); let link = link.to_str().unwrap_or_default();
match parse_link_header::parse(link) { match parse_link_header::parse(link) {
Ok(link_map) => { Ok(link_map) => {
if let Some(metadata_url) = link_map.get(&Some("type".to_string())) { if let Some(metadata_url) = link_map.get(&Some("type".to_string())) {
@@ -157,6 +182,34 @@ impl ResourceRequest {
Err(crate::Error::LDPUnsupported) Err(crate::Error::LDPUnsupported)
} }
fn resource_type(response: &Response) -> Option<ResourceType> {
let headers = response.headers();
let links = headers
.get_all(header::LINK)
.iter()
.map(|hv| hv.to_str().unwrap_or_default())
.filter_map(|link| parse_link_header::parse_with_rel(link).ok())
.filter_map(|link_map| link_map.get("type").map(|item| item.raw_uri.clone()))
.collect::<BTreeSet<_>>();
// NB: The comparisons below must be done in this order, because multiple Link headers may
// be present with differing degrees of specificity. E.g. BasicContainer is more specific
// than RDFSource, but both are valid and may be present concomitantly.
if links.contains(vocab::ldp::BASIC_CONTAINER.as_str()) {
Some(ResourceType::RdfSource(Some(ContainerType::Basic)))
} else if links.contains(vocab::ldp::DIRECT_CONTAINER.as_str()) {
Some(ResourceType::RdfSource(Some(ContainerType::Direct)))
} else if links.contains(vocab::ldp::INDIRECT_CONTAINER.as_str()) {
Some(ResourceType::RdfSource(Some(ContainerType::Indirect)))
} else if links.contains(vocab::ldp::RDF_SOURCE.as_str()) {
Some(ResourceType::RdfSource(None))
} else if links.contains(vocab::ldp::NON_RDF_SOURCE.as_str()) {
Some(ResourceType::NonRdfSource)
} else {
None
}
}
fn add_media_types(&self, mut request_builder: RequestBuilder) -> RequestBuilder { fn add_media_types(&self, mut request_builder: RequestBuilder) -> RequestBuilder {
let media_types = self.builder.formats.iter().map(|f| f.media_type()); let media_types = self.builder.formats.iter().map(|f| f.media_type());
for media_type in media_types { for media_type in media_types {
@@ -180,13 +233,15 @@ impl ResourceRequest {
/// ///
/// There are two stages to this process. First, a `HEAD` request is made to determine whether /// There are two stages to this process. First, a `HEAD` request is made to determine whether
/// the requested resource is described by an RDF graph at another location. If it is, and if /// the requested resource is described by an RDF graph at another location. If it is, and if
/// the user permits it, then the URL in the /// the user [permits it](`ResourceRequestBuilder::follow_described_by`), then the URL in the
/// [describedby](https://www.w3.org/TR/ldp/#link-relation-describedby) header is used. /// [describedby](https://www.w3.org/TR/ldp/#link-relation-describedby) header is used.
/// Otherwise, the original URL is used. /// Otherwise, the original URL is used.
/// ///
/// During the second stage, a `GET` request is made. No parsing occurs at this time. /// During the second stage, a `GET` request is made. **The response body is not consumed yet.**
/// To consume the response body, you must call either [`Resource::into_stream`] to receive the
/// raw bytes or [`Resource::into_rdf_source`] to parse the content and receive a [`RdfSource`].
/// ///
/// If the `HEAD` method is not allowed on this URI (a violation of the LDP spec), the `Allow` /// If the `HEAD` method is not allowed on this URL (a violation of the LDP spec), the `Allow`
/// header is inspected for `GET`. If absent, this method will return an error. /// header is inspected for `GET`. If absent, this method will return an error.
pub async fn send(&self) -> crate::Result<Resource> { pub async fn send(&self) -> crate::Result<Resource> {
let request_builder = self.builder.client.head(self.builder.url.clone()); let request_builder = self.builder.client.head(self.builder.url.clone());
@@ -208,6 +263,36 @@ impl ResourceRequest {
} }
} }
let size = response
.headers()
.get(header::CONTENT_LENGTH)
.and_then(|hv| hv.to_str().ok())
.and_then(|et| usize::from_str(et).ok());
let content_disposition = response
.headers()
.get(header::CONTENT_DISPOSITION)
.and_then(|hv| hv.to_str().ok());
let file_name = if let Some(content_disposition) = content_disposition {
sfv::Parser::new(content_disposition)
.parse::<Item>()
.ok()
.and_then(|item| {
if item.bare_item.as_token() == Some(TokenRef::constant("attachment")) {
item.params
.get("filename")
.and_then(|item| item.as_string().map(|s| s.to_string()))
} else {
None
}
})
} else {
None
};
let resource_type = Self::resource_type(&response);
let url_to_get; let url_to_get;
let described_by = Self::extract_described_by(&response); let described_by = Self::extract_described_by(&response);
if let Some(new_url) = &described_by if let Some(new_url) = &described_by
@@ -221,6 +306,15 @@ impl ResourceRequest {
let mut request_builder = self.builder.client.get(url_to_get); let mut request_builder = self.builder.client.get(url_to_get);
request_builder = self.add_media_types(request_builder); request_builder = self.add_media_types(request_builder);
if !self.builder.include_preferences.is_empty() || !self.builder.omit_preferences.is_empty()
{
let header = prefer::header_for_preferences(
&self.builder.include_preferences,
&self.builder.omit_preferences,
)?;
request_builder = request_builder.headers(header);
}
response = request_builder.send().await?.error_for_status()?; response = request_builder.send().await?.error_for_status()?;
if self.builder.validate_support { if self.builder.validate_support {
@@ -249,12 +343,47 @@ impl ResourceRequest {
origin: self.builder.url.clone(), origin: self.builder.url.clone(),
described_by, described_by,
state_token, state_token,
resource_type,
format, format,
file_name,
size,
response, response,
}) })
} }
} }
/// The type of [Resource](https://www.w3.org/TR/ldp/#ldpr-resource).
#[derive(Clone, Debug, PartialEq)]
pub enum ResourceType {
NonRdfSource,
RdfSource(Option<ContainerType>),
}
impl ResourceType {
pub fn as_named_node_ref(&self) -> NamedNodeRef<'_> {
match self {
ResourceType::NonRdfSource => vocab::ldp::NON_RDF_SOURCE,
ResourceType::RdfSource(None) => vocab::ldp::RDF_SOURCE,
ResourceType::RdfSource(Some(container_type)) => container_type.as_named_node_ref(),
}
}
pub fn from_named_node_ref(node: NamedNodeRef<'_>) -> Option<Self> {
match node {
vocab::ldp::NON_RDF_SOURCE => Some(ResourceType::NonRdfSource),
vocab::ldp::RDF_SOURCE => Some(ResourceType::RdfSource(None)),
_ => {
let container_type = ContainerType::from_named_node_ref(node);
if container_type.is_some() {
Some(ResourceType::RdfSource(container_type))
} else {
None
}
}
}
}
}
/// The format of the response, as determined by the `Content-Type` HTTP header. /// The format of the response, as determined by the `Content-Type` HTTP header.
pub enum ResponseFormat { pub enum ResponseFormat {
RdfFormat(RdfFormat), RdfFormat(RdfFormat),
@@ -264,17 +393,20 @@ pub enum ResponseFormat {
/// A LDP [Resource](https://www.w3.org/TR/ldp/#ldpr). /// A LDP [Resource](https://www.w3.org/TR/ldp/#ldpr).
/// ///
/// A Resource on its own is not very useful, as it is a very abstract concept. If the intention is /// A Resource on its own is not very useful, as it is a very abstract concept. If your intention is
/// to treat the response as opaque data (such as a media file), call [`Resource::into_stream`]. In /// to treat the response as opaque data (such as a PDF or video file), call [`Resource::into_stream`].
/// the spec, this is equivalent to a [NonRDFSource](https://www.w3.org/TR/ldp/#ldpnr). /// In the spec, this is equivalent to a [NonRDFSource](https://www.w3.org/TR/ldp/#ldpnr).
/// ///
/// If the intention is to treat the response as RDF data to be parsed, call /// If your intention is to treat the response as RDF data to be parsed, call
/// [`Resource::into_rdf_source`]. /// [`Resource::into_rdf_source`].
pub struct Resource { pub struct Resource {
origin: Url, origin: Url,
described_by: Option<Url>, described_by: Option<Url>,
state_token: Option<String>, state_token: Option<String>,
resource_type: Option<ResourceType>,
format: ResponseFormat, format: ResponseFormat,
file_name: Option<String>,
size: Option<usize>,
response: Response, response: Response,
} }
@@ -291,24 +423,59 @@ impl Resource {
self.described_by.as_ref() self.described_by.as_ref()
} }
/// The format of the response. /// The format of the response, as reported by the `Content-Type` HTTP header.
pub fn format(&self) -> &ResponseFormat { pub fn format(&self) -> &ResponseFormat {
&self.format &self.format
} }
/// The size of the content, as reported by the `Content-Length` HTTP header.
///
/// Note: This value is extracted from the response headers of the HEAD request for the origin
/// URL.
pub fn size(&self) -> Option<usize> {
self.size
}
/// The file name of the content, as reported by the `Content-Disposition` HTTP header.
/// Example:
/// ```
/// Content-Disposition: attachment; filename="new-king-james-version-en.pdf"
/// ```
///
/// Note: This value is extracted from the response headers of the HEAD request for the origin
/// URL.
pub fn file_name(&self) -> Option<&str> {
self.file_name.as_deref()
}
/// The type of Resource, as reported by the `Link: <...> rel="type"` HTTP header.
///
/// Note: This value is extracted from the response headers of the HEAD request for the origin
/// URL.
pub fn resource_type(&self) -> Option<&ResourceType> {
self.resource_type.as_ref()
}
/// The state token, as extracted from the `X-State-Token` header. /// The state token, as extracted from the `X-State-Token` header.
/// ///
/// Note that this is a feature [specific to Fedora](https://fedora.info/2021/05/01/spec/#state-tokens). /// <div class="warning">
/// This is a feature specific to <a href="https://fedora.info/2021/05/01/spec/#state-tokens">Fedora</a>.
/// </div>
pub fn state_token(&self) -> Option<&String> { pub fn state_token(&self) -> Option<&String> {
self.state_token.as_ref() self.state_token.as_ref()
} }
/// Extract the response as a stream of unparsed bytes. /// Provide the response body as a stream of bytes.
pub fn into_stream(self) -> impl Stream<Item = reqwest_middleware::reqwest::Result<Bytes>> { pub fn into_stream(self) -> impl Stream<Item = reqwest_middleware::reqwest::Result<Bytes>> {
self.response.bytes_stream() self.response.bytes_stream()
} }
/// Parse the response. /// Parse the response.
///
/// The `D` type parameter can be any type capable of storing [`Quad`]s. If you intend to query
/// the dataset, use [`Dataset`](`oxigraph::model::Dataset`). If you want a stable ordering of the
/// quads, a [`KeyedDataset`](`crate::model::KeyedDataset`), [`Vec`], or similar data structure
/// may be used.
pub async fn into_rdf_source<D>(self) -> crate::Result<RdfSource<D>> pub async fn into_rdf_source<D>(self) -> crate::Result<RdfSource<D>>
where where
D: FromIterator<Quad>, D: FromIterator<Quad>,
@@ -322,8 +489,11 @@ impl Resource {
let dataset = quads.collect::<Result<_, _>>()?; let dataset = quads.collect::<Result<_, _>>()?;
Ok(RdfSource { Ok(RdfSource {
origin: self.origin, origin: self.origin,
described_by: self.described_by, origin_type: self.resource_type,
state_token: self.state_token, state_token: self.state_token,
described_by: self.described_by,
file_name: self.file_name,
size: self.size,
dataset, dataset,
}) })
} else { } else {
+19
View File
@@ -5,4 +5,23 @@ pub mod ldp {
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#contains"); NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#contains");
pub const RESOURCE: NamedNodeRef<'_> = pub const RESOURCE: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#Resource"); NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#Resource");
pub const NON_RDF_SOURCE: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#NonRDFSource");
pub const RDF_SOURCE: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#RDFSource");
pub const CONTAINER: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#Container");
pub const BASIC_CONTAINER: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#BasicContainer");
pub const DIRECT_CONTAINER: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#DirectContainer");
pub const INDIRECT_CONTAINER: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#IndirectContainer");
pub const PREFER_CONTAINMENT: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#PreferContainment");
pub const PREFER_MEMBERSHIP: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#PreferMembership");
pub const PREFER_MINIMAL_CONTAINER: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/ldp#PreferMinimalContainer");
} }