diff --git a/Cargo.lock b/Cargo.lock index dfb954b..ecdcba1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,60 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher", +] + +[[package]] +name = "aes-gcm" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher", + "opaque-debug", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -28,9 +82,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "assert-json-diff" @@ -49,8 +103,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +dependencies = [ + "concurrent-queue", + "event-listener 5.2.0", + "event-listener-strategy 0.5.0", "futures-core", + "pin-project-lite", ] [[package]] @@ -64,6 +131,126 @@ dependencies = [ "tokio", ] +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.3.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.2.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.2.0", + "async-executor", + "async-io 2.3.1", + "async-lock 3.3.0", + "blocking", + "futures-lite 2.2.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.5.0", + "rustix 0.38.31", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" + [[package]] name = "async-trait" version = "0.1.77" @@ -72,9 +259,15 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -96,18 +289,61 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base64" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.2.0", + "async-lock 3.3.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.2.0", + "piper", + "tracing", +] + +[[package]] +name = "bumpalo" +version = "3.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" + [[package]] name = "bytes" version = "1.5.0" @@ -116,12 +352,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" [[package]] name = "cfg-if" @@ -129,6 +362,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + [[package]] name = "concurrent-queue" version = "2.4.0" @@ -138,12 +380,69 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const_fn" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" + +[[package]] +name = "cookie" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" +dependencies = [ + "aes-gcm", + "base64", + "hkdf", + "hmac", + "percent-encoding", + "rand 0.8.5", + "sha2", + "time", + "version_check", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "cpuid-bool" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" + [[package]] name = "crossbeam-utils" version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +[[package]] +name = "crypto-mac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" +dependencies = [ + "cipher", +] + [[package]] name = "curl" version = "0.4.46" @@ -155,7 +454,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2", + "socket2 0.5.6", "windows-sys 0.52.0", ] @@ -167,7 +466,8 @@ dependencies = [ "curl", "derive-deref-rs", "futures", - "http", + "http 1.0.0", + "http-types", "log", "tempfile", "test-case", @@ -222,6 +522,21 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + [[package]] name = "equivalent" version = "1.0.1" @@ -244,6 +559,48 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.2.0", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -337,6 +694,19 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.30" @@ -345,7 +715,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -362,9 +732,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -384,6 +754,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -395,12 +775,45 @@ dependencies = [ "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "h2" version = "0.3.24" @@ -412,7 +825,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.11", "indexmap", "slab", "tokio", @@ -428,9 +841,29 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hkdf" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +dependencies = [ + "crypto-mac", + "digest", +] [[package]] name = "http" @@ -443,6 +876,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -450,7 +894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.11", "pin-project-lite", ] @@ -461,13 +905,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" dependencies = [ "anyhow", - "async-channel", + "async-channel 1.9.0", + "async-std", "base64", - "futures-lite", - "http", + "cookie", + "futures-lite 1.13.0", + "http 0.2.11", "infer", "pin-project-lite", - "rand", + "rand 0.7.3", "serde", "serde_json", "serde_qs", @@ -498,13 +944,13 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.11", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.6", "tokio", "tower-service", "tracing", @@ -523,9 +969,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "967d6dd42f16dbf0eb8040cb9e477933562684d3918f7d253f2ff9087fb3e7a3" dependencies = [ "equivalent", "hashbrown", @@ -546,12 +992,41 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itoa" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "js-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "libc" version = "0.2.153" @@ -570,6 +1045,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -578,9 +1059,12 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[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" +dependencies = [ + "value-bag", +] [[package]] name = "memchr" @@ -633,6 +1117,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "openssl-probe" version = "0.1.5" @@ -641,9 +1131,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", @@ -675,18 +1165,76 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "polyval" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" +dependencies = [ + "cpuid-bool", + "opaque-debug", + "universal-hash", +] + [[package]] name = "ppv-lite86" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.78" @@ -711,13 +1259,24 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.2.2", + "rand_core 0.5.1", "rand_hc", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -725,7 +1284,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", ] [[package]] @@ -734,7 +1303,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", ] [[package]] @@ -743,7 +1321,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", ] [[package]] @@ -787,24 +1365,47 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustix" version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "schannel" @@ -815,31 +1416,46 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -869,6 +1485,34 @@ dependencies = [ "serde", ] +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if", + "cpufeatures", + "digest", + "opaque-debug", +] + [[package]] name = "slab" version = "0.4.9" @@ -880,14 +1524,88 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "standback" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" +dependencies = [ + "version_check", +] + +[[package]] +name = "stdweb" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn 1.0.109", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn 1.0.109", ] +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + [[package]] name = "syn" version = "1.0.109" @@ -901,9 +1619,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -912,13 +1630,13 @@ dependencies = [ [[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 2.0.1", - "rustix", + "rustix 0.38.31", "windows-sys 0.52.0", ] @@ -940,7 +1658,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -951,7 +1669,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", "test-case-core", ] @@ -972,7 +1690,45 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "time" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" +dependencies = [ + "const_fn", + "libc", + "standback", + "stdweb", + "time-macros", + "version_check", + "winapi", +] + +[[package]] +name = "time-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" +dependencies = [ + "proc-macro-hack", + "time-macros-impl", +] + +[[package]] +name = "time-macros-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "standback", + "syn 1.0.109", ] [[package]] @@ -1001,7 +1757,7 @@ dependencies = [ "libc", "mio", "pin-project-lite", - "socket2", + "socket2 0.5.6", "tokio-macros", "windows-sys 0.48.0", ] @@ -1014,7 +1770,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1062,6 +1818,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -1076,13 +1838,23 @@ 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 = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + [[package]] name = "url" version = "2.5.0" @@ -1095,12 +1867,24 @@ dependencies = [ "serde", ] +[[package]] +name = "value-bag" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" + [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "waker-fn" version = "1.1.1" @@ -1128,6 +1912,104 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" + +[[package]] +name = "web-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-sys" version = "0.48.0" @@ -1143,7 +2025,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.4", ] [[package]] @@ -1163,17 +2045,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" 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.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -1184,9 +2066,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -1196,9 +2078,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -1208,9 +2090,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -1220,9 +2102,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -1232,9 +2114,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -1244,9 +2126,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -1256,9 +2138,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "wiremock" diff --git a/Cargo.toml b/Cargo.toml index 6c375a7..da59704 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,8 @@ readme = "README.md" async-curl = "0.3" curl = "0.4" derive-deref-rs = "0.1" -http = "0.2" +http = "1.0" +http-types = "2.12.0" log = "0.4" thiserror = "1.0" tokio = { version = "1.36", features = ["rt"] } diff --git a/examples/asynchronous.rs b/examples/asynchronous.rs index 6244581..611800a 100644 --- a/examples/asynchronous.rs +++ b/examples/asynchronous.rs @@ -1,8 +1,7 @@ use async_curl::actor::CurlActor; -use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; +use curl_http_client::{collector::Collector, http_client::HttpClient}; use futures::future; -use http::{HeaderMap, Method}; -use url::Url; +use http::{Method, Request}; #[tokio::main(flavor = "current_thread")] async fn main() { @@ -16,12 +15,11 @@ async fn main() { let handle = tokio::spawn(async move { let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: Url::parse("https://www.rust-lang.org/").unwrap(), - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri("https://www.rust-lang.org/") + .method(Method::GET) + .body(None) + .unwrap(); let response = HttpClient::new(collector) .request(request) diff --git a/examples/download.rs b/examples/download.rs index 5a8727c..072f098 100644 --- a/examples/download.rs +++ b/examples/download.rs @@ -4,10 +4,8 @@ use async_curl::actor::CurlActor; use curl_http_client::{ collector::{Collector, FileInfo}, http_client::HttpClient, - request::HttpRequest, }; -use http::{HeaderMap, Method}; -use url::Url; +use http::{Method, Request}; #[tokio::main(flavor = "current_thread")] async fn main() { @@ -15,12 +13,11 @@ async fn main() { let collector = Collector::File(FileInfo::path(PathBuf::from(""))); - let request = HttpRequest { - url: Url::parse("").unwrap(), - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri("") + .method(Method::GET) + .body(None) + .unwrap(); let response = HttpClient::new(collector) .request(request) diff --git a/examples/get.rs b/examples/get.rs index 73ceaa1..1f6cae3 100644 --- a/examples/get.rs +++ b/examples/get.rs @@ -1,19 +1,17 @@ use async_curl::actor::CurlActor; -use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; -use http::{HeaderMap, Method}; -use url::Url; +use curl_http_client::{collector::Collector, http_client::HttpClient}; +use http::{Method, Request}; #[tokio::main(flavor = "current_thread")] async fn main() { let actor = CurlActor::new(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: Url::parse("").unwrap(), - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri("") + .method(Method::GET) + .body(None) + .unwrap(); let response = HttpClient::new(collector) .request(request) diff --git a/examples/post.rs b/examples/post.rs index cc2b860..c7f33e8 100644 --- a/examples/post.rs +++ b/examples/post.rs @@ -1,19 +1,17 @@ use async_curl::actor::CurlActor; -use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; -use http::{HeaderMap, Method}; -use url::Url; +use curl_http_client::{collector::Collector, http_client::HttpClient}; +use http::{Method, Request}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { let actor = CurlActor::new(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: Url::parse("").unwrap(), - method: Method::POST, - headers: HeaderMap::new(), - body: Some("test body".as_bytes().to_vec()), - }; + let request = Request::builder() + .uri("") + .method(Method::POST) + .body(Some("test body".as_bytes().to_vec())) + .unwrap(); let response = HttpClient::new(collector) .request(request) diff --git a/examples/resume_download.rs b/examples/resume_download.rs index 13b9473..b04a233 100644 --- a/examples/resume_download.rs +++ b/examples/resume_download.rs @@ -5,10 +5,8 @@ use async_curl::actor::CurlActor; use curl_http_client::{ collector::{Collector, FileInfo}, http_client::{BytesOffset, HttpClient}, - request::HttpRequest, }; -use http::{HeaderMap, Method}; -use url::Url; +use http::{Method, Request}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { @@ -17,12 +15,11 @@ async fn main() -> Result<(), Box> { let collector = Collector::File(FileInfo::path(save_to.clone())); let partial_download_file_size = fs::metadata(save_to.as_path())?.len() as usize; - let request = HttpRequest { - url: Url::parse("").unwrap(), - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri("") + .method(Method::GET) + .body(None) + .unwrap(); let response = HttpClient::new(collector) .resume_from(BytesOffset::from(partial_download_file_size)) diff --git a/examples/upload.rs b/examples/upload.rs index 2702bec..1fa0909 100644 --- a/examples/upload.rs +++ b/examples/upload.rs @@ -4,10 +4,8 @@ use async_curl::actor::CurlActor; use curl_http_client::{ collector::{Collector, FileInfo}, http_client::{FileSize, HttpClient}, - request::HttpRequest, }; -use http::{HeaderMap, Method}; -use url::Url; +use http::{Method, Request}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { @@ -17,12 +15,11 @@ async fn main() -> Result<(), Box> { let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(file_to_be_uploaded)); - let request = HttpRequest { - url: Url::parse("").unwrap(), - method: Method::PUT, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri("") + .method(Method::PUT) + .body(None) + .unwrap(); let response = HttpClient::new(collector) .upload_file_size(FileSize::from(file_size)) diff --git a/src/http_client.rs b/src/http_client.rs index 7c19c37..a5a3ea5 100644 --- a/src/http_client.rs +++ b/src/http_client.rs @@ -5,13 +5,11 @@ use curl::easy::{Auth, Easy2, Handler, HttpVersion, ProxyType, SslVersion, TimeC use derive_deref_rs::Deref; use http::{ header::{CONTENT_LENGTH, CONTENT_TYPE}, - HeaderMap, HeaderValue, Method, StatusCode, + HeaderMap, HeaderValue, Method, Request, Response, }; use log::trace; -use crate::{ - collector::ExtendedHandler, error::Error, request::HttpRequest, response::HttpResponse, -}; +use crate::{collector::ExtendedHandler, error::Error}; /// Proceed to building state pub struct Build; @@ -79,14 +77,17 @@ where /// /// The HttpRequest can be customized by the caller by setting the Url, Method Type, /// Headers and the Body. - pub fn request(mut self, request: HttpRequest) -> Result> { - self.easy.url(&request.url.to_string()[..]).map_err(|e| { - trace!("{:?}", e); - Error::Curl(e) - })?; + pub fn request(mut self, request: Request>>) -> Result> { + self.easy + .url(request.uri().to_string().as_str()) + .map_err(|e| { + trace!("{:?}", e); + Error::Curl(e) + })?; let mut headers = curl::easy::List::new(); - request.headers.iter().try_for_each(|(name, value)| { + + request.headers().iter().try_for_each(|(name, value)| { headers .append(&format!( "{}: {}", @@ -108,15 +109,16 @@ where Error::Curl(e) })?; - match request.method { + match *request.method() { Method::POST => { self.easy.post(true).map_err(Error::Curl)?; - if let Some(body) = request.body { + + if let Some(body) = request.body() { self.easy.post_field_size(body.len() as u64).map_err(|e| { trace!("{:?}", e); Error::Curl(e) })?; - self.easy.post_fields_copy(body.as_slice()).map_err(|e| { + self.easy.post_fields_copy(body).map_err(|e| { trace!("{:?}", e); Error::Curl(e) })?; @@ -827,7 +829,7 @@ where } /// This will perform the curl operation asynchronously. - pub async fn perform(self) -> Result> { + pub async fn perform(self) -> Result>>, Error> { let easy = self.send_request().await?; let (data, headers) = easy.get_ref().get_response_body_and_headers(); @@ -875,14 +877,14 @@ where response_header }; - Ok(HttpResponse { - status_code: StatusCode::from_u16(status_code).map_err(|err| { - trace!("{:?}", err); - Error::Http(err.to_string()) - })?, - headers: response_header, - body: data, - }) + let mut response = Response::builder(); + for (name, value) in &response_header { + response = response.header(name, value); + } + + response = response.status(status_code); + + response.body(data).map_err(|e| Error::Http(e.to_string())) } } @@ -903,7 +905,7 @@ where } /// This will perform the curl operation synchronously. - pub fn perform(self) -> Result> { + pub fn perform(self) -> Result>>, Error> { let easy = self.send_request()?; let (data, headers) = easy.get_ref().get_response_body_and_headers(); @@ -951,14 +953,14 @@ where response_header }; - Ok(HttpResponse { - status_code: StatusCode::from_u16(status_code).map_err(|err| { - trace!("{:?}", err); - Error::Http(err.to_string()) - })?, - headers: response_header, - body: data, - }) + let mut response = Response::builder(); + for (name, value) in &response_header { + response = response.header(name, value); + } + + response = response.status(status_code); + + response.body(data).map_err(|e| Error::Http(e.to_string())) } } /// A strong type unit when setting download speed and upload speed diff --git a/src/lib.rs b/src/lib.rs index 3ca60f5..4ab15b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,8 +8,8 @@ //! ## Get Request //! ```rust,no_run //! use async_curl::actor::CurlActor; -//! use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; -//! use http::{HeaderMap, Method}; +//! use curl_http_client::{collector::Collector, http_client::HttpClient}; +//! use http::{Method, Request}; //! use url::Url; //! //! #[tokio::main(flavor = "current_thread")] @@ -17,12 +17,11 @@ //! let actor = CurlActor::new(); //! let collector = Collector::Ram(Vec::new()); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request).unwrap() @@ -37,8 +36,8 @@ //! ## Post Request //! ```rust,no_run //! use async_curl::actor::CurlActor; -//! use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; -//! use http::{HeaderMap, Method}; +//! use curl_http_client::{collector::Collector, http_client::HttpClient}; +//! use http::{Method, Request}; //! use url::Url; //! //! #[tokio::main(flavor = "current_thread")] @@ -46,12 +45,11 @@ //! let actor = CurlActor::new(); //! let collector = Collector::Ram(Vec::new()); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::POST, -//! headers: HeaderMap::new(), -//! body: Some("test body".as_bytes().to_vec()), -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::POST) +//! .body(Some("test body".as_bytes().to_vec())) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request).unwrap() @@ -71,9 +69,8 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::HttpClient, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{Method, Request}; //! use url::Url; //! //! #[tokio::main(flavor = "current_thread")] @@ -82,12 +79,11 @@ //! //! let collector = Collector::File(FileInfo::path(PathBuf::from(""))); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request) @@ -109,9 +105,8 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::{FileSize, HttpClient}, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! #[tokio::main(flavor = "current_thread")] @@ -122,12 +117,11 @@ //! let actor = CurlActor::new(); //! let collector = Collector::File(FileInfo::path(file_to_be_uploaded)); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::PUT, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::PUT) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .upload_file_size(FileSize::from(file_size)).unwrap() @@ -143,9 +137,9 @@ //! ## Concurrency //! ```rust,no_run //! use async_curl::actor::CurlActor; -//! use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; +//! use curl_http_client::{collector::Collector, http_client::HttpClient}; //! use futures::future; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! #[tokio::main(flavor = "current_thread")] @@ -160,12 +154,11 @@ //! //! let handle = tokio::spawn(async move { //! let collector = Collector::Ram(Vec::new()); -//! let request = HttpRequest { -//! url: Url::parse("https://www.rust-lang.org/").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("https://www.rust-lang.org/") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request) @@ -196,9 +189,8 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::{BytesOffset, HttpClient}, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! #[tokio::main(flavor = "current_thread")] @@ -208,12 +200,11 @@ //! let collector = Collector::File(FileInfo::path(save_to.clone())); //! //! let partial_download_file_size = fs::metadata(save_to.as_path()).unwrap().len() as usize; -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .resume_from(BytesOffset::from(partial_download_file_size)).unwrap() @@ -234,9 +225,8 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::HttpClient, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use tokio::sync::mpsc::channel; //! use url::Url; //! @@ -254,12 +244,11 @@ //! } //! }); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request).unwrap() @@ -281,9 +270,8 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::{FileSize, HttpClient}, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use tokio::sync::mpsc::channel; //! use url::Url; //! @@ -304,12 +292,11 @@ //! } //! }); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::PUT, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::PUT) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .upload_file_size(FileSize::from(file_size)).unwrap() @@ -326,18 +313,17 @@ //! # Synchronous Examples //! ## Get Request //! ```rust,no_run -//! use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; -//! use http::{HeaderMap, Method}; +//! use curl_http_client::{collector::Collector, http_client::HttpClient}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! let collector = Collector::Ram(Vec::new()); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request).unwrap() @@ -350,18 +336,17 @@ //! //! ## Post Request //! ```rust,no_run -//! use curl_http_client::{collector::Collector, http_client::HttpClient, request::HttpRequest}; -//! use http::{HeaderMap, Method}; +//! use curl_http_client::{collector::Collector, http_client::HttpClient}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! let collector = Collector::Ram(Vec::new()); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::POST, -//! headers: HeaderMap::new(), -//! body: Some("test body".as_bytes().to_vec()), -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::POST) +//! .body(Some("test body".as_bytes().to_vec())) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request).unwrap() @@ -379,19 +364,17 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::HttpClient, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! let collector = Collector::File(FileInfo::path(PathBuf::from(""))); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::GET, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::GET) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .request(request) @@ -410,21 +393,19 @@ //! use curl_http_client::{ //! collector::{Collector, FileInfo}, //! http_client::{FileSize, HttpClient}, -//! request::HttpRequest, //! }; -//! use http::{HeaderMap, Method}; +//! use http::{HeaderMap, Method, Request}; //! use url::Url; //! //! let file_to_be_uploaded = PathBuf::from(""); //! let file_size = fs::metadata(file_to_be_uploaded.as_path()).unwrap().len() as usize; //! let collector = Collector::File(FileInfo::path(file_to_be_uploaded)); //! -//! let request = HttpRequest { -//! url: Url::parse("").unwrap(), -//! method: Method::PUT, -//! headers: HeaderMap::new(), -//! body: None, -//! }; +//! let request = Request::builder() +//! .uri("") +//! .method(Method::PUT) +//! .body(None) +//! .unwrap(); //! //! let response = HttpClient::new(collector) //! .upload_file_size(FileSize::from(file_size)).unwrap() @@ -439,8 +420,6 @@ pub mod collector; pub mod error; pub mod http_client; -pub mod request; -pub mod response; pub mod dep { pub use curl; diff --git a/src/request.rs b/src/request.rs deleted file mode 100644 index 62e717f..0000000 --- a/src/request.rs +++ /dev/null @@ -1,17 +0,0 @@ -use http::HeaderMap; -use url::Url; - -/// An HTTP request. -#[derive(Clone, Debug)] -pub struct HttpRequest { - // These are all owned values so that the request can safely be passed between - // threads. - /// URL to which the HTTP request is being made. - pub url: Url, - /// HTTP request method for this request. - pub method: http::method::Method, - /// HTTP request headers to send. - pub headers: HeaderMap, - /// HTTP request body (typically for POST requests only). - pub body: Option>, -} diff --git a/src/response.rs b/src/response.rs deleted file mode 100644 index 7375841..0000000 --- a/src/response.rs +++ /dev/null @@ -1,12 +0,0 @@ -use http::{HeaderMap, StatusCode}; - -/// An HTTP response. -#[derive(Clone, Debug)] -pub struct HttpResponse { - /// HTTP status code returned by the server. - pub status_code: StatusCode, - /// HTTP response headers returned by the server. - pub headers: HeaderMap, - /// HTTP response body returned by the server. - pub body: Option>, -} diff --git a/src/test/asynchronous.rs b/src/test/asynchronous.rs index b9adaf8..1046183 100644 --- a/src/test/asynchronous.rs +++ b/src/test/asynchronous.rs @@ -1,11 +1,10 @@ use async_curl::actor::CurlActor; use futures::future; -use http::{HeaderMap, Method, StatusCode}; +use http::{Method, Request, StatusCode}; use url::Url; use crate::collector::Collector; use crate::http_client::HttpClient; -use crate::request::HttpRequest; use crate::test::test_setup::{setup_test_environment, MockResponder, ResponderType}; #[tokio::test] @@ -16,12 +15,12 @@ async fn test_across_multiple_threads() { let curl = CurlActor::new(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + const NUM_CONCURRENT: usize = 100; let mut handles = Vec::new(); @@ -38,8 +37,11 @@ async fn test_across_multiple_threads() { .await .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap(), "test body".as_bytes().to_vec()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!( + *response.body().as_ref().unwrap(), + "test body".as_bytes().to_vec() + ); }); handles.push(handle); } diff --git a/src/test/download.rs b/src/test/download.rs index cef2b7b..8b3955f 100644 --- a/src/test/download.rs +++ b/src/test/download.rs @@ -1,14 +1,13 @@ use std::fs; use async_curl::actor::CurlActor; -use http::{HeaderMap, Method, StatusCode}; +use http::{Method, Request, StatusCode}; use test_case::test_case; use tokio::sync::mpsc::channel; use url::Url; use crate::collector::{Collector, FileInfo}; use crate::http_client::{BytesOffset, BytesPerSec, HttpClient}; -use crate::request::HttpRequest; use crate::test::test_setup::{setup_test_environment, MockResponder, ResponderType}; #[tokio::test] @@ -20,12 +19,12 @@ async fn test_download() { let save_to = tempdir.path().join("downloaded_file.jpg"); let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(save_to.clone())); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -35,10 +34,10 @@ async fn test_download() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); assert_eq!(fs::read(save_to).unwrap(), include_bytes!("sample.jpg")); - assert!(!response.headers.is_empty()); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -50,12 +49,12 @@ async fn test_download_with_speed_control() { let save_to = tempdir.path().join("downloaded_file.jpg"); let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(save_to.clone())); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .download_speed(BytesPerSec::from(40000000)) .unwrap() @@ -67,10 +66,10 @@ async fn test_download_with_speed_control() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); assert_eq!(fs::read(save_to).unwrap(), include_bytes!("sample.jpg")); - assert!(!response.headers.is_empty()); + assert!(!response.headers().is_empty()); } #[test_case(4500, StatusCode::PARTIAL_CONTENT; "Offset 4500 bytes")] @@ -91,12 +90,12 @@ async fn test_resume_download(offset: usize, expected_status_code: StatusCode) { let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(save_to.clone())); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .resume_from(BytesOffset::from(partial_file_size)) .unwrap() @@ -108,10 +107,10 @@ async fn test_resume_download(offset: usize, expected_status_code: StatusCode) { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, expected_status_code); - assert_eq!(response.body, None); + assert_eq!(response.status(), expected_status_code); + assert_eq!(*response.body(), None); assert_eq!(fs::read(save_to).unwrap(), include_bytes!("sample.jpg")); - assert!(!response.headers.is_empty()); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -128,12 +127,11 @@ async fn test_download_with_transfer_speed_sender() { let file_info = FileInfo::path(save_to.clone()).with_transfer_speed_sender(tx); let collector = Collector::File(file_info); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); let handle = tokio::spawn(async move { while let Some(speed) = rx.recv().await { @@ -152,10 +150,10 @@ async fn test_download_with_transfer_speed_sender() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); assert_eq!(fs::read(save_to).unwrap(), include_bytes!("sample.jpg")); - assert!(!response.headers.is_empty()); + assert!(!response.headers().is_empty()); handle.abort(); } @@ -169,12 +167,12 @@ async fn test_download_with_headers() { let save_to = tempdir.path().join("downloaded_file.jpg"); let actor = CurlActor::new(); let collector = Collector::FileAndHeaders(FileInfo::path(save_to.clone()), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -184,8 +182,8 @@ async fn test_download_with_headers() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); assert_eq!(fs::read(save_to).unwrap(), include_bytes!("sample.jpg")); - assert!(!response.headers.is_empty()); + assert!(!response.headers().is_empty()); } diff --git a/src/test/get.rs b/src/test/get.rs index cca5adc..5d62f05 100644 --- a/src/test/get.rs +++ b/src/test/get.rs @@ -1,10 +1,9 @@ use async_curl::actor::CurlActor; -use http::{HeaderMap, Method, StatusCode}; +use http::{Method, Request, StatusCode}; use url::Url; use crate::collector::Collector; use crate::http_client::HttpClient; -use crate::request::HttpRequest; use crate::test::test_setup::{setup_test_environment, MockResponder, ResponderType}; #[tokio::test] @@ -15,12 +14,12 @@ async fn test_get() { let actor = CurlActor::new(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -30,9 +29,12 @@ async fn test_get() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap(), "test body".as_bytes().to_vec()); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!( + *response.body().as_ref().unwrap(), + "test body".as_bytes().to_vec() + ); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -43,12 +45,12 @@ async fn test_get_with_headers() { let actor = CurlActor::new(); let collector = Collector::RamAndHeaders(Vec::new(), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -58,9 +60,12 @@ async fn test_get_with_headers() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap(), "test body".as_bytes().to_vec()); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!( + *response.body().as_ref().unwrap(), + "test body".as_bytes().to_vec() + ); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -70,12 +75,12 @@ async fn test_get_sync() { let target_url = Url::parse(format!("{}/test", server.uri()).as_str()).unwrap(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -84,7 +89,10 @@ async fn test_get_sync() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap(), "test body".as_bytes().to_vec()); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!( + *response.body().as_ref().unwrap(), + "test body".as_bytes().to_vec() + ); + assert!(!response.headers().is_empty()); } diff --git a/src/test/headers.rs b/src/test/headers.rs index e499473..93b9449 100644 --- a/src/test/headers.rs +++ b/src/test/headers.rs @@ -1,12 +1,11 @@ use std::fs; use async_curl::actor::CurlActor; -use http::{HeaderMap, Method}; +use http::{Method, Request}; use url::Url; use crate::collector::{Collector, ExtendedHandler, FileInfo}; use crate::http_client::HttpClient; -use crate::request::HttpRequest; use crate::test::test_setup::{setup_test_environment, MockResponder, ResponderType}; #[tokio::test] @@ -17,12 +16,12 @@ async fn test_with_complete_headers_ram_and_header() { let actor = CurlActor::new(); let collector = Collector::RamAndHeaders(Vec::new(), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -51,12 +50,12 @@ async fn test_with_complete_headers_file_and_headers() { let save_to = tempdir.path().join("downloaded_file.jpg"); let actor = CurlActor::new(); let collector = Collector::FileAndHeaders(FileInfo::path(save_to.clone()), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -85,12 +84,12 @@ async fn test_with_complete_headers_ram() { let actor = CurlActor::new(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -119,12 +118,12 @@ async fn test_with_complete_headers_file() { let save_to = tempdir.path().join("downloaded_file.jpg"); let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(save_to.clone())); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -152,12 +151,12 @@ async fn test_with_complete_headers_ram_and_header_sync() { let target_url = Url::parse(format!("{}/test", server.uri()).as_str()).unwrap(); let collector = Collector::RamAndHeaders(Vec::new(), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::GET, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::GET) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() diff --git a/src/test/post.rs b/src/test/post.rs index 0c89ccf..2728427 100644 --- a/src/test/post.rs +++ b/src/test/post.rs @@ -1,10 +1,9 @@ use async_curl::actor::CurlActor; -use http::{HeaderMap, Method, StatusCode}; +use http::{Method, Request, StatusCode}; use url::Url; use crate::collector::Collector; use crate::http_client::HttpClient; -use crate::request::HttpRequest; use crate::test::test_setup::{setup_test_environment, MockResponder, ResponderType}; #[tokio::test] @@ -15,12 +14,12 @@ async fn test_post() { let actor = CurlActor::new(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::POST, - headers: HeaderMap::new(), - body: Some("test body".as_bytes().to_vec()), - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::POST) + .body(Some("test body".as_bytes().to_vec())) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -30,9 +29,10 @@ async fn test_post() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap().len(), 0); - assert!(!response.headers.is_empty()); + + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), Some(Vec::new())); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -43,12 +43,12 @@ async fn test_post_with_headers() { let actor = CurlActor::new(); let collector = Collector::RamAndHeaders(Vec::new(), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::POST, - headers: HeaderMap::new(), - body: Some("test body".as_bytes().to_vec()), - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::POST) + .body(Some("test body".as_bytes().to_vec())) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -58,9 +58,9 @@ async fn test_post_with_headers() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap().len(), 0); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), Some(Vec::new())); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -70,12 +70,12 @@ async fn test_post_sync() { let target_url = Url::parse(format!("{}/test", server.uri()).as_str()).unwrap(); let collector = Collector::Ram(Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::POST, - headers: HeaderMap::new(), - body: Some("test body".as_bytes().to_vec()), - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::POST) + .body(Some("test body".as_bytes().to_vec())) + .unwrap(); + let response = HttpClient::new(collector) .request(request) .unwrap() @@ -84,7 +84,7 @@ async fn test_post_sync() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body.unwrap().len(), 0); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), Some(Vec::new())); + assert!(!response.headers().is_empty()); } diff --git a/src/test/test_setup.rs b/src/test/test_setup.rs index 6e5831b..d2200a4 100644 --- a/src/test/test_setup.rs +++ b/src/test/test_setup.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use http::StatusCode; +use http_types::StatusCode; use tempfile::TempDir; use wiremock::{ http::{HeaderName, HeaderValue, HeaderValues, Method}, @@ -45,7 +45,7 @@ impl Respond for MockResponder { ); println!("Content-Range: {}", content_range); - ResponseTemplate::new(StatusCode::PARTIAL_CONTENT) + ResponseTemplate::new(StatusCode::PartialContent) .append_header( HeaderName::from_str("Content-Range").unwrap(), HeaderValue::from_str(content_range.as_str()).unwrap(), @@ -61,28 +61,28 @@ impl Respond for MockResponder { .set_body_bytes(&mock_file[offset..]) } else { let contents = include_bytes!("sample.jpg"); - ResponseTemplate::new(StatusCode::OK).set_body_bytes(contents.as_slice()) + ResponseTemplate::new(StatusCode::Ok).set_body_bytes(contents.as_slice()) } } ResponderType::Body(body) => { - ResponseTemplate::new(StatusCode::OK).set_body_bytes(body.as_slice()) + ResponseTemplate::new(StatusCode::Ok).set_body_bytes(body.as_slice()) } }, Method::Post => match &self.responder { - ResponderType::File => ResponseTemplate::new(StatusCode::OK), + ResponderType::File => ResponseTemplate::new(StatusCode::Ok), ResponderType::Body(body) => { assert_eq!(*body, request.body); - ResponseTemplate::new(StatusCode::OK) + ResponseTemplate::new(StatusCode::Ok) } }, Method::Put => match &self.responder { ResponderType::File => { assert_eq!(include_bytes!("sample.jpg").to_vec(), request.body); - ResponseTemplate::new(StatusCode::OK) + ResponseTemplate::new(StatusCode::Ok) } ResponderType::Body(body) => { assert_eq!(*body, request.body); - ResponseTemplate::new(StatusCode::OK) + ResponseTemplate::new(StatusCode::Ok) } }, _ => { diff --git a/src/test/upload.rs b/src/test/upload.rs index 49eeea7..0f095f7 100644 --- a/src/test/upload.rs +++ b/src/test/upload.rs @@ -1,13 +1,12 @@ use std::fs; use async_curl::actor::CurlActor; -use http::{HeaderMap, Method, StatusCode}; +use http::{Method, Request, StatusCode}; use tokio::sync::mpsc::channel; use url::Url; use crate::collector::{Collector, FileInfo}; use crate::http_client::{BytesPerSec, FileSize, HttpClient}; -use crate::request::HttpRequest; use crate::test::test_setup::{setup_test_environment, MockResponder, ResponderType}; #[tokio::test] @@ -22,12 +21,12 @@ async fn test_upload() { let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(to_be_uploaded)); - let request = HttpRequest { - url: target_url, - method: Method::PUT, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::PUT) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .upload_file_size(FileSize::from(file_size)) .unwrap() @@ -39,9 +38,9 @@ async fn test_upload() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -56,12 +55,12 @@ async fn test_upload_with_speed_control() { let actor = CurlActor::new(); let collector = Collector::File(FileInfo::path(to_be_uploaded)); - let request = HttpRequest { - url: target_url, - method: Method::PUT, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::PUT) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .upload_file_size(FileSize::from(file_size)) .unwrap() @@ -75,9 +74,9 @@ async fn test_upload_with_speed_control() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -97,12 +96,11 @@ async fn test_upload_with_transfer_speed_sender() { let file_info = FileInfo::path(to_be_uploaded).with_transfer_speed_sender(tx); let collector = Collector::File(file_info); - let request = HttpRequest { - url: target_url, - method: Method::PUT, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::PUT) + .body(None) + .unwrap(); let handle = tokio::spawn(async move { while let Some(speed) = rx.recv().await { @@ -123,9 +121,9 @@ async fn test_upload_with_transfer_speed_sender() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); + assert!(!response.headers().is_empty()); handle.abort(); } @@ -142,12 +140,12 @@ async fn test_upload_with_headers() { let actor = CurlActor::new(); let collector = Collector::FileAndHeaders(FileInfo::path(to_be_uploaded), Vec::new()); - let request = HttpRequest { - url: target_url, - method: Method::PUT, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::PUT) + .body(None) + .unwrap(); + let response = HttpClient::new(collector) .upload_file_size(FileSize::from(file_size)) .unwrap() @@ -159,9 +157,9 @@ async fn test_upload_with_headers() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); + assert!(!response.headers().is_empty()); } #[tokio::test] @@ -175,12 +173,11 @@ async fn test_upload_sync() { let file_size = fs::metadata(to_be_uploaded.as_path()).unwrap().len() as usize; let collector = Collector::File(FileInfo::path(to_be_uploaded)); - let request = HttpRequest { - url: target_url, - method: Method::PUT, - headers: HeaderMap::new(), - body: None, - }; + let request = Request::builder() + .uri(target_url.as_str()) + .method(Method::PUT) + .body(None) + .unwrap(); let response = HttpClient::new(collector) .upload_file_size(FileSize::from(file_size)) .unwrap() @@ -191,7 +188,7 @@ async fn test_upload_sync() { .unwrap(); println!("Response: {:?}", response); - assert_eq!(response.status_code, StatusCode::OK); - assert_eq!(response.body, None); - assert!(!response.headers.is_empty()); + assert_eq!(response.status(), StatusCode::OK); + assert_eq!(*response.body(), None); + assert!(!response.headers().is_empty()); }