diff --git a/CHANGELOG.md b/CHANGELOG.md index 02bba711..29c64693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,55 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [Unreleased] + +## [0.4.0] - 2026-11-20 + +### Added + +- `eggfetch-core`: a URL-free native request builder. `Client::get_uri`, + `Client::post_uri`, and `Client::request_uri` accept an already-parsed + `http::Uri` and return a `NativeRequestBuilder`, which is available in + every profile. A consumer on the minimal native slice can now build and + dispatch a request without the `url`/`idna`/ICU closure that + `high-level-url` pulls in. The builder dispatches through the same + frame-preserving transport as `Client::execute_http_body`: exactly one + attempt, no redirects, no logical retries, no cookies, no authentication, + no response decompression, and no decoded-body limits. The caller owns + IDNA/punycode conversion before constructing the URI. The native builder + is a separate type from the high-level `RequestBuilder` so the existing + high-level signatures are unchanged. +- `eggfetch-core`: `RequestBuilder::without_retry()` and + `RequestBuilder::redirect_policy()` are available in every profile. + Both are disable switches, so a caller must be able to express "this + request is not retried" and "this request does not follow redirects" even + where the corresponding capability is compiled out. + `RedirectPolicy`/`RedirectDowngradePolicy` are therefore available in + every profile too. With `logical-retry`/`redirects` enabled the values + are honored exactly as before; without them the capability is already + absent, so the setter is a semantic no-op. The backing state is an + always-present `Request::retry_disabled` flag that the gated retry loop + consults, and a request-level `Option`. +- `eggfetch-core`: `RequestBody` implements `http_body::Body`, so a + request body can be handed to any `http-body`-based API. + +### Changed + +- `eggfetch-core`: the `proxy` feature now selects `native-http1` + instead of the `http1` alias. A consumer that wants eggfetch's proxy + support no longer also compiles in the `logical-retry`, `redirects`, and + `basic-auth` policy bundle, which the proxy transport does not use. + Proxy auth keeps its own `base64` edge, so `Proxy-Authorization` + encoding is unchanged. The default feature set and the `http1`/`http2` + aliases are unchanged, so the CLI and Python adapters are unaffected. +- `eggfetch-ffi`: the `eggfetch-core` dependency now names `redirects` and + `basic-auth` explicitly. The C ABI exports + `eggfetch_client_builder_follow_redirects`, `..._max_redirects` and + `..._basic_auth` unconditionally, and those capabilities used to arrive only + through the old `proxy` implication. Default builds are unchanged; this + repairs non-default configurations such as + `--no-default-features --features proxy`, which otherwise stopped compiling. + ## [0.3.0] - 2026-10-30 ### Added @@ -326,7 +375,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Multipart boundary validation - Proxy authentication boundary enforcement -[Unreleased]: https://github.com/eggstack/eggfetch/compare/v0.3.0...HEAD +[Unreleased]: https://github.com/eggstack/eggfetch/compare/v0.4.0...HEAD +[0.4.0]: https://github.com/eggstack/eggfetch/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/eggstack/eggfetch/compare/v0.2.2...v0.3.0 [0.2.2]: https://github.com/eggstack/eggfetch/releases/tag/v0.2.2 [0.2.1]: https://github.com/eggstack/eggfetch/releases/tag/v0.2.1 diff --git a/Cargo.lock b/Cargo.lock index 40d0fa87..80f526a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -505,7 +505,7 @@ dependencies = [ [[package]] name = "eggfetch-cli" -version = "0.3.0" +version = "0.4.0" dependencies = [ "anyhow", "bytes", @@ -527,7 +527,7 @@ dependencies = [ [[package]] name = "eggfetch-core" -version = "0.3.0" +version = "0.4.0" dependencies = [ "async-compression", "base64 0.23.1", @@ -573,7 +573,7 @@ dependencies = [ [[package]] name = "eggfetch-ffi" -version = "0.3.0" +version = "0.4.0" dependencies = [ "bytes", "eggfetch-core", @@ -585,7 +585,7 @@ dependencies = [ [[package]] name = "eggfetch-http-connect" -version = "0.3.0" +version = "0.4.0" dependencies = [ "base64 0.23.1", "thiserror", @@ -594,7 +594,7 @@ dependencies = [ [[package]] name = "eggfetch-node" -version = "0.3.0" +version = "0.4.0" dependencies = [ "eggfetch-ffi", "napi", @@ -606,7 +606,7 @@ dependencies = [ [[package]] name = "eggfetch-python" -version = "0.3.0" +version = "0.4.0" dependencies = [ "bytes", "eggfetch-core", diff --git a/README.md b/README.md index ed625b75..7063c0bc 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ eggfetch is a Rust-native async HTTP client engine (tokio + hyper) with Python b - **Proxy**: HTTP forwarding, HTTPS CONNECT, proxy auth, `NO_PROXY`, SOCKS5 ([proxy](docs/concepts/proxy.md)) - **Cookies, auth, multipart, compression**: RFC 6265 jar, Basic/Bearer, streaming uploads, gzip/brotli/zstd/deflate - **Retries and redirects**: backoff with `Retry-After`, replayable-body redirect handling +- **URL-free native builder**: `Client::get_uri`/`post_uri`/`request_uri` build from an `http::Uri` in every feature profile, for embeddings that omit `url`/IDNA/ICU - **Python**: requests/HTTPX-compatible sync and async APIs plus versioned `eggfetch.compat.httpx` (0.28.1) and `eggfetch.compat.httpx2` (2.12.0) facades ([compatibility](docs/reference/compatibility.md)) - **CLI** with streaming output, machine-readable formats, and shell completions ([guide](docs/cli/guide.md)) diff --git a/compat/downstream/README.md b/compat/downstream/README.md index 363c239b..a620068e 100644 --- a/compat/downstream/README.md +++ b/compat/downstream/README.md @@ -52,10 +52,21 @@ EGGFETCH_COMPAT_REQUIRED=1 pytest crates/eggfetch-python/tests/compat/test_downs ### Install all downstream packages for manual testing ```bash -pip install httpx==0.28.1 respx==0.21.1 pytest-httpx==0.30.0 starlette==0.37.2 -pip install anthropic==0.39.0 groq==0.13.0 httpx-sse==0.4.0 httpcore==1.0.5 -pip install anyio==4.8.0 httpx-auth==0.22.0 httpx-ws==0.7.0 pydantic==2.10.0 +pip install -r compat/httpx/0.28.1/requirements.txt +pip install -r compat/httpx2/2.12.0/requirements.txt ``` +Those two files are the canonical pins the compatibility profiles use; install +from them rather than from a hand-written list so the versions cannot drift +away from what the gates actually run. + +### Prerequisites for the artifact producer +`python scripts/build_downstream_artifact.py` builds both wheels, so the +interpreter it runs under needs `maturin` (for the eggfetch wheel) and +`build` + `setuptools` (for the controlled HTTPX replacement, per +`compat/httpx-controlled-replacement/build.sh`). In a fresh virtual +environment the second pair is not installed by +`scripts/ci-requirements.txt`, and the producer fails with +`No module named build`. ## Isolation Requirements diff --git a/compat/rust-public-api/README.md b/compat/rust-public-api/README.md index e348b536..94332a51 100644 --- a/compat/rust-public-api/README.md +++ b/compat/rust-public-api/README.md @@ -1,7 +1,7 @@ # Rust public API oracle These snapshots freeze the supported `eggfetch-core` Rust surface at planning -baseline `03ecba973010e2858bf16a2b5f84d51ce70adae4`. They are verification +baseline `05f14f442dba697d7c140ead552e87f126ceac6b`. They are verification artifacts, not an additional supported API or a source of feature semantics. The generator is `cargo-public-api 0.52.0`, run with the pinned repository diff --git a/compat/rust-public-api/all-features.txt b/compat/rust-public-api/all-features.txt index f7ae876e..1323b122 100644 --- a/compat/rust-public-api/all-features.txt +++ b/compat/rust-public-api/all-features.txt @@ -57,6 +57,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -105,14 +111,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -431,6 +440,22 @@ pub fn eggfetch_core::multipart::Part::new(impl core::convert::Into, impl core::convert::TryInto) -> eggfetch_core::error::Result impl core::fmt::Debug for eggfetch_core::multipart::Part pub fn eggfetch_core::multipart::Part::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -645,6 +670,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -662,6 +688,7 @@ pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::opti pub fn eggfetch_core::request::Request::set_proxy_override(&mut self, eggfetch_core::request::ProxyOverride) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -1505,6 +1532,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1614,14 +1647,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -1815,6 +1851,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1934,6 +1985,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -1951,6 +2003,7 @@ pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::opti pub fn eggfetch_core::request::Request::set_proxy_override(&mut self, eggfetch_core::request::ProxyOverride) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) diff --git a/compat/rust-public-api/default.txt b/compat/rust-public-api/default.txt index 277e2e0f..34e75529 100644 --- a/compat/rust-public-api/default.txt +++ b/compat/rust-public-api/default.txt @@ -57,6 +57,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -104,14 +110,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -322,6 +331,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -451,6 +476,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -466,6 +492,7 @@ pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, c pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -1198,6 +1225,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1299,14 +1332,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -1451,6 +1487,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1505,6 +1556,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -1520,6 +1572,7 @@ pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, c pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) diff --git a/compat/rust-public-api/http1-tls-rustls.txt b/compat/rust-public-api/http1-tls-rustls.txt index 277e2e0f..34e75529 100644 --- a/compat/rust-public-api/http1-tls-rustls.txt +++ b/compat/rust-public-api/http1-tls-rustls.txt @@ -57,6 +57,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -104,14 +110,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -322,6 +331,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -451,6 +476,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -466,6 +492,7 @@ pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, c pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -1198,6 +1225,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1299,14 +1332,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -1451,6 +1487,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1505,6 +1556,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -1520,6 +1572,7 @@ pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, c pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) diff --git a/compat/rust-public-api/http2-tls-rustls.txt b/compat/rust-public-api/http2-tls-rustls.txt index 277e2e0f..34e75529 100644 --- a/compat/rust-public-api/http2-tls-rustls.txt +++ b/compat/rust-public-api/http2-tls-rustls.txt @@ -57,6 +57,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -104,14 +110,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -322,6 +331,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -451,6 +476,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -466,6 +492,7 @@ pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, c pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -1198,6 +1225,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1299,14 +1332,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -1451,6 +1487,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1505,6 +1556,7 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method @@ -1520,6 +1572,7 @@ pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, c pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_retry(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) diff --git a/compat/rust-public-api/native-http1-tls-rustls.txt b/compat/rust-public-api/native-http1-tls-rustls.txt index 3f5b5b01..1b23348b 100644 --- a/compat/rust-public-api/native-http1-tls-rustls.txt +++ b/compat/rust-public-api/native-http1-tls-rustls.txt @@ -47,6 +47,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -92,8 +98,11 @@ impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::builder() -> eggfetch_core::client::ClientBuilder pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::native_service(&self) -> eggfetch_core::service::NativeHttpService @@ -298,6 +307,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -384,6 +409,23 @@ pub const eggfetch_core::redact::SENSITIVE_HEADERS: &[&str] pub fn eggfetch_core::redact::is_sensitive_header(&str) -> bool pub fn eggfetch_core::redact::redact_headers(&http::header::map::HeaderMap) -> http::header::map::HeaderMap pub fn eggfetch_core::redact::redact_url_string(&str) -> alloc::string::String +pub mod eggfetch_core::redirect +pub enum eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectDowngradePolicy::Allow +pub eggfetch_core::redirect::RedirectDowngradePolicy::Deny +pub struct eggfetch_core::redirect::RedirectPolicy +pub eggfetch_core::redirect::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectPolicy::follow: bool +pub eggfetch_core::redirect::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self +pub fn eggfetch_core::redirect::drops_body_on_redirect(http::status::StatusCode, &http::method::Method) -> bool +pub fn eggfetch_core::redirect::is_redirect_status(http::status::StatusCode) -> bool +pub fn eggfetch_core::redirect::redirect_method(http::status::StatusCode, &http::method::Method) -> http::method::Method pub mod eggfetch_core::service pub struct eggfetch_core::service::NativeHttpService impl eggfetch_core::service::NativeHttpService @@ -915,6 +957,9 @@ pub fn eggfetch_core::network_stream::NetworkStream::as_upgraded_mut(&mut self) pub fn eggfetch_core::network_stream::NetworkStream::into_upgraded(self) -> core::option::Option pub fn eggfetch_core::network_stream::NetworkStream::is_upgraded(&self) -> bool pub fn eggfetch_core::network_stream::NetworkStream::metadata(&self) -> &alloc::sync::Arc +pub enum eggfetch_core::RedirectDowngradePolicy +pub eggfetch_core::RedirectDowngradePolicy::Allow +pub eggfetch_core::RedirectDowngradePolicy::Deny pub enum eggfetch_core::RequestBody pub eggfetch_core::RequestBody::Bytes(bytes::bytes::Bytes) pub eggfetch_core::RequestBody::Empty @@ -942,6 +987,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1019,8 +1070,11 @@ impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::builder() -> eggfetch_core::client::ClientBuilder pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::native_service(&self) -> eggfetch_core::service::NativeHttpService @@ -1142,6 +1196,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1177,6 +1246,16 @@ pub eggfetch_core::PoolConfig::max_in_flight_requests: core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub struct eggfetch_core::RedirectPolicy +pub eggfetch_core::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::RedirectPolicy::follow: bool +pub eggfetch_core::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self pub struct eggfetch_core::RequestFailure impl eggfetch_core::error::RequestFailure pub fn eggfetch_core::error::RequestFailure::error(&self) -> &eggfetch_core::error::Error diff --git a/compat/rust-public-api/native-http2-tls-rustls.txt b/compat/rust-public-api/native-http2-tls-rustls.txt index 3f5b5b01..1b23348b 100644 --- a/compat/rust-public-api/native-http2-tls-rustls.txt +++ b/compat/rust-public-api/native-http2-tls-rustls.txt @@ -47,6 +47,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -92,8 +98,11 @@ impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::builder() -> eggfetch_core::client::ClientBuilder pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::native_service(&self) -> eggfetch_core::service::NativeHttpService @@ -298,6 +307,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -384,6 +409,23 @@ pub const eggfetch_core::redact::SENSITIVE_HEADERS: &[&str] pub fn eggfetch_core::redact::is_sensitive_header(&str) -> bool pub fn eggfetch_core::redact::redact_headers(&http::header::map::HeaderMap) -> http::header::map::HeaderMap pub fn eggfetch_core::redact::redact_url_string(&str) -> alloc::string::String +pub mod eggfetch_core::redirect +pub enum eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectDowngradePolicy::Allow +pub eggfetch_core::redirect::RedirectDowngradePolicy::Deny +pub struct eggfetch_core::redirect::RedirectPolicy +pub eggfetch_core::redirect::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectPolicy::follow: bool +pub eggfetch_core::redirect::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self +pub fn eggfetch_core::redirect::drops_body_on_redirect(http::status::StatusCode, &http::method::Method) -> bool +pub fn eggfetch_core::redirect::is_redirect_status(http::status::StatusCode) -> bool +pub fn eggfetch_core::redirect::redirect_method(http::status::StatusCode, &http::method::Method) -> http::method::Method pub mod eggfetch_core::service pub struct eggfetch_core::service::NativeHttpService impl eggfetch_core::service::NativeHttpService @@ -915,6 +957,9 @@ pub fn eggfetch_core::network_stream::NetworkStream::as_upgraded_mut(&mut self) pub fn eggfetch_core::network_stream::NetworkStream::into_upgraded(self) -> core::option::Option pub fn eggfetch_core::network_stream::NetworkStream::is_upgraded(&self) -> bool pub fn eggfetch_core::network_stream::NetworkStream::metadata(&self) -> &alloc::sync::Arc +pub enum eggfetch_core::RedirectDowngradePolicy +pub eggfetch_core::RedirectDowngradePolicy::Allow +pub eggfetch_core::RedirectDowngradePolicy::Deny pub enum eggfetch_core::RequestBody pub eggfetch_core::RequestBody::Bytes(bytes::bytes::Bytes) pub eggfetch_core::RequestBody::Empty @@ -942,6 +987,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1019,8 +1070,11 @@ impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::builder() -> eggfetch_core::client::ClientBuilder pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client pub fn eggfetch_core::client::Client::native_service(&self) -> eggfetch_core::service::NativeHttpService @@ -1142,6 +1196,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1177,6 +1246,16 @@ pub eggfetch_core::PoolConfig::max_in_flight_requests: core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub struct eggfetch_core::RedirectPolicy +pub eggfetch_core::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::RedirectPolicy::follow: bool +pub eggfetch_core::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self pub struct eggfetch_core::RequestFailure impl eggfetch_core::error::RequestFailure pub fn eggfetch_core::error::RequestFailure::error(&self) -> &eggfetch_core::error::Error diff --git a/compat/rust-public-api/standard-http1-tls-rustls.txt b/compat/rust-public-api/standard-http1-tls-rustls.txt index 17a64f15..1a63c13f 100644 --- a/compat/rust-public-api/standard-http1-tls-rustls.txt +++ b/compat/rust-public-api/standard-http1-tls-rustls.txt @@ -47,6 +47,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -94,14 +100,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -303,6 +312,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -390,6 +415,28 @@ pub fn eggfetch_core::redact::is_sensitive_header(&str) -> bool pub fn eggfetch_core::redact::redact_headers(&http::header::map::HeaderMap) -> http::header::map::HeaderMap pub fn eggfetch_core::redact::redact_url(&url::Url) -> alloc::string::String pub fn eggfetch_core::redact::redact_url_string(&str) -> alloc::string::String +pub mod eggfetch_core::redirect +pub enum eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectDowngradePolicy::Allow +pub eggfetch_core::redirect::RedirectDowngradePolicy::Deny +pub struct eggfetch_core::redirect::RedirectPolicy +pub eggfetch_core::redirect::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectPolicy::follow: bool +pub eggfetch_core::redirect::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::check_downgrade(&self, &url::Url, &url::Url) -> eggfetch_core::error::Result<()> +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self +pub fn eggfetch_core::redirect::build_redirect_request(&eggfetch_core::request::Request, http::status::StatusCode, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::redirect::build_redirect_request_with_redirect_policy(&eggfetch_core::request::Request, http::status::StatusCode, &str, &eggfetch_core::redirect::RedirectPolicy) -> eggfetch_core::error::Result +pub fn eggfetch_core::redirect::check_https_downgrade(&url::Url, &url::Url, eggfetch_core::redirect::RedirectDowngradePolicy) -> eggfetch_core::error::Result<()> +pub fn eggfetch_core::redirect::drops_body_on_redirect(http::status::StatusCode, &http::method::Method) -> bool +pub fn eggfetch_core::redirect::is_https_downgrade(&url::Url, &url::Url) -> bool +pub fn eggfetch_core::redirect::is_redirect_status(http::status::StatusCode) -> bool +pub fn eggfetch_core::redirect::redirect_method(http::status::StatusCode, &http::method::Method) -> http::method::Method pub mod eggfetch_core::request pub enum eggfetch_core::request::ProxyOverride pub eggfetch_core::request::ProxyOverride::Direct @@ -410,10 +457,12 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method pub fn eggfetch_core::request::Request::proxied_target(&self) -> core::option::Option<&eggfetch_core::transport_hints::ResolvedTarget> +pub fn eggfetch_core::request::Request::redirect(&self) -> core::option::Option<&eggfetch_core::redirect::RedirectPolicy> pub fn eggfetch_core::request::Request::set_auth(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_auth_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_body(&mut self, eggfetch_core::body::RequestBody) @@ -421,6 +470,8 @@ pub fn eggfetch_core::request::Request::set_decompress(&mut self, core::option:: pub fn eggfetch_core::request::Request::set_max_decoded_body_size(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -443,11 +494,13 @@ pub fn eggfetch_core::request::RequestBuilder::max_decoded_body_size(self, usize pub fn eggfetch_core::request::RequestBuilder::max_decompression_ratio(self, f64) -> Self pub fn eggfetch_core::request::RequestBuilder::proxy_target_addresses(self, I) -> Self where I: core::iter::traits::collect::IntoIterator pub fn eggfetch_core::request::RequestBuilder::query(self, &str, &str) -> Self +pub fn eggfetch_core::request::RequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self pub async fn eggfetch_core::request::RequestBuilder::send(self) -> eggfetch_core::error::Result pub async fn eggfetch_core::request::RequestBuilder::send_detailed(self) -> core::result::Result pub fn eggfetch_core::request::RequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self pub fn eggfetch_core::request::RequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self pub fn eggfetch_core::request::RequestBuilder::without_auth(self) -> Self +pub fn eggfetch_core::request::RequestBuilder::without_retry(self) -> Self pub struct eggfetch_core::request::ResolvedTarget impl eggfetch_core::transport_hints::ResolvedTarget pub fn eggfetch_core::transport_hints::ResolvedTarget::addresses(&self) -> &[core::net::socket_addr::SocketAddr] @@ -1026,6 +1079,9 @@ pub fn eggfetch_core::network_stream::NetworkStream::metadata(&self) -> &alloc:: pub enum eggfetch_core::ProxyOverride pub eggfetch_core::ProxyOverride::Direct pub eggfetch_core::ProxyOverride::Inherit +pub enum eggfetch_core::RedirectDowngradePolicy +pub eggfetch_core::RedirectDowngradePolicy::Allow +pub eggfetch_core::RedirectDowngradePolicy::Deny pub enum eggfetch_core::RequestBody pub eggfetch_core::RequestBody::Bytes(bytes::bytes::Bytes) pub eggfetch_core::RequestBody::Empty @@ -1053,6 +1109,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1127,14 +1189,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -1241,6 +1306,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1276,6 +1356,17 @@ pub eggfetch_core::PoolConfig::max_in_flight_requests: core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub struct eggfetch_core::RedirectPolicy +pub eggfetch_core::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::RedirectPolicy::follow: bool +pub eggfetch_core::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::check_downgrade(&self, &url::Url, &url::Url) -> eggfetch_core::error::Result<()> +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self pub struct eggfetch_core::Request impl eggfetch_core::request::Request pub fn eggfetch_core::request::Request::auth(&self) -> core::option::Option<&eggfetch_core::auth::AuthScheme> @@ -1284,10 +1375,12 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method pub fn eggfetch_core::request::Request::proxied_target(&self) -> core::option::Option<&eggfetch_core::transport_hints::ResolvedTarget> +pub fn eggfetch_core::request::Request::redirect(&self) -> core::option::Option<&eggfetch_core::redirect::RedirectPolicy> pub fn eggfetch_core::request::Request::set_auth(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_auth_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_body(&mut self, eggfetch_core::body::RequestBody) @@ -1295,6 +1388,8 @@ pub fn eggfetch_core::request::Request::set_decompress(&mut self, core::option:: pub fn eggfetch_core::request::Request::set_max_decoded_body_size(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -1317,11 +1412,13 @@ pub fn eggfetch_core::request::RequestBuilder::max_decoded_body_size(self, usize pub fn eggfetch_core::request::RequestBuilder::max_decompression_ratio(self, f64) -> Self pub fn eggfetch_core::request::RequestBuilder::proxy_target_addresses(self, I) -> Self where I: core::iter::traits::collect::IntoIterator pub fn eggfetch_core::request::RequestBuilder::query(self, &str, &str) -> Self +pub fn eggfetch_core::request::RequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self pub async fn eggfetch_core::request::RequestBuilder::send(self) -> eggfetch_core::error::Result pub async fn eggfetch_core::request::RequestBuilder::send_detailed(self) -> core::result::Result pub fn eggfetch_core::request::RequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self pub fn eggfetch_core::request::RequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self pub fn eggfetch_core::request::RequestBuilder::without_auth(self) -> Self +pub fn eggfetch_core::request::RequestBuilder::without_retry(self) -> Self pub struct eggfetch_core::RequestFailure impl eggfetch_core::error::RequestFailure pub fn eggfetch_core::error::RequestFailure::error(&self) -> &eggfetch_core::error::Error diff --git a/compat/rust-public-api/standard-http2-tls-rustls.txt b/compat/rust-public-api/standard-http2-tls-rustls.txt index 17a64f15..1a63c13f 100644 --- a/compat/rust-public-api/standard-http2-tls-rustls.txt +++ b/compat/rust-public-api/standard-http2-tls-rustls.txt @@ -47,6 +47,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::body::ResponseBody pub eggfetch_core::body::ResponseBody::Buffered pub eggfetch_core::body::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -94,14 +100,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -303,6 +312,22 @@ pub fn eggfetch_core::limits::Limits::effective_max_in_flight(&self) -> core::op pub fn eggfetch_core::limits::Limits::effective_max_in_flight_per_origin(&self) -> core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub mod eggfetch_core::native_request +pub struct eggfetch_core::native_request::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub mod eggfetch_core::network_stream pub enum eggfetch_core::network_stream::NetworkStream pub eggfetch_core::network_stream::NetworkStream::Metadata(alloc::sync::Arc) @@ -390,6 +415,28 @@ pub fn eggfetch_core::redact::is_sensitive_header(&str) -> bool pub fn eggfetch_core::redact::redact_headers(&http::header::map::HeaderMap) -> http::header::map::HeaderMap pub fn eggfetch_core::redact::redact_url(&url::Url) -> alloc::string::String pub fn eggfetch_core::redact::redact_url_string(&str) -> alloc::string::String +pub mod eggfetch_core::redirect +pub enum eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectDowngradePolicy::Allow +pub eggfetch_core::redirect::RedirectDowngradePolicy::Deny +pub struct eggfetch_core::redirect::RedirectPolicy +pub eggfetch_core::redirect::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::redirect::RedirectPolicy::follow: bool +pub eggfetch_core::redirect::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::check_downgrade(&self, &url::Url, &url::Url) -> eggfetch_core::error::Result<()> +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self +pub fn eggfetch_core::redirect::build_redirect_request(&eggfetch_core::request::Request, http::status::StatusCode, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::redirect::build_redirect_request_with_redirect_policy(&eggfetch_core::request::Request, http::status::StatusCode, &str, &eggfetch_core::redirect::RedirectPolicy) -> eggfetch_core::error::Result +pub fn eggfetch_core::redirect::check_https_downgrade(&url::Url, &url::Url, eggfetch_core::redirect::RedirectDowngradePolicy) -> eggfetch_core::error::Result<()> +pub fn eggfetch_core::redirect::drops_body_on_redirect(http::status::StatusCode, &http::method::Method) -> bool +pub fn eggfetch_core::redirect::is_https_downgrade(&url::Url, &url::Url) -> bool +pub fn eggfetch_core::redirect::is_redirect_status(http::status::StatusCode) -> bool +pub fn eggfetch_core::redirect::redirect_method(http::status::StatusCode, &http::method::Method) -> http::method::Method pub mod eggfetch_core::request pub enum eggfetch_core::request::ProxyOverride pub eggfetch_core::request::ProxyOverride::Direct @@ -410,10 +457,12 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method pub fn eggfetch_core::request::Request::proxied_target(&self) -> core::option::Option<&eggfetch_core::transport_hints::ResolvedTarget> +pub fn eggfetch_core::request::Request::redirect(&self) -> core::option::Option<&eggfetch_core::redirect::RedirectPolicy> pub fn eggfetch_core::request::Request::set_auth(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_auth_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_body(&mut self, eggfetch_core::body::RequestBody) @@ -421,6 +470,8 @@ pub fn eggfetch_core::request::Request::set_decompress(&mut self, core::option:: pub fn eggfetch_core::request::Request::set_max_decoded_body_size(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -443,11 +494,13 @@ pub fn eggfetch_core::request::RequestBuilder::max_decoded_body_size(self, usize pub fn eggfetch_core::request::RequestBuilder::max_decompression_ratio(self, f64) -> Self pub fn eggfetch_core::request::RequestBuilder::proxy_target_addresses(self, I) -> Self where I: core::iter::traits::collect::IntoIterator pub fn eggfetch_core::request::RequestBuilder::query(self, &str, &str) -> Self +pub fn eggfetch_core::request::RequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self pub async fn eggfetch_core::request::RequestBuilder::send(self) -> eggfetch_core::error::Result pub async fn eggfetch_core::request::RequestBuilder::send_detailed(self) -> core::result::Result pub fn eggfetch_core::request::RequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self pub fn eggfetch_core::request::RequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self pub fn eggfetch_core::request::RequestBuilder::without_auth(self) -> Self +pub fn eggfetch_core::request::RequestBuilder::without_retry(self) -> Self pub struct eggfetch_core::request::ResolvedTarget impl eggfetch_core::transport_hints::ResolvedTarget pub fn eggfetch_core::transport_hints::ResolvedTarget::addresses(&self) -> &[core::net::socket_addr::SocketAddr] @@ -1026,6 +1079,9 @@ pub fn eggfetch_core::network_stream::NetworkStream::metadata(&self) -> &alloc:: pub enum eggfetch_core::ProxyOverride pub eggfetch_core::ProxyOverride::Direct pub eggfetch_core::ProxyOverride::Inherit +pub enum eggfetch_core::RedirectDowngradePolicy +pub eggfetch_core::RedirectDowngradePolicy::Allow +pub eggfetch_core::RedirectDowngradePolicy::Deny pub enum eggfetch_core::RequestBody pub eggfetch_core::RequestBody::Bytes(bytes::bytes::Bytes) pub eggfetch_core::RequestBody::Empty @@ -1053,6 +1109,12 @@ impl core::convert::From for eggfetch_core::body::RequestBo pub fn eggfetch_core::body::RequestBody::from(bytes::bytes::Bytes) -> Self impl core::fmt::Debug for eggfetch_core::body::RequestBody pub fn eggfetch_core::body::RequestBody::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl http_body::Body for eggfetch_core::body::RequestBody +pub type eggfetch_core::body::RequestBody::Data = bytes::bytes::Bytes +pub type eggfetch_core::body::RequestBody::Error = eggfetch_core::error::Error +pub fn eggfetch_core::body::RequestBody::is_end_stream(&self) -> bool +pub fn eggfetch_core::body::RequestBody::poll_frame(core::pin::Pin<&mut Self>, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll, Self::Error>>> +pub fn eggfetch_core::body::RequestBody::size_hint(&self) -> http_body::size_hint::SizeHint pub enum eggfetch_core::ResponseBody pub eggfetch_core::ResponseBody::Buffered pub eggfetch_core::ResponseBody::Buffered::bytes: bytes::bytes::Bytes @@ -1127,14 +1189,17 @@ pub fn eggfetch_core::client::Client::delete(&self, &str) -> eggfetch_core::erro pub async fn eggfetch_core::client::Client::execute_http_body(&self, http::request::Request, eggfetch_core::transport_hints::NativeRequestOptions) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub async fn eggfetch_core::client::Client::execute_http_body_default(&self, http::request::Request) -> eggfetch_core::error::Result> where B: http_body::Body + core::marker::Send + 'static, ::Error: core::error::Error + core::marker::Send + core::marker::Sync + 'static pub fn eggfetch_core::client::Client::get(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::get_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::head(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::new() -> Self pub fn eggfetch_core::client::Client::options(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::patch(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::pool_metrics(&self) -> &eggfetch_core::pool::PoolMetrics pub fn eggfetch_core::client::Client::post(&self, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::post_uri(&self, &http::uri::Uri) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::put(&self, &str) -> eggfetch_core::error::Result pub fn eggfetch_core::client::Client::request(&self, http::method::Method, &str) -> eggfetch_core::error::Result +pub fn eggfetch_core::client::Client::request_uri(&self, http::method::Method, &http::uri::Uri) -> eggfetch_core::error::Result pub async fn eggfetch_core::client::Client::send_detailed(&self, eggfetch_core::request::Request) -> core::result::Result pub fn eggfetch_core::client::Client::transport_metrics(&self) -> &eggfetch_core::transport::metrics::TransportMetrics impl eggfetch_core::client::Client @@ -1241,6 +1306,21 @@ pub type eggfetch_core::service::NativeHttpService::Future = core::pin::Pin pub fn eggfetch_core::service::NativeHttpService::call(&mut self, http::request::Request) -> Self::Future pub fn eggfetch_core::service::NativeHttpService::poll_ready(&mut self, &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub struct eggfetch_core::NativeRequestBuilder +impl eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::body(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::build(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::bytes(self, impl core::convert::Into) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::header(self, &str, &str) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::headers(self, eggfetch_core::headers::Headers) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self +pub async fn eggfetch_core::native_request::NativeRequestBuilder::send(self) -> eggfetch_core::error::Result> +pub fn eggfetch_core::native_request::NativeRequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::version(self, http::version::Version) -> Self +pub fn eggfetch_core::native_request::NativeRequestBuilder::without_retry(self) -> Self +impl core::fmt::Debug for eggfetch_core::native_request::NativeRequestBuilder +pub fn eggfetch_core::native_request::NativeRequestBuilder::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct eggfetch_core::NativeRequestOptions pub eggfetch_core::NativeRequestOptions::timeout: core::option::Option pub eggfetch_core::NativeRequestOptions::transport_hints: eggfetch_core::transport_hints::TransportHints @@ -1276,6 +1356,17 @@ pub eggfetch_core::PoolConfig::max_in_flight_requests: core::option::Option impl core::convert::From for eggfetch_core::pool::PoolConfig pub fn eggfetch_core::pool::PoolConfig::from(eggfetch_core::limits::Limits) -> Self +pub struct eggfetch_core::RedirectPolicy +pub eggfetch_core::RedirectPolicy::downgrade: eggfetch_core::redirect::RedirectDowngradePolicy +pub eggfetch_core::RedirectPolicy::follow: bool +pub eggfetch_core::RedirectPolicy::max_redirects: usize +impl eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::check_downgrade(&self, &url::Url, &url::Url) -> eggfetch_core::error::Result<()> +pub fn eggfetch_core::redirect::RedirectPolicy::new(bool, usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::strict(usize) -> Self +pub fn eggfetch_core::redirect::RedirectPolicy::with_downgrade(self, eggfetch_core::redirect::RedirectDowngradePolicy) -> Self +impl core::default::Default for eggfetch_core::redirect::RedirectPolicy +pub fn eggfetch_core::redirect::RedirectPolicy::default() -> Self pub struct eggfetch_core::Request impl eggfetch_core::request::Request pub fn eggfetch_core::request::Request::auth(&self) -> core::option::Option<&eggfetch_core::auth::AuthScheme> @@ -1284,10 +1375,12 @@ pub fn eggfetch_core::request::Request::decompress(&self) -> core::option::Optio pub fn eggfetch_core::request::Request::headers(&self) -> &eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::headers_mut(&mut self) -> &mut eggfetch_core::headers::Headers pub fn eggfetch_core::request::Request::is_auth_disabled(&self) -> bool +pub fn eggfetch_core::request::Request::is_retry_disabled(&self) -> bool pub fn eggfetch_core::request::Request::max_decoded_body_size(&self) -> core::option::Option pub fn eggfetch_core::request::Request::max_decompression_ratio(&self) -> core::option::Option pub fn eggfetch_core::request::Request::method(&self) -> &http::method::Method pub fn eggfetch_core::request::Request::proxied_target(&self) -> core::option::Option<&eggfetch_core::transport_hints::ResolvedTarget> +pub fn eggfetch_core::request::Request::redirect(&self) -> core::option::Option<&eggfetch_core::redirect::RedirectPolicy> pub fn eggfetch_core::request::Request::set_auth(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_auth_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_body(&mut self, eggfetch_core::body::RequestBody) @@ -1295,6 +1388,8 @@ pub fn eggfetch_core::request::Request::set_decompress(&mut self, core::option:: pub fn eggfetch_core::request::Request::set_max_decoded_body_size(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_max_decompression_ratio(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_proxied_target(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_redirect(&mut self, core::option::Option) +pub fn eggfetch_core::request::Request::set_retry_disabled(&mut self, bool) pub fn eggfetch_core::request::Request::set_timeout(&mut self, core::option::Option) pub fn eggfetch_core::request::Request::set_transport_hints(&mut self, eggfetch_core::transport_hints::TransportHints) pub fn eggfetch_core::request::Request::set_version(&mut self, http::version::Version) @@ -1317,11 +1412,13 @@ pub fn eggfetch_core::request::RequestBuilder::max_decoded_body_size(self, usize pub fn eggfetch_core::request::RequestBuilder::max_decompression_ratio(self, f64) -> Self pub fn eggfetch_core::request::RequestBuilder::proxy_target_addresses(self, I) -> Self where I: core::iter::traits::collect::IntoIterator pub fn eggfetch_core::request::RequestBuilder::query(self, &str, &str) -> Self +pub fn eggfetch_core::request::RequestBuilder::redirect_policy(self, eggfetch_core::redirect::RedirectPolicy) -> Self pub async fn eggfetch_core::request::RequestBuilder::send(self) -> eggfetch_core::error::Result pub async fn eggfetch_core::request::RequestBuilder::send_detailed(self) -> core::result::Result pub fn eggfetch_core::request::RequestBuilder::timeout(self, eggfetch_core::timeout::Timeout) -> Self pub fn eggfetch_core::request::RequestBuilder::transport_hints(self, eggfetch_core::transport_hints::TransportHints) -> Self pub fn eggfetch_core::request::RequestBuilder::without_auth(self) -> Self +pub fn eggfetch_core::request::RequestBuilder::without_retry(self) -> Self pub struct eggfetch_core::RequestFailure impl eggfetch_core::error::RequestFailure pub fn eggfetch_core::error::RequestFailure::error(&self) -> &eggfetch_core::error::Error diff --git a/crates/eggfetch-cli/Cargo.toml b/crates/eggfetch-cli/Cargo.toml index bde17f73..31c7a607 100644 --- a/crates/eggfetch-cli/Cargo.toml +++ b/crates/eggfetch-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eggfetch-cli" -version = "0.3.0" +version = "0.4.0" edition.workspace = true rust-version.workspace = true license.workspace = true @@ -29,7 +29,7 @@ name = "eggfetch" path = "src/main.rs" [dependencies] -eggfetch-core = { version = "0.3.0", path = "../eggfetch-core", features = ["cookies", "multipart", "proxy"] } +eggfetch-core = { version = "0.4.0", path = "../eggfetch-core", features = ["cookies", "multipart", "proxy"] } clap = { version = "4", features = ["derive", "wrap_help", "env"] } clap_complete = "4" serde_json = "1" diff --git a/crates/eggfetch-core/Cargo.toml b/crates/eggfetch-core/Cargo.toml index 5ae90dd1..9657e48e 100644 --- a/crates/eggfetch-core/Cargo.toml +++ b/crates/eggfetch-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eggfetch-core" -version = "0.3.0" +version = "0.4.0" edition.workspace = true rust-version.workspace = true license.workspace = true @@ -75,14 +75,14 @@ compression-brotli = ["dep:async-compression", "async-compression/brotli", "dep: compression-zstd = ["dep:async-compression", "async-compression/zstd", "dep:tokio-util", "tokio/io-util", "dep:zstd"] compression-deflate = ["dep:async-compression", "async-compression/deflate", "async-compression/zlib", "dep:tokio-util", "tokio/io-util", "dep:flate2"] cookies = ["dep:cookie", "high-level-url"] -proxy = ["http1", "tls-rustls", "tokio/io-util", "high-level-url", "dep:eggfetch-http-connect", "dep:base64"] +proxy = ["native-http1", "tls-rustls", "tokio/io-util", "high-level-url", "dep:eggfetch-http-connect", "dep:base64"] tracing = ["dep:tracing"] multipart = ["dep:getrandom"] test-util = ["tokio/test-util"] [dependencies] bytes = "1" -eggfetch-http-connect = { version = "0.3.0", path = "../eggfetch-http-connect", optional = true } +eggfetch-http-connect = { version = "0.4.0", path = "../eggfetch-http-connect", optional = true } futures-core = "0.3" futures-util = { version = "0.3", default-features = false, features = ["alloc"] } http = "1" diff --git a/crates/eggfetch-core/src/body.rs b/crates/eggfetch-core/src/body.rs index 04d9d56b..2ca710c9 100644 --- a/crates/eggfetch-core/src/body.rs +++ b/crates/eggfetch-core/src/body.rs @@ -329,6 +329,65 @@ impl From<&str> for RequestBody { } } +impl http_body::Body for RequestBody { + type Data = Bytes; + type Error = Error; + + /// Yield the next body frame. + /// + /// An empty body ends the stream immediately, a byte body yields its + /// single data frame, and a stream body yields one data frame per + /// produced chunk. The body is consumed as it is polled, matching the + /// single-consumption contract of the high-level request path. + fn poll_frame( + mut self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll, Self::Error>>> { + match &mut *self { + Self::Empty => Poll::Ready(None), + Self::Bytes(bytes) => { + if bytes.is_empty() { + return Poll::Ready(None); + } + let frame = std::mem::replace(bytes, Bytes::new()); + Poll::Ready(Some(Ok(Frame::data(frame)))) + } + Self::Stream { stream, .. } => match stream.as_mut().poll_next(cx) { + Poll::Ready(Some(Ok(chunk))) => Poll::Ready(Some(Ok(Frame::data(chunk)))), + Poll::Ready(Some(Err(error))) => Poll::Ready(Some(Err(error))), + Poll::Ready(None) => Poll::Ready(None), + Poll::Pending => Poll::Pending, + }, + } + } + + fn is_end_stream(&self) -> bool { + match self { + Self::Empty => true, + Self::Bytes(bytes) => bytes.is_empty(), + // A stream body may still produce frames, so it is never + // reported as finished before it actually ends. + Self::Stream { .. } => false, + } + } + + fn size_hint(&self) -> http_body::SizeHint { + let mut hint = http_body::SizeHint::new(); + match self { + Self::Empty => hint.set_exact(0), + Self::Bytes(bytes) => hint.set_exact(u64::try_from(bytes.len()).unwrap_or(u64::MAX)), + Self::Stream { + length: Some(length), + .. + } => { + hint.set_exact(u64::try_from(*length).unwrap_or(u64::MAX)); + } + Self::Stream { length: None, .. } => {} + } + hint + } +} + pin_project! { /// Type-erased native request body with per-frame write deadlines. /// diff --git a/crates/eggfetch-core/src/client.rs b/crates/eggfetch-core/src/client.rs index 0e79ce6b..599a61ad 100644 --- a/crates/eggfetch-core/src/client.rs +++ b/crates/eggfetch-core/src/client.rs @@ -18,7 +18,6 @@ use crate::transport::hyper_client::{ CONNECT_CLIENT_CACHE_MAX_ENTRIES, FORWARD_CLIENT_CACHE_MAX_ENTRIES, SOCKS_CLIENT_CACHE_MAX_ENTRIES, }; -#[cfg(feature = "high-level-url")] use http::Method; #[cfg(any(feature = "advanced-routing", feature = "proxy"))] use tokio::sync::Mutex; @@ -309,6 +308,64 @@ impl Client { Ok(RequestBuilder::new(self.clone(), method, parsed)) } + /// Create a native GET request builder for the given [`http::Uri`]. + /// + /// This is the URL-free counterpart to `Client::get`: it needs no + /// `url`/`idna`/ICU dependency closure and is available in every + /// profile, including the minimal native slice. The request is + /// dispatched through the native transport, which applies no redirects, + /// no logical retries, no cookies, no authentication, and no response + /// decompression. + /// + /// The caller owns IDNA and punycode conversion before constructing the + /// URI. + /// + /// # Errors + /// + /// Returns an error if the URI is not an absolute HTTP(S) URI with an + /// authority. + pub fn get_uri(&self, uri: &http::Uri) -> Result { + self.request_uri(Method::GET, uri) + } + + /// Create a native POST request builder for the given [`http::Uri`]. + /// + /// This is the URL-free counterpart to `Client::post`. See + /// [`Self::get_uri`] for the dispatch semantics. + /// + /// # Errors + /// + /// Returns an error if the URI is not an absolute HTTP(S) URI with an + /// authority. + pub fn post_uri(&self, uri: &http::Uri) -> Result { + self.request_uri(Method::POST, uri) + } + + /// Create a native request builder for a method and an [`http::Uri`]. + /// + /// This is the URL-free counterpart to `Client::request`. See + /// [`Self::get_uri`] for the dispatch semantics. + /// + /// # Errors + /// + /// Returns an error if the URI is not an absolute HTTP(S) URI with an + /// authority. + pub fn request_uri( + &self, + method: Method, + uri: &http::Uri, + ) -> Result { + // Validate eagerly so a relative or non-HTTP(S) URI is reported + // at build time instead of at dispatch time. The native transport + // applies the same rule. + crate::http_origin::HttpOrigin::from_uri(uri)?; + Ok(crate::native_request::NativeRequestBuilder::new( + self.clone(), + method, + uri.clone(), + )) + } + /// Returns a reference to the connection pool metrics. /// /// These count logical request-permit waits/cancellations. For diff --git a/crates/eggfetch-core/src/lib.rs b/crates/eggfetch-core/src/lib.rs index 9ddc3a85..9a3c957f 100644 --- a/crates/eggfetch-core/src/lib.rs +++ b/crates/eggfetch-core/src/lib.rs @@ -39,13 +39,13 @@ pub mod http_version; pub mod limits; #[cfg(feature = "multipart")] pub mod multipart; +pub mod native_request; pub mod network_stream; pub(crate) mod pipeline; pub mod pool; #[cfg(feature = "proxy")] pub mod proxy; pub mod redact; -#[cfg(feature = "redirects")] pub mod redirect; #[cfg(feature = "high-level-url")] pub mod request; @@ -77,6 +77,7 @@ pub use http_version::HttpVersionPolicy; pub use limits::Limits; #[cfg(feature = "multipart")] pub use multipart::{Boundary, Multipart, MultipartEncoder, Part, PartBody}; +pub use native_request::NativeRequestBuilder; pub use network_stream::{ ConnectionMetadata, ExtraInfo, NetworkStream, TlsInfo, TransportKind, UpgradedStream, UpgradedStreamVariant, @@ -93,7 +94,6 @@ pub use redact::{redact_url, redact_url_string}; pub use redirect::{ build_redirect_request_with_redirect_policy, check_https_downgrade, is_https_downgrade, }; -#[cfg(feature = "redirects")] pub use redirect::{RedirectDowngradePolicy, RedirectPolicy}; #[cfg(feature = "high-level-url")] pub use request::{ProxyOverride, Request, RequestBuilder}; diff --git a/crates/eggfetch-core/src/native_request.rs b/crates/eggfetch-core/src/native_request.rs new file mode 100644 index 00000000..81994c35 --- /dev/null +++ b/crates/eggfetch-core/src/native_request.rs @@ -0,0 +1,248 @@ +//! Native request builder for `http::Uri` targets. +//! +//! The high-level request builder is backed by `url::Url`, so it is only +//! available with the `high-level-url` feature and carries the +//! `url`/`idna`/ICU dependency closure with it. This module is the +//! URL-free counterpart: a builder that takes an already-parsed +//! [`http::Uri`] and dispatches through the same native frame-preserving +//! transport as [`crate::Client::execute_http_body`]. It is available in +//! every profile, including the minimal native slice that compiles without +//! `url`. +//! +//! # Semantics +//! +//! The native path dispatches exactly once. It applies no redirects, no +//! logical retries, no cookies, no authentication, no response +//! decompression, and no decoded-body limits. The caller owns IDNA and +//! punycode conversion before constructing the [`http::Uri`], and the +//! built-in proxy and HTTP/3 routes reject native frame bodies. +//! +//! # Relationship to the high-level builder +//! +//! `crate::request::RequestBuilder` and this builder are deliberately +//! separate types rather than one type with two target representations. The +//! high-level builder owns URL semantics (query pairs, relative redirect +//! resolution, cookie and proxy matching by URL) and returns the high-level +//! `crate::response::Response`. This builder owns only the wire-level +//! request and returns a plain [`http::Response`]. Keeping them separate +//! means a native consumer can depend on the transport without pulling in +//! the URL layer, and it keeps the existing high-level signatures intact. + +use bytes::Bytes; +use http::Method; + +use crate::body::{NativeResponseBody, RequestBody}; +use crate::client::Client; +use crate::error::Result; +use crate::headers::Headers; +use crate::redirect::RedirectPolicy; +use crate::timeout::Timeout; +use crate::transport_hints::{NativeRequestOptions, TransportHints}; + +/// Builder for a native request addressed by an [`http::Uri`. +/// +/// Create one with [`crate::Client::get_uri`] or +/// [`crate::Client::request_uri`]. The builder is dispatched through the +/// native transport, so it applies none of the high-level request policy: +/// no redirect following, no logical retries, no cookie jar, no +/// authentication, no response decompression, and no decoded-body limits. +/// +/// The request is sent exactly once. [`Self::without_retry`] and +/// [`Self::redirect_policy`] therefore cannot change the wire behavior; +/// they exist so the same request-building code can express a +/// single-attempt contract in every profile. +pub struct NativeRequestBuilder { + client: Option, + method: Method, + uri: http::Uri, + headers: Headers, + body: RequestBody, + version: http::Version, + timeout: Option, + transport_hints: TransportHints, + /// Whether the caller asserted that this request must not be retried. + retry_disabled: bool, + /// The redirect policy the caller attached to this request. + redirect: Option, + error: Option, +} + +impl std::fmt::Debug for NativeRequestBuilder { + /// Render the builder without the query string. + /// + /// A native URI is caller-owned and may carry query material (API keys + /// routinely travel in query parameters), so only the scheme, + /// authority, and path are shown. + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let scheme = self.uri.scheme_str().unwrap_or(""); + let authority = self + .uri + .authority() + .map_or("", http::uri::Authority::as_str); + let path = self.uri.path(); + f.debug_struct("NativeRequestBuilder") + .field("method", &self.method) + .field("uri", &format!("{scheme}://{authority}{path}")) + .field("headers", &self.headers) + .field("body", &self.body) + .field("version", &self.version) + .field("timeout", &self.timeout) + .field("transport_hints", &self.transport_hints) + .field("retry_disabled", &self.retry_disabled) + .field("redirect", &self.redirect) + .finish_non_exhaustive() + } +} + +impl NativeRequestBuilder { + /// Create a new native request builder associated with a client. + pub(crate) fn new(client: Client, method: Method, uri: http::Uri) -> Self { + Self { + client: Some(client), + method, + uri, + headers: Headers::new(), + body: RequestBody::default(), + version: http::Version::HTTP_11, + timeout: None, + transport_hints: TransportHints::default(), + retry_disabled: false, + redirect: None, + error: None, + } + } + + /// Add a single header to the request. + /// + /// An invalid header name or value is recorded and reported by + /// [`Self::build`] and [`Self::send`]. + #[must_use] + pub fn header(mut self, name: &str, value: &str) -> Self { + if let Err(error) = self.headers.insert(name, value) { + if self.error.is_none() { + self.error = Some(error); + } + } + self + } + + /// Replace all headers with the provided set. + #[must_use] + pub fn headers(mut self, headers: Headers) -> Self { + self.headers = headers; + self + } + + /// Set the request body from any type that converts into + /// [`RequestBody`]. + #[must_use] + pub fn body(mut self, body: impl Into) -> Self { + self.body = body.into(); + self + } + + /// Set the request body from bytes. + #[must_use] + pub fn bytes(self, data: impl Into) -> Self { + self.body(RequestBody::Bytes(data.into())) + } + + /// Set the HTTP version for this request. + /// + /// The default is HTTP/1.1. HTTP/2 is selected by protocol negotiation + /// unless the client is built with an explicit version policy. + #[must_use] + pub fn version(mut self, version: http::Version) -> Self { + self.version = version; + self + } + + /// Set the timeout for this specific request. + /// + /// When set, this overrides the client-level timeout on a per-field + /// basis: only fields present here replace the corresponding + /// client-level fields. + #[must_use] + pub fn timeout(mut self, timeout: Timeout) -> Self { + self.timeout = Some(timeout); + self + } + + /// Set the transport hints for this request. + /// + /// Transport hints control wire-level behavior (target override, SNI + /// hostname, resolved destination) without affecting logical URL + /// semantics. + #[must_use] + pub fn transport_hints(mut self, hints: TransportHints) -> Self { + self.transport_hints = hints; + self + } + + /// Assert that this request must not be retried. + /// + /// The native transport dispatches exactly once, so this call cannot + /// change the wire behavior: the assertion already holds. It exists so + /// a request built for the high-level API can express the same + /// single-attempt contract in a profile that compiles out the retry + /// engine. + #[must_use] + pub fn without_retry(mut self) -> Self { + self.retry_disabled = true; + self + } + + /// Attach a redirect policy to this request. + /// + /// The native transport never follows redirects, so this call cannot + /// change the wire behavior: a 3xx response is returned unchanged. It + /// exists so a request built for the high-level API can express the + /// same "do not follow redirects" contract in a profile that compiles + /// out the redirect loop. + #[must_use] + pub fn redirect_policy(mut self, policy: RedirectPolicy) -> Self { + self.redirect = Some(policy); + self + } + + /// Build the request without sending it. + /// + /// # Errors + /// + /// Returns an error if a previous builder step failed (for example an + /// invalid header). + pub fn build(self) -> Result> { + if let Some(error) = self.error { + return Err(error); + } + let mut request = http::Request::new(self.body); + *request.uri_mut() = self.uri; + *request.method_mut() = self.method; + *request.version_mut() = self.version; + *request.headers_mut() = self.headers.into_inner(); + Ok(request) + } + + /// Build and send the request. + /// + /// The response is an ordinary [`http::Response`] whose body is a + /// [`NativeResponseBody`]. The logical pool lease is held by the + /// response body until it reaches EOF, errors, or is dropped. + /// + /// # Errors + /// + /// Returns an error if the request could not be built or sent. + pub async fn send(self) -> Result> { + let client = self.client.clone().ok_or_else(|| { + crate::Error::RequestBuild("no client associated with request builder".into()) + })?; + let timeout = self.timeout; + let transport_hints = self.transport_hints.clone(); + let request = self.build()?; + let options = NativeRequestOptions { + timeout, + transport_hints, + }; + client.execute_http_body(request, options).await + } +} diff --git a/crates/eggfetch-core/src/pipeline/hop.rs b/crates/eggfetch-core/src/pipeline/hop.rs index c4093b23..5d1db273 100644 --- a/crates/eggfetch-core/src/pipeline/hop.rs +++ b/crates/eggfetch-core/src/pipeline/hop.rs @@ -86,8 +86,7 @@ pub(super) fn prepare_first_hop(client: &Client, request: Request) -> HopBuildPa body, version, timeout: request_timeout, - #[cfg(feature = "redirects")] - redirect: _, + redirect: _, auth: req_auth, auth_disabled: req_auth_disabled, decompress: request_decompress, @@ -96,6 +95,7 @@ pub(super) fn prepare_first_hop(client: &Client, request: Request) -> HopBuildPa proxy_override: request_proxy, #[cfg(feature = "logical-retry")] retry: _, + retry_disabled: _, transport_hints: request_transport_hints, proxied_target: request_proxied_target, failure_context, diff --git a/crates/eggfetch-core/src/pipeline/prepare.rs b/crates/eggfetch-core/src/pipeline/prepare.rs index bc828fc3..bdcbaa87 100644 --- a/crates/eggfetch-core/src/pipeline/prepare.rs +++ b/crates/eggfetch-core/src/pipeline/prepare.rs @@ -308,14 +308,14 @@ pub(super) async fn prepare_single_request( body, version, timeout: _request_timeout, - #[cfg(feature = "redirects")] - redirect: _request_redirect, + redirect: _request_redirect, auth: _, auth_disabled: _, decompress: request_decompress, proxy_override, #[cfg(feature = "logical-retry")] retry: _, + retry_disabled: _, transport_hints, proxied_target, failure_context, diff --git a/crates/eggfetch-core/src/pipeline/redirect.rs b/crates/eggfetch-core/src/pipeline/redirect.rs index 7db52e6f..e118f0ea 100644 --- a/crates/eggfetch-core/src/pipeline/redirect.rs +++ b/crates/eggfetch-core/src/pipeline/redirect.rs @@ -119,6 +119,7 @@ fn advance_redirect_hop( proxy_override: _, #[cfg(feature = "logical-retry")] retry: _, + retry_disabled: _, transport_hints: _, proxied_target: _, failure_context: _, diff --git a/crates/eggfetch-core/src/pipeline/retry.rs b/crates/eggfetch-core/src/pipeline/retry.rs index d60b040d..304d9454 100644 --- a/crates/eggfetch-core/src/pipeline/retry.rs +++ b/crates/eggfetch-core/src/pipeline/retry.rs @@ -107,10 +107,16 @@ pub(crate) async fn send_with_retry(client: &Client, request: Request) -> Result let body_replayable = request.body().is_replayable(); // Resolve the effective retry policy. Request-level takes precedence. - let effective_policy = request - .retry() - .cloned() - .or_else(|| client.config().retry.clone()); + // A request-level `without_retry()` disables retries even when the + // client has a retry policy configured. + let effective_policy = if request.is_retry_disabled() { + None + } else { + request + .retry() + .cloned() + .or_else(|| client.config().retry.clone()) + }; let policy = match effective_policy { Some(p) if p.is_enabled() => p, _ => { @@ -400,8 +406,7 @@ mod tests { body: _, version: _, timeout: _, - #[cfg(feature = "redirects")] - redirect: _, + redirect: _, auth: _, auth_disabled: _, decompress: _, @@ -409,6 +414,7 @@ mod tests { max_decompression_ratio: _, proxy_override: _, retry: _, + retry_disabled: _, transport_hints: _, proxied_target: _, failure_context: _, diff --git a/crates/eggfetch-core/src/redirect.rs b/crates/eggfetch-core/src/redirect.rs index 24aeefdb..272bc68d 100644 --- a/crates/eggfetch-core/src/redirect.rs +++ b/crates/eggfetch-core/src/redirect.rs @@ -9,8 +9,11 @@ use http::Method; #[cfg(feature = "high-level-url")] use url::Url; +#[cfg(feature = "high-level-url")] use crate::body::RequestBody; +#[cfg(feature = "high-level-url")] use crate::error::{Error, Result}; +#[cfg(feature = "high-level-url")] use crate::headers::Headers; #[cfg(feature = "high-level-url")] use crate::request::Request; @@ -106,7 +109,7 @@ impl RedirectPolicy { /// [`Error::InvalidRedirectLocation`] when the hop is an HTTPS -> HTTP /// downgrade and the policy is [`RedirectDowngradePolicy::Deny`]. /// Scheme allow-listing (`http`/`https` only) and userinfo rejection - /// are enforced separately by [`validate_redirect_url`]; this method + /// are enforced separately by `validate_redirect_url`; this method /// only enforces the downgrade boundary. /// /// # Errors @@ -151,6 +154,7 @@ pub fn check_https_downgrade(from: &Url, to: &Url, policy: RedirectDowngradePoli /// Headers that should be removed when the body is dropped (e.g., on /// POST→GET rewrite). +#[cfg(feature = "high-level-url")] const BODY_HEADERS: &[&str] = &["content-length", "content-type", "transfer-encoding"]; /// Check if a status code indicates a redirect that should be followed. diff --git a/crates/eggfetch-core/src/request.rs b/crates/eggfetch-core/src/request.rs index e59cfad6..1fac9115 100644 --- a/crates/eggfetch-core/src/request.rs +++ b/crates/eggfetch-core/src/request.rs @@ -15,7 +15,6 @@ use crate::body::RequestBody; use crate::client::Client; use crate::error::Result; use crate::headers::Headers; -#[cfg(feature = "redirects")] use crate::redirect::RedirectPolicy; use crate::response::Response; #[cfg(feature = "logical-retry")] @@ -66,7 +65,6 @@ pub(crate) struct RequestParts { pub(crate) body: RequestBody, pub(crate) version: Version, pub(crate) timeout: Option, - #[cfg(feature = "redirects")] pub(crate) redirect: Option, pub(crate) auth: Option, pub(crate) auth_disabled: bool, @@ -76,6 +74,12 @@ pub(crate) struct RequestParts { pub(crate) proxy_override: ProxyOverride, #[cfg(feature = "logical-retry")] pub(crate) retry: Option, + /// Whether logical retries are disabled for this request. + /// + /// Always present so `without_retry()` stays expressible in profiles + /// that compile out the retry engine. The gated retry loop consults + /// this flag; in a profile without the loop it is inert. + pub(crate) retry_disabled: bool, pub(crate) transport_hints: TransportHints, pub(crate) proxied_target: Option, pub(crate) failure_context: Option>, @@ -100,7 +104,6 @@ impl RequestParts { body, version, timeout, - #[cfg(feature = "redirects")] redirect, auth, auth_disabled, @@ -110,6 +113,7 @@ impl RequestParts { proxy_override, #[cfg(feature = "logical-retry")] retry, + retry_disabled, transport_hints, proxied_target, failure_context, @@ -119,10 +123,7 @@ impl RequestParts { request.set_body(body); request.set_version(version); request.set_timeout(timeout); - #[cfg(feature = "redirects")] request.set_redirect(redirect); - #[cfg(not(feature = "redirects"))] - let _ = (); request.set_auth(auth); request.set_auth_disabled(auth_disabled); request.set_decompress(decompress); @@ -136,6 +137,7 @@ impl RequestParts { request.set_retry(retry); #[cfg(not(feature = "logical-retry"))] let _ = (); + request.set_retry_disabled(retry_disabled); request.set_transport_hints(transport_hints); request.set_proxied_target(proxied_target); request.set_failure_context(failure_context); @@ -167,7 +169,6 @@ impl RequestParts { request.set_body(replayed); request.set_version(self.version); request.set_timeout(attempt_timeout); - #[cfg(feature = "redirects")] request.set_redirect(self.redirect.clone()); request.set_auth(self.auth.clone()); request.set_auth_disabled(self.auth_disabled); @@ -177,6 +178,7 @@ impl RequestParts { #[cfg(feature = "proxy")] request.set_proxy_override(self.proxy_override.clone()); request.set_retry(self.retry.clone()); + request.set_retry_disabled(self.retry_disabled); request.set_transport_hints(self.transport_hints.clone()); request.set_proxied_target(self.proxied_target.clone()); request.set_failure_context(self.failure_context.clone()); @@ -224,7 +226,6 @@ pub struct Request { body: RequestBody, version: Version, timeout: Option, - #[cfg(feature = "redirects")] redirect: Option, auth: Option, auth_disabled: bool, @@ -236,6 +237,11 @@ pub struct Request { /// Per-request retry policy override. Only available with `logical-retry`. #[cfg(feature = "logical-retry")] retry: Option, + /// Whether logical retries are disabled for this request. + /// + /// Always present so `without_retry()` stays expressible in profiles + /// that compile out the retry engine. + retry_disabled: bool, /// Typed transport-level hints (target override, SNI hostname, etc.). transport_hints: TransportHints, /// Caller-supplied physical destination for a proxied request. @@ -255,7 +261,6 @@ impl std::fmt::Debug for Request { .field("body", &self.body) .field("version", &self.version) .field("timeout", &self.timeout); - #[cfg(feature = "redirects")] debug.field("redirect", &self.redirect); debug .field("auth", &self.auth) @@ -266,6 +271,7 @@ impl std::fmt::Debug for Request { .field("proxy_override", &self.proxy_override); #[cfg(feature = "logical-retry")] debug.field("retry", &self.retry); + debug.field("retry_disabled", &self.retry_disabled); debug .field("transport_hints", &self.transport_hints) .field("proxied_target", &self.proxied_target) @@ -287,7 +293,6 @@ impl Request { body: RequestBody::default(), version: Version::HTTP_11, timeout: None, - #[cfg(feature = "redirects")] redirect: None, auth: None, auth_disabled: false, @@ -297,6 +302,7 @@ impl Request { proxy_override: ProxyOverride::Inherit, #[cfg(feature = "logical-retry")] retry: None, + retry_disabled: false, transport_hints: TransportHints::default(), proxied_target: None, failure_context: None, @@ -361,8 +367,10 @@ impl Request { /// Returns the request-level redirect policy override, if set. /// - /// Only available with the `redirects` feature. - #[cfg(feature = "redirects")] + /// The override is honored by the redirect loop when the `redirects` + /// feature is enabled. Without that feature no redirect loop exists, + /// so a stored policy has no effect and 3xx responses are returned + /// unchanged. #[must_use] pub fn redirect(&self) -> Option<&RedirectPolicy> { self.redirect.as_ref() @@ -370,8 +378,9 @@ impl Request { /// Set the request-level redirect policy override. /// - /// Only available with the `redirects` feature. - #[cfg(feature = "redirects")] + /// The override is honored by the redirect loop when the `redirects` + /// feature is enabled. Without that feature no redirect loop exists, + /// so the stored policy has no effect. pub fn set_redirect(&mut self, redirect: Option) { self.redirect = redirect; } @@ -469,6 +478,24 @@ impl Request { self.retry = retry; } + /// Returns whether logical retries are disabled for this request. + /// + /// Always available, so a caller can assert the single-attempt + /// contract in a profile that compiles out the retry engine. + #[must_use] + pub fn is_retry_disabled(&self) -> bool { + self.retry_disabled + } + + /// Set whether logical retries are disabled for this request. + /// + /// The retry loop consults this flag when the `logical-retry` feature + /// is enabled. Without that feature there is no retry loop, so the + /// flag is inert. + pub fn set_retry_disabled(&mut self, retry_disabled: bool) { + self.retry_disabled = retry_disabled; + } + /// Returns a reference to the transport hints for this request. #[must_use] pub fn transport_hints(&self) -> &TransportHints { @@ -510,7 +537,6 @@ impl Request { body: self.body, version: self.version, timeout: self.timeout, - #[cfg(feature = "redirects")] redirect: self.redirect, auth: self.auth, auth_disabled: self.auth_disabled, @@ -520,6 +546,7 @@ impl Request { proxy_override: self.proxy_override, #[cfg(feature = "logical-retry")] retry: self.retry, + retry_disabled: self.retry_disabled, transport_hints: self.transport_hints, proxied_target: self.proxied_target, failure_context: self.failure_context, @@ -535,7 +562,6 @@ pub struct RequestBuilder { headers: Headers, body: RequestBody, timeout: Option, - #[cfg(feature = "redirects")] redirect: Option, auth: Option, auth_disabled: bool, @@ -545,6 +571,11 @@ pub struct RequestBuilder { proxy_override: ProxyOverride, #[cfg(feature = "logical-retry")] retry: Option, + /// Whether logical retries are disabled for this request. + /// + /// Always present so `without_retry()` stays expressible in profiles + /// that compile out the retry engine. + retry_disabled: bool, transport_hints: TransportHints, proxied_target: Option, error: Option, @@ -560,7 +591,6 @@ impl RequestBuilder { headers: Headers::new(), body: RequestBody::default(), timeout: None, - #[cfg(feature = "redirects")] redirect: None, auth: None, auth_disabled: false, @@ -570,6 +600,7 @@ impl RequestBuilder { proxy_override: ProxyOverride::Inherit, #[cfg(feature = "logical-retry")] retry: None, + retry_disabled: false, transport_hints: TransportHints::default(), proxied_target: None, error: None, @@ -651,9 +682,12 @@ impl RequestBuilder { /// Override the redirect policy for this specific request. /// - /// Only available with the `redirects` feature. When set, this overrides - /// the client-level redirect policy for this request only. - #[cfg(feature = "redirects")] + /// Available in every profile. When the `redirects` feature is + /// enabled, the override replaces the client-level redirect policy for + /// this request only. Without that feature there is no redirect loop, + /// so a stored policy has no effect and 3xx responses are returned + /// unchanged; the setter stays callable so profile-independent code + /// can express the same request contract in every build. #[must_use] pub fn redirect_policy(mut self, policy: RedirectPolicy) -> Self { self.redirect = Some(policy); @@ -748,21 +782,50 @@ impl RequestBuilder { /// /// Only available with the `logical-retry` feature. When set, this /// overrides the client-level retry policy for this request only. + /// + /// This re-enables retries for the request, so a later call clears a + /// preceding [`Self::without_retry`]. #[cfg(feature = "logical-retry")] #[must_use] pub fn retry(mut self, policy: RetryPolicy) -> Self { self.retry = Some(policy); + self.retry_disabled = false; self } + /// Replace the per-request retry policy override with the + /// no-retry default policy. + /// + /// The override only exists with the `logical-retry` feature; in a + /// profile without the retry engine there is nothing to replace. + #[cfg(feature = "logical-retry")] + fn disable_retry_policy(&mut self) { + self.retry = Some(RetryPolicy::default()); + } + + /// Replace the per-request retry policy override with the + /// no-retry default policy. + /// + /// The override only exists with the `logical-retry` feature; in a + /// profile without the retry engine there is nothing to replace. + #[cfg(not(feature = "logical-retry"))] + fn disable_retry_policy(&mut self) {} + /// Disable retries for this specific request, even if the client /// has a retry policy configured. /// - /// Only available with the `logical-retry` feature. - #[cfg(feature = "logical-retry")] + /// Available in every profile. With the `logical-retry` feature the + /// request is dispatched exactly once, which is the behavior this + /// setter has always had. Without that feature there is no retry + /// engine to disable, so the request is already dispatched once and + /// the call is a semantic no-op that keeps the single-attempt + /// assertion expressible in profile-independent code. + /// + /// A later `retry()` call re-enables retries for the request. #[must_use] pub fn without_retry(mut self) -> Self { - self.retry = Some(RetryPolicy::default()); + self.retry_disabled = true; + self.disable_retry_policy(); self } @@ -863,7 +926,6 @@ impl RequestBuilder { req.headers = self.headers; req.body = self.body; req.timeout = self.timeout; - #[cfg(feature = "redirects")] req.set_redirect(self.redirect); req.auth = self.auth; req.auth_disabled = self.auth_disabled; @@ -873,6 +935,7 @@ impl RequestBuilder { req.proxy_override = self.proxy_override; #[cfg(feature = "logical-retry")] req.set_retry(self.retry); + req.set_retry_disabled(self.retry_disabled); req.transport_hints = self.transport_hints; req.proxied_target = self.proxied_target; Ok(req) diff --git a/crates/eggfetch-core/tests/cross_feature_tests.rs b/crates/eggfetch-core/tests/cross_feature_tests.rs index 05f0663c..d2707269 100644 --- a/crates/eggfetch-core/tests/cross_feature_tests.rs +++ b/crates/eggfetch-core/tests/cross_feature_tests.rs @@ -1375,6 +1375,7 @@ async fn compressed_response_through_connect_tunnel() { } #[tokio::test] +#[cfg(feature = "redirects")] async fn redirect_same_origin_through_proxy() { let redirect_server = RedirectServer::start(None).await; let proxy = HttpProxyServer::start(HttpProxyConfig::default()).await; @@ -1402,6 +1403,7 @@ async fn redirect_same_origin_through_proxy() { } #[tokio::test] +#[cfg(feature = "redirects")] async fn redirect_cross_origin_through_proxy() { let cross_server = CrossOriginServer::start().await; let origin_server = RedirectServer::start(Some(cross_server.port())).await; @@ -1439,6 +1441,7 @@ async fn redirect_cross_origin_through_proxy() { /// `proxy-authorization`) from the redirect hop so the pipeline can /// re-attach configured credentials cleanly. #[tokio::test] +#[cfg(all(feature = "redirects", feature = "basic-auth"))] async fn client_auth_survives_same_origin_redirect() { let redirect_server = RedirectServer::start(None).await; @@ -1470,6 +1473,7 @@ async fn client_auth_survives_same_origin_redirect() { /// the pipeline re-attaches the snapshot when the hop stays same-origin. /// Cross-origin hops still drop it (covered by header-stripping tests). #[tokio::test] +#[cfg(feature = "redirects")] async fn manual_authorization_survives_same_origin_redirect() { let redirect_server = RedirectServer::start(None).await; @@ -1503,7 +1507,7 @@ async fn manual_authorization_survives_same_origin_redirect() { } #[tokio::test] -#[cfg(feature = "cookies")] +#[cfg(all(feature = "cookies", feature = "redirects"))] async fn cookies_set_on_proxy_redirect_hop() { let redirect_server = RedirectServer::start(None).await; let proxy = HttpProxyServer::start(HttpProxyConfig::default()).await; @@ -1653,6 +1657,7 @@ async fn proxy_authenticated_multipart_upload() { } #[tokio::test] +#[cfg(all(feature = "redirects", feature = "basic-auth"))] async fn auth_stripping_on_cross_origin_proxied_redirect() { let cross_server = CrossOriginServer::start().await; let origin_server = RedirectServer::start(Some(cross_server.port())).await; diff --git a/crates/eggfetch-core/tests/native_request_builder_tests.rs b/crates/eggfetch-core/tests/native_request_builder_tests.rs new file mode 100644 index 00000000..8f478434 --- /dev/null +++ b/crates/eggfetch-core/tests/native_request_builder_tests.rs @@ -0,0 +1,222 @@ +#![allow( + missing_docs, + dead_code, + clippy::unwrap_used, + clippy::expect_used, + clippy::large_futures +)] +//! Tests for the native `http::Uri` request builder. +//! +//! The native builder is available in every profile, including the minimal +//! native slice that compiles without `url`. These tests use stable APIs +//! only and must therefore pass under every supported profile. + +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::Arc; + +use eggfetch_core::{Client, Error, NativeRequestBuilder, RedirectPolicy}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::TcpListener; + +/// One recorded request: the request line and the body bytes it carried. +type RecordedRequest = (String, Vec); + +/// Loopback server that answers every request with a fixed body and records +/// what it received. +struct RecordingServer { + port: u16, + shutdown: tokio::sync::watch::Sender, + request_count: Arc, + seen: Arc>>, +} + +impl RecordingServer { + async fn start() -> Self { + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let port = listener.local_addr().unwrap().port(); + let (shutdown_tx, mut shutdown_rx) = tokio::sync::watch::channel(false); + let request_count = Arc::new(AtomicUsize::new(0)); + let seen = Arc::new(std::sync::Mutex::new(Vec::new())); + let counter = request_count.clone(); + let recorded = seen.clone(); + + tokio::spawn(async move { + loop { + tokio::select! { + result = listener.accept() => { + let Ok((mut stream, _)) = result else { break }; + counter.fetch_add(1, Ordering::SeqCst); + let recorded = recorded.clone(); + tokio::spawn(async move { + let mut reader = BufReader::new(&mut stream); + let mut request_line = String::new(); + reader.read_line(&mut request_line).await.ok(); + let mut content_length = 0usize; + loop { + let mut line = String::new(); + if reader.read_line(&mut line).await.unwrap_or(0) == 0 { + break; + } + if line.trim().is_empty() { + break; + } + if let Some(value) = line + .split_once(':') + .filter(|(name, _)| name.trim().eq_ignore_ascii_case("content-length")) + { + content_length = value.1.trim().parse().unwrap_or(0); + } + } + let mut body = vec![0u8; content_length]; + if content_length > 0 { + use tokio::io::AsyncReadExt as _; + reader.read_exact(&mut body).await.ok(); + } + recorded + .lock() + .unwrap() + .push((request_line.trim().to_owned(), body)); + + let response_body = b"native-body"; + let response = format!( + "HTTP/1.1 200 OK\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", + response_body.len() + ); + stream.write_all(response.as_bytes()).await.ok(); + stream.write_all(response_body).await.ok(); + }); + } + _ = shutdown_rx.changed() => break, + } + } + }); + + Self { + port, + shutdown: shutdown_tx, + request_count, + seen, + } + } + + fn uri(&self, path: &str) -> http::Uri { + format!("http://127.0.0.1:{}{path}", self.port) + .parse() + .unwrap() + } +} + +#[tokio::test] +async fn native_builder_dispatches_an_http_uri() { + let server = RecordingServer::start().await; + let client = Client::new(); + + let response = client + .get_uri(&server.uri("/native")) + .unwrap() + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 200); + assert_eq!(server.request_count.load(Ordering::SeqCst), 1); + let recorded = server.seen.lock().unwrap(); + assert_eq!(recorded.len(), 1); + assert!( + recorded[0].0.starts_with("GET /native "), + "unexpected request line: {}", + recorded[0].0 + ); + server.shutdown.send(true).unwrap(); +} + +#[tokio::test] +async fn native_builder_sends_the_requested_body() { + let server = RecordingServer::start().await; + let client = Client::new(); + + let response = client + .post_uri(&server.uri("/submit")) + .unwrap() + .header("content-type", "text/plain") + .bytes("payload") + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 200); + let recorded = server.seen.lock().unwrap(); + assert_eq!(recorded[0].0, "POST /submit HTTP/1.1"); + assert_eq!(recorded[0].1, b"payload"); + server.shutdown.send(true).unwrap(); +} + +#[tokio::test] +async fn native_builder_rejects_a_relative_uri() { + let client = Client::new(); + let relative: http::Uri = "/only/a/path".parse().unwrap(); + let error = client + .get_uri(&relative) + .expect_err("relative URI must fail"); + assert!( + matches!(error, Error::InvalidUrl(_) | Error::Unsupported(_)), + "unexpected error: {error:?}" + ); +} + +#[tokio::test] +async fn native_builder_rejects_a_non_http_scheme() { + let client = Client::new(); + let ftp: http::Uri = "ftp://example.com/file".parse().unwrap(); + let error = client.get_uri(&ftp).expect_err("non-HTTP(S) URI must fail"); + assert!( + matches!(error, Error::InvalidUrl(_) | Error::Unsupported(_)), + "unexpected error: {error:?}" + ); +} + +#[tokio::test] +async fn native_builder_builds_the_requested_target() { + let client = Client::new(); + let uri: http::Uri = "https://example.com/path?q=1".parse().unwrap(); + + let request = client + .request_uri(http::Method::PUT, &uri) + .unwrap() + .header("x-test", "value") + .bytes("body") + .build() + .unwrap(); + + assert_eq!(request.method(), http::Method::PUT); + assert_eq!(request.uri(), &uri); + assert_eq!(request.headers().get("x-test").unwrap(), "value"); +} + +#[tokio::test] +async fn native_builder_policy_assertions_are_callable() { + let server = RecordingServer::start().await; + let client = Client::new(); + + // The native transport dispatches exactly once and never follows + // redirects, so both assertions hold by construction and must not + // change the wire behavior. + let response = client + .get_uri(&server.uri("/assert")) + .unwrap() + .without_retry() + .redirect_policy(RedirectPolicy::strict(0)) + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 200); + assert_eq!(server.request_count.load(Ordering::SeqCst), 1); + server.shutdown.send(true).unwrap(); +} + +#[tokio::test] +async fn native_builder_is_exported_from_the_crate_root() { + // Compile-time anchor for the re-export path. + let _: fn(&Client, &http::Uri) -> Result = Client::get_uri; +} diff --git a/crates/eggfetch-core/tests/public_api_contracts.rs b/crates/eggfetch-core/tests/public_api_contracts.rs index 7b5a5297..364c8770 100644 --- a/crates/eggfetch-core/tests/public_api_contracts.rs +++ b/crates/eggfetch-core/tests/public_api_contracts.rs @@ -71,10 +71,49 @@ fn retry_contracts_compile() { let _ = eggfetch_core::RetryPolicyBuilder::new(); } -#[cfg(feature = "redirects")] +/// The redirect policy types are available in every profile. +/// +/// The policy is a disable switch, so a caller must be able to name it even +/// in a profile that compiles out the redirect loop. #[test] fn redirect_contracts_compile() { let _ = eggfetch_core::RedirectPolicy::default(); + let _ = eggfetch_core::RedirectDowngradePolicy::default(); +} + +/// The native `http::Uri` request builder is available in every profile. +/// +/// The native builder needs no `url`/`idna`/ICU closure, so a consumer on +/// the minimal native slice can build and dispatch a request without the +/// high-level URL layer. +#[test] +fn native_request_contracts_compile() { + use eggfetch_core::{NativeRequestBuilder, RedirectPolicy}; + + let client = eggfetch_core::Client::new(); + let uri: http::Uri = "https://example.com/path".parse().expect("valid URI"); + + let _: fn( + &eggfetch_core::Client, + &http::Uri, + ) -> Result = eggfetch_core::Client::get_uri; + let _: fn( + &eggfetch_core::Client, + &http::Uri, + ) -> Result = eggfetch_core::Client::post_uri; + let _: fn( + &eggfetch_core::Client, + http::Method, + &http::Uri, + ) -> Result = eggfetch_core::Client::request_uri; + + // The single-attempt assertions are callable in every profile. + let builder = client + .get_uri(&uri) + .expect("valid URI") + .without_retry() + .redirect_policy(RedirectPolicy::strict(0)); + let _ = builder; } #[test] diff --git a/crates/eggfetch-core/tests/request_policy_assertion_tests.rs b/crates/eggfetch-core/tests/request_policy_assertion_tests.rs new file mode 100644 index 00000000..1e0b6037 --- /dev/null +++ b/crates/eggfetch-core/tests/request_policy_assertion_tests.rs @@ -0,0 +1,237 @@ +#![allow( + missing_docs, + dead_code, + clippy::unwrap_used, + clippy::expect_used, + clippy::large_futures +)] +//! Tests for the always-available request-policy assertions. +//! +//! `without_retry()` and `redirect_policy()` are disable switches, so +//! they must be callable in every profile. A profile that compiles out the +//! retry engine or the redirect loop has no such capability to disable, so +//! the setters are semantic no-ops there; this suite pins both halves: the +//! call sites compile everywhere, and the values are honored exactly as +//! before when the corresponding feature is enabled. + +#[cfg(feature = "high-level-url")] +mod high_level { + use std::sync::atomic::{AtomicUsize, Ordering}; + use std::sync::Arc; + + use eggfetch_core::{Client, RedirectPolicy}; + use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; + use tokio::net::TcpListener; + + /// Loopback server that answers every request with a fixed status. + struct CountingServer { + port: u16, + shutdown: tokio::sync::watch::Sender, + request_count: Arc, + status: u16, + location: Option, + } + + impl CountingServer { + async fn start(status: u16, location: Option) -> Self { + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let port = listener.local_addr().unwrap().port(); + let (shutdown_tx, mut shutdown_rx) = tokio::sync::watch::channel(false); + let request_count = Arc::new(AtomicUsize::new(0)); + let counter = request_count.clone(); + let task_location = location.clone(); + + tokio::spawn(async move { + loop { + tokio::select! { + result = listener.accept() => { + let Ok((mut stream, _)) = result else { break }; + counter.fetch_add(1, Ordering::SeqCst); + let location = task_location.clone(); + tokio::spawn(async move { + let mut reader = BufReader::new(&mut stream); + let mut request_line = String::new(); + reader.read_line(&mut request_line).await.ok(); + loop { + let mut line = String::new(); + if reader.read_line(&mut line).await.unwrap_or(0) == 0 { + break; + } + if line.trim().is_empty() { + break; + } + } + // The redirect target answers 200 so the + // redirect chain terminates after one hop. + let is_terminal = request_line + .split_whitespace() + .nth(1) + .is_some_and(|path| path == "/final"); + let (status, extra) = if is_terminal { + (200u16, String::new()) + } else { + ( + status, + location + .as_ref() + .map(|value| format!("Location: {value}\r\n")) + .unwrap_or_default(), + ) + }; + let reason = if status == 200 { "OK" } else { "Status" }; + let response = format!( + "HTTP/1.1 {status} {reason}\r\nContent-Length: 0\r\n{extra}Connection: close\r\n\r\n" + ); + stream.write_all(response.as_bytes()).await.ok(); + }); + } + _ = shutdown_rx.changed() => break, + } + } + }); + + Self { + port, + shutdown: shutdown_tx, + request_count, + status, + location, + } + } + + fn url(&self, path: &str) -> String { + format!("http://127.0.0.1:{}{path}", self.port) + } + } + + /// The policy setters must be callable in every profile, including one + /// that compiles out both policy features. + #[tokio::test] + async fn policy_setters_are_callable_in_every_profile() { + let server = CountingServer::start(200, None).await; + let client = Client::new(); + + let response = client + .get(&server.url("/")) + .unwrap() + .without_retry() + .redirect_policy(RedirectPolicy::strict(0)) + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 200); + assert_eq!(server.request_count.load(Ordering::SeqCst), 1); + server.shutdown.send(true).unwrap(); + } + + /// With the retry engine enabled, `without_retry()` must suppress the + /// client-level retry policy exactly as it did before the setter became + /// profile-independent. + #[cfg(feature = "logical-retry")] + #[tokio::test] + async fn without_retry_suppresses_the_client_retry_policy() { + use eggfetch_core::RetryPolicy; + + let server = CountingServer::start(503, None).await; + let policy = RetryPolicy::builder() + .max_attempts(3) + .backoff_factor(0.0) + .build(); + let client = Client::builder().retry(policy).build(); + + let response = client + .get(&server.url("/")) + .unwrap() + .without_retry() + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 503); + assert_eq!( + server.request_count.load(Ordering::SeqCst), + 1, + "without_retry() must produce exactly one logical attempt" + ); + server.shutdown.send(true).unwrap(); + } + + /// The order of the two setters must keep its previous meaning: a later + /// `retry()` call re-enables retries for the request. + #[cfg(feature = "logical-retry")] + #[tokio::test] + async fn retry_after_without_retry_re_enables_retries() { + use eggfetch_core::RetryPolicy; + + let server = CountingServer::start(503, None).await; + let policy = RetryPolicy::builder() + .max_attempts(3) + .backoff_factor(0.0) + .build(); + let client = Client::builder().retry(policy.clone()).build(); + + let response = client + .get(&server.url("/")) + .unwrap() + .without_retry() + .retry(policy) + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 503); + assert_eq!( + server.request_count.load(Ordering::SeqCst), + 3, + "a later retry() call must re-enable retries" + ); + server.shutdown.send(true).unwrap(); + } + + /// With the redirect loop enabled, a request-level redirect policy must + /// be honored exactly as before. + #[cfg(feature = "redirects")] + #[tokio::test] + async fn request_redirect_policy_is_honored() { + let server = CountingServer::start(302, Some("/final".to_owned())).await; + let client = Client::new(); + + let response = client + .get(&server.url("/start")) + .unwrap() + .redirect_policy(RedirectPolicy::new(true, 5)) + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 200); + assert_eq!(server.request_count.load(Ordering::SeqCst), 2); + server.shutdown.send(true).unwrap(); + } + + /// Without the redirect loop, a 3xx response is returned unchanged and + /// the stored policy has no effect. + #[cfg(not(feature = "redirects"))] + #[tokio::test] + async fn redirect_policy_is_inert_without_the_redirect_feature() { + let server = CountingServer::start(302, Some("/final".to_owned())).await; + let client = Client::new(); + + let response = client + .get(&server.url("/start")) + .unwrap() + .redirect_policy(RedirectPolicy::new(true, 5)) + .send() + .await + .unwrap(); + + assert_eq!(response.status().as_u16(), 302); + assert_eq!( + server.request_count.load(Ordering::SeqCst), + 1, + "no redirect loop exists without the redirects feature" + ); + server.shutdown.send(true).unwrap(); + } +} diff --git a/crates/eggfetch-core/tests/retry_integration.rs b/crates/eggfetch-core/tests/retry_integration.rs index c01991d2..64b13730 100644 --- a/crates/eggfetch-core/tests/retry_integration.rs +++ b/crates/eggfetch-core/tests/retry_integration.rs @@ -207,57 +207,60 @@ impl MockServer { } // --------------------------------------------------------------------------- -// Deterministic stale-idle connection fixture +// Deterministic dropped-connection fixture // --------------------------------------------------------------------------- -/// A loopback server that closes its first keepalive connection only after the -/// client has completed the first request. This makes Hyper's reused-idle -/// connection retry path observable without relying on timing or an external -/// origin. -struct StaleIdleServer { +/// A loopback server that reads one request and then closes the connection +/// without writing a single response byte. +/// +/// This makes a *mid-request* transport failure deterministic: the client has +/// already written the request when the socket goes away, so Hyper reports +/// `IncompleteMessage`. +/// +/// It deliberately replaces the earlier stale-idle fixture, which closed a +/// pooled idle connection and asserted that the client had *not* yet observed +/// the FIN. Whether Hyper classifies that situation as `is_canceled` +/// (retryable) or `IncompleteMessage` (not retryable) depends on scheduling, +/// so those tests failed intermittently under load — on unmodified `main` as +/// well as here. A canceled error cannot be forced from the server side: when +/// the pool does observe the close it quietly opens a new connection, and when +/// it does not the resulting failure is a mid-request one. These tests +/// therefore pin the contract eggfetch owns — non-retryable transport failures +/// surface and are never retried, with or without a policy — instead of +/// Hyper's internal classification. +struct DroppedConnectionServer { port: u16, request_count: Arc, - connection_count: Arc, - close_idle: Option>, - idle_closed: Option>, shutdown: Option>, accept_handle: Option>, } -impl StaleIdleServer { +impl DroppedConnectionServer { async fn start() -> Self { let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); let port = listener.local_addr().unwrap().port(); let request_count = Arc::new(AtomicUsize::new(0)); - let connection_count = Arc::new(AtomicUsize::new(0)); - let (close_idle_tx, close_idle_rx) = oneshot::channel(); - let (idle_closed_tx, idle_closed_rx) = oneshot::channel(); let (shutdown_tx, mut shutdown_rx) = oneshot::channel(); - let request_count_for_accept = request_count.clone(); - let connection_count_for_accept = connection_count.clone(); + let counter = request_count.clone(); let accept_handle = tokio::spawn(async move { - let mut first_close = Some(close_idle_rx); - let mut first_closed = Some(idle_closed_tx); - loop { tokio::select! { result = listener.accept() => { let Ok((stream, _)) = result else { break; }; - connection_count_for_accept.fetch_add(1, Ordering::SeqCst); - let request_count = request_count_for_accept.clone(); - let close_rx = first_close.take(); - let closed_tx = first_closed.take(); + let counter = counter.clone(); tokio::spawn(async move { - serve_stale_idle_connection( - stream, - request_count, - close_rx, - closed_tx, - ) - .await; + let (read_half, write_half) = stream.into_split(); + let mut reader = BufReader::new(read_half); + if read_http_request(&mut reader).await.is_some() { + counter.fetch_add(1, Ordering::SeqCst); + } + // Close without writing a response: dropping the + // write half sends the FIN the client observes + // mid-response. + drop(write_half); }); } _ = &mut shutdown_rx => break, @@ -268,9 +271,6 @@ impl StaleIdleServer { Self { port, request_count, - connection_count, - close_idle: Some(close_idle_tx), - idle_closed: Some(idle_closed_rx), shutdown: Some(shutdown_tx), accept_handle: Some(accept_handle), } @@ -280,63 +280,15 @@ impl StaleIdleServer { format!("http://127.0.0.1:{}/", self.port) } - async fn close_idle_connection(&mut self) { - self.close_idle - .take() - .expect("stale connection close command already sent") - .send(()) - .expect("stale connection handler exited before close command"); - self.idle_closed - .take() - .expect("stale connection close acknowledgement already received") - .await - .expect("stale connection handler dropped close acknowledgement"); - } - - async fn shutdown(&mut self) { + fn shutdown(&mut self) { let _ = self .shutdown .take() .expect("server already shut down") .send(()); - self.accept_handle - .take() - .expect("server accept task already joined") - .await - .expect("stale connection accept task panicked"); - } -} - -async fn serve_stale_idle_connection( - stream: tokio::net::TcpStream, - request_count: Arc, - close_rx: Option>, - closed_tx: Option>, -) { - let (read_half, mut write_half) = stream.into_split(); - let mut reader = BufReader::new(read_half); - if read_http_request(&mut reader).await.is_none() { - return; - } - - request_count.fetch_add(1, Ordering::SeqCst); - let keepalive = close_rx.is_some(); - let connection = if keepalive { "keep-alive" } else { "close" }; - let response = - format!("HTTP/1.1 200 OK\r\nContent-Length: 2\r\nConnection: {connection}\r\n\r\nok"); - if write_half.write_all(response.as_bytes()).await.is_err() || write_half.flush().await.is_err() - { - return; - } - - if let Some(close_rx) = close_rx { - let _ = close_rx.await; - let _ = write_half.shutdown().await; - let _ = closed_tx - .expect("first connection must carry close acknowledgement") - .send(()); - } else { - let _ = write_half.shutdown().await; + if let Some(handle) = self.accept_handle.take() { + handle.abort(); + } } } @@ -518,90 +470,60 @@ async fn retry_stream_body_sends_once() { } #[tokio::test] -async fn stale_idle_default_retries_transparently() { - let mut server = StaleIdleServer::start().await; +async fn dropped_connection_mid_request_surfaces_as_a_transport_error() { + let mut server = DroppedConnectionServer::start().await; let client = Client::new(); - let url = server.url(); - - let mut first = client.get(&url).unwrap().send().await.unwrap(); - assert_eq!(first.bytes().await.unwrap().as_ref(), b"ok"); - server.close_idle_connection().await; - - let mut second = client.get(&url).unwrap().send().await.unwrap(); - assert_eq!(second.status(), 200); - assert_eq!(second.bytes().await.unwrap().as_ref(), b"ok"); - assert_eq!(server.request_count.load(Ordering::SeqCst), 2); - assert_eq!(server.connection_count.load(Ordering::SeqCst), 2); - server.shutdown().await; -} - -#[tokio::test] -async fn stale_idle_strict_mode_surfaces_transport_failure() { - let mut server = StaleIdleServer::start().await; - let client = Client::builder().retry_canceled_requests(false).build(); - let url = server.url(); - let mut first = client.get(&url).unwrap().send().await.unwrap(); - assert_eq!(first.bytes().await.unwrap().as_ref(), b"ok"); - server.close_idle_connection().await; - - let result = client.get(&url).unwrap().send().await; - let error = result.expect_err("strict mode must not transparently retry"); + let error = client + .get(&server.url()) + .unwrap() + .send() + .await + .expect_err("a dropped connection must surface as an error"); assert_eq!(error.kind(), "hyper_client"); assert!(StdError::source(&error).is_some()); assert_eq!(server.request_count.load(Ordering::SeqCst), 1); - assert_eq!(server.connection_count.load(Ordering::SeqCst), 1); - server.shutdown().await; + server.shutdown(); } #[tokio::test] -async fn stale_idle_strict_mode_allows_explicit_retry() { - let mut server = StaleIdleServer::start().await; +async fn dropped_connection_mid_request_is_not_retried_by_a_policy() { + // A mid-request failure may already have reached the server, so it is + // never replayed: is_error_retryable excludes it and a configured policy + // must not mask it. + let mut server = DroppedConnectionServer::start().await; let policy = RetryPolicy::builder() - .max_attempts(2) + .max_attempts(3) .backoff_factor(0.0) .build(); - let client = Client::builder() - .retry_canceled_requests(false) - .retry(policy) - .build(); - let url = server.url(); - - let mut first = client.get(&url).unwrap().send().await.unwrap(); - assert_eq!(first.bytes().await.unwrap().as_ref(), b"ok"); - server.close_idle_connection().await; - - let mut second = client.get(&url).unwrap().send().await.unwrap(); - assert_eq!(second.status(), 200); - assert_eq!(second.bytes().await.unwrap().as_ref(), b"ok"); - assert_eq!(server.request_count.load(Ordering::SeqCst), 2); - assert_eq!(server.connection_count.load(Ordering::SeqCst), 2); - server.shutdown().await; + let client = Client::builder().retry(policy).build(); + + let error = client + .get(&server.url()) + .unwrap() + .send() + .await + .expect_err("a dropped connection must not be retried"); + assert_eq!(error.kind(), "hyper_client"); + assert_eq!(server.request_count.load(Ordering::SeqCst), 1); + server.shutdown(); } #[tokio::test] -async fn stale_idle_strict_mode_does_not_retry_one_shot_body() { - let mut server = StaleIdleServer::start().await; +async fn dropped_connection_mid_request_is_not_retried_for_a_one_shot_body() { + let mut server = DroppedConnectionServer::start().await; let client = Client::builder().retry_canceled_requests(false).build(); - let url = server.url(); - let mut first = client.get(&url).unwrap().send().await.unwrap(); - assert_eq!(first.bytes().await.unwrap().as_ref(), b"ok"); - server.close_idle_connection().await; - let body = RequestBody::from_stream( futures_util::stream::once(async { Ok::(bytes::Bytes::from_static(b"body")) }), Some(4), ); - let result = client.post(&url).unwrap().body(body).send().await; - assert!( - result.is_err(), - "strict mode must surface the stale-idle failure" - ); + + let result = client.post(&server.url()).unwrap().body(body).send().await; + assert!(result.is_err(), "a dropped connection must surface"); assert_eq!(server.request_count.load(Ordering::SeqCst), 1); - assert_eq!(server.connection_count.load(Ordering::SeqCst), 1); - server.shutdown().await; + server.shutdown(); } #[tokio::test] diff --git a/crates/eggfetch-ffi/Cargo.toml b/crates/eggfetch-ffi/Cargo.toml index fdc0a995..3f4111cf 100644 --- a/crates/eggfetch-ffi/Cargo.toml +++ b/crates/eggfetch-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eggfetch-ffi" -version = "0.3.0" +version = "0.4.0" edition.workspace = true rust-version.workspace = true license.workspace = true @@ -40,7 +40,14 @@ compression-deflate = ["eggfetch-core/compression-deflate"] multipart = ["eggfetch-core/multipart"] [dependencies] -eggfetch-core = { version = "0.3.0", path = "../eggfetch-core", default-features = false } +# The C ABI below is unconditional: `eggfetch_client_builder_follow_redirects`, +# `eggfetch_client_builder_max_redirects` and `eggfetch_client_builder_basic_auth` +# are always exported, so core must always provide the capabilities they drive. +# These two edges were previously satisfied by accident, through the old +# `proxy = ["http1", ...]` implication; core's `proxy` no longer selects the +# `http1` alias, so the requirement is declared here explicitly instead of +# leaving the FFI dependent on another feature's transitive closure. +eggfetch-core = { version = "0.4.0", path = "../eggfetch-core", default-features = false, features = ["redirects", "basic-auth"] } tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "net", "sync"] } bytes = "1" http = "1" diff --git a/crates/eggfetch-ffi/tests/protocol_capability_tests.rs b/crates/eggfetch-ffi/tests/protocol_capability_tests.rs index 02930634..c9ea41d8 100644 --- a/crates/eggfetch-ffi/tests/protocol_capability_tests.rs +++ b/crates/eggfetch-ffi/tests/protocol_capability_tests.rs @@ -67,11 +67,45 @@ impl CountingServer { Ok((mut stream, _)) => { ac.fetch_add(1, Ordering::SeqCst); thread::spawn(move || { - let _ = stream.set_read_timeout(Some(Duration::from_millis(500))); + // Read until the request head is complete. A single + // read() can return a partial head, and it can time + // out before the client has written anything at all; + // answering in either case fabricates a response for + // a request the server never received, which the + // caller then observes as a failed send rather than + // as the protocol decision under test. + // The listener is non-blocking, and macOS + // accepts sockets with O_NONBLOCK inherited, so a + // read here can fail with WouldBlock before the + // client has written anything. Block explicitly so + // the head read waits for the request instead of + // racing it. This is a no-op on platforms whose + // accept() returns blocking sockets. + let _ = stream.set_nonblocking(false); + let _ = stream.set_read_timeout(Some(Duration::from_secs(5))); + let mut head = Vec::new(); let mut buffer = [0_u8; 1024]; - let _ = stream.read(&mut buffer); - let _ = - stream.write_all(b"HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nok"); + loop { + match stream.read(&mut buffer) { + Ok(0) => break, + Ok(read) => { + head.extend_from_slice(&buffer[..read]); + if head.windows(4).any(|window| window == b"\r\n\r\n") { + break; + } + } + // A retried read is the only error worth + // continuing for; anything else (including + // the timeout) means no usable head. + Err(ref error) + if error.kind() == std::io::ErrorKind::Interrupted => {} + Err(_) => break, + } + } + if head.windows(4).any(|window| window == b"\r\n\r\n") { + let _ = stream + .write_all(b"HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nok"); + } }); } Err(ref error) if error.kind() == std::io::ErrorKind::WouldBlock => { diff --git a/crates/eggfetch-http-connect/Cargo.toml b/crates/eggfetch-http-connect/Cargo.toml index f4ee9876..e6f8d989 100644 --- a/crates/eggfetch-http-connect/Cargo.toml +++ b/crates/eggfetch-http-connect/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eggfetch-http-connect" -version = "0.3.0" +version = "0.4.0" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/eggfetch-node/Cargo.toml b/crates/eggfetch-node/Cargo.toml index 5faad741..be5c977e 100644 --- a/crates/eggfetch-node/Cargo.toml +++ b/crates/eggfetch-node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eggfetch-node" -version = "0.3.0" +version = "0.4.0" edition.workspace = true rust-version.workspace = true license.workspace = true @@ -19,7 +19,7 @@ crate-type = ["cdylib"] napi-build = "2" [dependencies] -eggfetch-ffi = { version = "0.3.0", path = "../eggfetch-ffi", default-features = false, features = ["http1", "tls-rustls", "tls-native-roots"] } +eggfetch-ffi = { version = "0.4.0", path = "../eggfetch-ffi", default-features = false, features = ["http1", "tls-rustls", "tls-native-roots"] } napi = { version = "2", features = ["async", "napi8", "serde-json"] } napi-derive = "2" serde = { version = "1", features = ["derive"] } diff --git a/crates/eggfetch-node/package-lock.json b/crates/eggfetch-node/package-lock.json index a84f9a29..39c553a3 100644 --- a/crates/eggfetch-node/package-lock.json +++ b/crates/eggfetch-node/package-lock.json @@ -1,12 +1,12 @@ { "name": "eggfetch-node", - "version": "0.3.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eggfetch-node", - "version": "0.3.0", + "version": "0.4.0", "license": "MIT OR Apache-2.0", "devDependencies": { "@napi-rs/cli": "^3.0.0" diff --git a/crates/eggfetch-node/package.json b/crates/eggfetch-node/package.json index f77881ec..bc6bc4f7 100644 --- a/crates/eggfetch-node/package.json +++ b/crates/eggfetch-node/package.json @@ -1,6 +1,6 @@ { "name": "eggfetch-node", - "version": "0.3.0", + "version": "0.4.0", "description": "Experimental Node.js prototype bindings for eggfetch (unsupported API surface)", "main": "index.js", "types": "index.d.ts", diff --git a/crates/eggfetch-python/Cargo.toml b/crates/eggfetch-python/Cargo.toml index eb924233..496f7b98 100644 --- a/crates/eggfetch-python/Cargo.toml +++ b/crates/eggfetch-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eggfetch-python" -version = "0.3.0" +version = "0.4.0" edition.workspace = true rust-version.workspace = true license.workspace = true @@ -23,7 +23,7 @@ proxy = ["eggfetch-core/proxy"] crate-type = ["cdylib", "rlib"] [dependencies] -eggfetch-core = { version = "0.3.0", path = "../eggfetch-core", features = ["cookies", "multipart", "proxy", "compression-gzip", "compression-brotli", "compression-zstd", "compression-deflate", "http2", "http3"] } +eggfetch-core = { version = "0.4.0", path = "../eggfetch-core", features = ["cookies", "multipart", "proxy", "compression-gzip", "compression-brotli", "compression-zstd", "compression-deflate", "http2", "http3"] } pyo3 = { version = "0.29", features = ["extension-module"] } pyo3-async-runtimes = { version = "0.29", features = ["tokio-runtime"] } tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "net", "fs"] } diff --git a/crates/eggfetch-python/pyproject.toml b/crates/eggfetch-python/pyproject.toml index 7fa885f2..83255bb3 100644 --- a/crates/eggfetch-python/pyproject.toml +++ b/crates/eggfetch-python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "eggfetch" -version = "0.3.0" +version = "0.4.0" description = "Python bindings for eggfetch" readme = "../../README.md" requires-python = ">=3.10" diff --git a/crates/eggfetch-python/tests/test_sync.py b/crates/eggfetch-python/tests/test_sync.py index 03dd88c8..4b827d63 100644 --- a/crates/eggfetch-python/tests/test_sync.py +++ b/crates/eggfetch-python/tests/test_sync.py @@ -93,7 +93,7 @@ def server(): class TestPackageImports: def test_import_version(self): assert isinstance(eggfetch.__version__, str) - assert eggfetch.__version__ == "0.3.0" + assert eggfetch.__version__ == "0.4.0" def test_native_ssl_interop_does_not_import_compat_facade(self): before = {name for name in sys.modules if name.startswith("eggfetch.compat")} diff --git a/docs/architecture/core-auth-redirect-retry.md b/docs/architecture/core-auth-redirect-retry.md index 7f68ab24..98be3fa7 100644 --- a/docs/architecture/core-auth-redirect-retry.md +++ b/docs/architecture/core-auth-redirect-retry.md @@ -17,6 +17,34 @@ without following and with empty history, and no core `base64` edge from `basic- The policy-only `native-http1` + `high-level-url` + `tls-rustls` recipe without the three policy features remains a valid manual profile where advanced routing (Dialer, pinned/SNI, UDS) is still needed. + +The `proxy` feature selects `native-http1` rather than the `http1` alias, so +a consumer that wants proxy support does not also compile in the +`logical-retry`, `redirects`, or `basic-auth` policy bundle. The proxy +transport uses none of them: the proxy implementation lives in `proxy.rs`, +`transport/proxy.rs`, and `pipeline/proxy_dispatch.rs`, and none of those +references a policy item. Proxy auth keeps its own `base64` edge, so the +`Proxy-Authorization` encoding is unaffected by dropping `basic-auth`. + +The two disable switches are available in every profile, because a profile +without the corresponding capability has nothing to disable and the caller +still needs to say so: + +- `RequestBuilder::without_retry()` sets the always-present + `Request::retry_disabled` flag. With `logical-retry` enabled the gated + retry loop consults that flag and dispatches exactly once, matching the + previous `Option` override. Without it there is no retry + engine, so the request is already dispatched once and the call is a + semantic no-op. A later `RequestBuilder::retry(policy)` re-enables + retries, preserving the previous setter order. +- `RequestBuilder::redirect_policy(policy)` stores an + `Option` that is always present. With `redirects` enabled + the override is honored exactly as before. Without it there is no + redirect loop, so a 3xx response is returned unchanged and the stored + policy has no effect. `RedirectPolicy` and `RedirectDowngradePolicy` + themselves are therefore available in every profile; the client-level + `ClientBuilder::redirect_policy` stays gated on `redirects` because the + client-level policy is the redirect loop's own default. `Client::send`/`send_detailed` dispatch to `pipeline::retry::send_with_retry` when `logical-retry` is present, to `pipeline::redirect::send_with_redirects` when only `redirects` is present, diff --git a/docs/architecture/feature-flags.md b/docs/architecture/feature-flags.md index eb64909f..ba584227 100644 --- a/docs/architecture/feature-flags.md +++ b/docs/architecture/feature-flags.md @@ -41,14 +41,16 @@ compression-zstd = ["dep:async-compression", "async-compression/zstd", "dep:toki compression-deflate = ["dep:async-compression", "async-compression/deflate", "async-compression/zlib", "dep:tokio-util", "tokio/io-util", "dep:flate2"] cookies = ["dep:cookie", "high-level-url"] multipart = ["dep:getrandom"] -proxy = ["http1", "tls-rustls", "tokio/io-util", "high-level-url", "dep:eggfetch-http-connect", "dep:base64"] +proxy = ["native-http1", "tls-rustls", "tokio/io-util", "high-level-url", "dep:eggfetch-http-connect", "dep:base64"] tracing = ["dep:tracing"] test-util = ["tokio/test-util"] ``` `http1`/`http2` are compatibility aliases: they preserve the existing high-level string/URL API plus logical retry, redirect following, and Basic -auth. `transport-http1`/`transport-http2` are primitive Hyper protocol +auth. The `proxy` feature selects `native-http1` rather than the `http1` +alias, so a consumer that only wants proxy support does not also compile +in the logical-retry, redirect, and Basic-auth policy bundle. `transport-http1`/`transport-http2` are primitive Hyper protocol slices; `standard-route` is the ordinary DNS -> TCP/TLS path; `advanced-routing` owns custom Dialer, DirectConnector / local-address / socket options, resolved-target/pinned-address cache, SNI-override cache, @@ -84,7 +86,7 @@ the profiles exclude `http2`, `http3`, `json`, all compression features, | Profile | Cargo recipe | Includes | | --- | --- | --- | -| Ordinary default | `eggfetch-core = { version = "0.3" }` | H1, Rustls, native roots preferred with WebPKI construction fallback | +| Ordinary default | `eggfetch-core = { version = "0.4" }` | H1, Rustls, native roots preferred with WebPKI construction fallback | | H1 cleartext | `default-features = false, features = ["http1"]` | HTTP/1.1 only; HTTPS is unavailable | | H1 deterministic HTTPS | `default-features = false, features = ["http1", "tls-rustls"]` | H1, Rustls, packaged WebPKI roots; no system-store loading | | H1 native-root HTTPS | `default-features = false, features = ["http1", "tls-rustls", "tls-native-roots"]` | H1, Rustls, native roots with WebPKI construction fallback; explicit form of the default trust profile | @@ -102,10 +104,18 @@ trust store. Native embedding slices (manual, not Tier 2 gates): replace `http1` with `native-http1` (and `http2` with `native-http2`) and omit `high-level-url` to build the `Client::execute_http_body`/`NativeHttpService` transport -without `url`, `idna`, ICU, or `percent-encoding`. Example: -`default-features = false, features = ["native-http1", "tls-rustls"]`. -Built-in proxy, cookies, HTTP/3, and the string-URL `RequestBuilder` API -require `high-level-url` and are unavailable in the minimal slice. +without `url`, `idna`, ICU, or `percent-encoding`. + +Proxy-only slice (manual, not a gated profile): select +`default-features = false, features = ["native-http1", "tls-rustls", "proxy"]` +for proxy routing without the `logical-retry`/`redirects`/`basic-auth` +policy bundle. It keeps `high-level-url` (the proxy feature lists it +explicitly), so the `url`/IDNA/ICU closure is still present; only the policy +bundle is gone. Because `proxy` keeps `high-level-url`, the string-URL +`RequestBuilder` API is usable in this slice; cookie handling and HTTP/3 +still need the `cookies` and `http3` features. In the minimal slice above, +which omits `high-level-url`, built-in proxy, cookies, HTTP/3, and the +string-URL `RequestBuilder` API are all unavailable. For the leanest standard-route native transport without advanced routing, select `transport-http1` + `standard-route` (e.g. `default-features = false, features = ["transport-http1", "standard-route", "tls-rustls"]`); @@ -224,18 +234,61 @@ High-level string/URL request semantics backed by `url` (plus routing. Native callers provide a valid `http::Uri` and own any IDNA/punycode conversion; the native path performs none. +A consumer that wants the *builder* API without this feature uses the +[Native request builder](#native-request-builder) instead. + +### Native request builder + +**Status:** implemented (no feature gate). +`Client::get_uri`, `Client::post_uri`, and `Client::request_uri` build a +request from an already-parsed `http::Uri` and return a +`NativeRequestBuilder`. The builder and its `Client` entry points are +available in every profile, including the minimal native slice, so a +consumer can build and dispatch a request without the `url`/`idna`/ICU +closure that `high-level-url` pulls in. + +The native builder dispatches through the same frame-preserving transport as +`Client::execute_http_body`: exactly one attempt, no redirects, no logical +retries, no cookies, no authentication, no response decompression, and no +decoded-body limits. The built-in proxy and HTTP/3 routes reject native +frame bodies, and the caller owns IDNA/punycode conversion before +constructing the `http::Uri`. + +The native builder is a separate type from the high-level +`RequestBuilder` on purpose. The high-level builder owns URL semantics +(query pairs, relative redirect resolution, cookie and proxy matching by +URL) and returns the high-level `Response`; the native builder owns only +the wire-level request and returns a plain `http::Response`. Keeping them +separate means a native consumer does not pull in the URL layer, and it +keeps the existing high-level signatures intact. + +`NativeRequestBuilder::without_retry()` and +`NativeRequestBuilder::redirect_policy()` are available here for the same +reason they are available on the high-level builder: the native transport +already satisfies both assertions (one attempt, no redirect following), so +the setters let one request-building code path express the same +single-attempt contract in every profile. + ### logical-retry **Status:** implemented. Logical retry orchestration: `RetryPolicy`/`RetryPolicyBuilder`, `BackoffPolicy`/`MethodPolicy`/`StatusPolicy`, backoff/jitter (`getrandom`), `Retry-After` HTTP-date parsing (`httpdate`), replay checks, -and the `ClientBuilder::retry` / `RequestBuilder::retry` / -`without_retry` APIs plus the `pipeline::retry` loop. Enabled by the -`http1`/`http2` compatibility aliases; omitted by the lean profile, which -dispatches once under the outer total deadline. Hyper's distinct -canceled-idle-request retry (`retry_canceled_requests`) is transport policy -and remains available in all profiles. +and the `ClientBuilder::retry` / `RequestBuilder::retry` APIs plus the +`pipeline::retry` loop. Enabled by the `http1`/`http2` compatibility +aliases; omitted by the lean profile, which dispatches once under the outer +total deadline. Hyper's distinct canceled-idle-request retry +(`retry_canceled_requests`) is transport policy and remains available in all +profiles. + +`RequestBuilder::without_retry()` is available in every profile. It is a +disable switch, so a caller must be able to express "this request is not +retried" even where the retry engine is compiled out. With `logical-retry` +enabled it suppresses the client-level policy exactly as before; without it +there is no retry engine to disable, so the request is already dispatched +once and the call is a semantic no-op. The backing state is an always-present +`Request::retry_disabled` flag, which the gated retry loop consults. ### redirects @@ -247,6 +300,15 @@ history (`Response::history`), and the `RedirectPolicy` / compatibility aliases; omitted by the lean profile, which returns 3xx responses as ordinary responses with no second hop and no history. +`RedirectPolicy`/`RedirectDowngradePolicy` and +`RequestBuilder::redirect_policy()` are available in every profile. The +policy is a disable switch, so a caller must be able to name it and attach +it even where the redirect loop is compiled out. With `redirects` enabled the +override is honored exactly as before; without it there is no redirect loop, +so a stored policy has no effect and a 3xx response is returned unchanged. +The client-level `ClientBuilder::redirect_policy` stays gated on `redirects`, +because the client-level policy is the redirect loop's own default. + ### basic-auth **Status:** implemented. @@ -401,8 +463,13 @@ with neither feature omit core's direct `getrandom` edge (transitive **Status:** implemented. Enables HTTP proxy and SOCKS5 proxy support in eggfetch-core. The feature -implies `http1` and `tls-rustls` because HTTPS proxy endpoints, CONNECT -tunnels, and HTTPS-over-SOCKS require the Rustls transport. Provides HTTP +implies `native-http1` and `tls-rustls` because HTTPS proxy endpoints, +CONNECT tunnels, and HTTPS-over-SOCKS require the Rustls transport. It +implies `native-http1` rather than the `http1` alias, so a consumer that +selects only `proxy` does not also compile in the `logical-retry`, +`redirects`, and `basic-auth` policy bundle: the proxy transport uses none +of them. The `http1`/`http2` aliases still carry the full policy bundle, so +the CLI and Python adapters are unchanged. Provides HTTP proxying, HTTPS CONNECT tunneling, SOCKS5 tunneling (socks5:// and socks5h://), proxy authentication, per-request and per-client proxy configuration via `ClientBuilder::proxy()` and `RequestBuilder::proxy()`, and `NO_PROXY`-style diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md index 3fe9e561..9c531562 100644 --- a/docs/architecture/overview.md +++ b/docs/architecture/overview.md @@ -44,7 +44,7 @@ This document is the bird's-eye view: what each discrete module, tool, and capab 1. **Single networking implementation** — all HTTP logic lives in `eggfetch-core` plus the small `eggfetch-http-connect` CONNECT wire primitive it owns. CLI, Python, FFI, and Node never touch the network directly. 2. **Async-first** — the Rust engine is async-only (tokio). Synchronous APIs are adapter-layer concerns that block on the async engine (Python sync releases the GIL; Node prototype uses `spawn_blocking` over FFI). -3. **Feature-gated modularity** — default is HTTP/1.1 + Rustls TLS with the high-level URL API plus logical retry, redirect following, and Basic auth. HTTP/2, HTTP/3, cookies, compression, multipart, and proxy are opt-in via Cargo features; `native-http1`/`native-http2` without `high-level-url` select the low-level `http::Request` transport without `url`/`idna`/ICU (retaining advanced routing). The lean Bearer-only profile selects `standard-http1` + `tls-rustls` (transport + standard route + URL API without `advanced-routing` or the `logical-retry`/`redirects`/`basic-auth` policy bundle) for single-attempt 3xx-passthrough standard-route clients. +3. **Feature-gated modularity** — default is HTTP/1.1 + Rustls TLS with the high-level URL API plus logical retry, redirect following, and Basic auth. HTTP/2, HTTP/3, cookies, compression, multipart, and proxy are opt-in via Cargo features; the `proxy` feature selects `native-http1` rather than the `http1` alias, so proxy support does not pull the logical-retry/redirect/Basic-auth policy bundle; `native-http1`/`native-http2` without `high-level-url` select the low-level `http::Request` transport without `url`/`idna`/ICU (retaining advanced routing). The lean Bearer-only profile selects `standard-http1` + `tls-rustls` (transport + standard route + URL API without `advanced-routing` or the `logical-retry`/`redirects`/`basic-auth` policy bundle) for single-attempt 3xx-passthrough standard-route clients. 4. **Security by default** — `unsafe_code = "forbid"` workspace-wide (only `eggfetch-ffi` and `eggfetch-node` override to `"allow"` for FFI/N-API), credential redaction, CR/LF injection prevention, fail-closed TLS translation. 5. **Typed reconstruction, no silent drops** — request rebuilds for retry/redirect go through exhaustive helpers (`RequestParts::retry_request`, `advance_redirect_hop`); a new field must fail to compile, never be silently dropped. (`into_request` is a test-only round-trip anchor, not a live dispatch path.) @@ -125,9 +125,10 @@ All HTTP behavior lives here (top-level modules plus `transport/`, `stream/`, an | Module | Public? | Purpose | |--------|---------|---------| | `client` | Yes | `Client`, `ClientBuilder` — entry point for all requests. Holds hyper client families (standard, direct/specialized, UDS, SOCKS, SNI-override, resolved-destination, forward/CONNECT, H3) plus pool and config. Builder pattern with comprehensive configuration. | -| `request` | Yes (requires `high-level-url`) | `Request`, `RequestBuilder`, `ProxyOverride` — fluent string-URL construction (`header()`, `query()`, `body()`, `json()`, `timeout()`, `auth()`, `decompress()`, `proxy(&Proxy)` / `without_proxy()` / `proxy_target_addresses()`, `retry()`, `resolved_addresses()` — the last requires `advanced-routing` and is absent from lean profiles). `send()` delegates to the crate-internal client dispatch. Protocol-neutral `ResolvedTarget`/`TransportHints`/`NativeRequestOptions` live in `transport_hints` so the native slice compiles without `url`; hints survive retry reconstruction, while same-origin redirects retain `resolved_target` + `proxied_target` and clear `target`/`sni_hostname`/`trace`, and cross-origin redirects fail closed. See also the `transport_hints` row below. | +| `request` | Yes (requires `high-level-url`) | `Request`, `RequestBuilder`, `ProxyOverride` — fluent string-URL construction (`header()`, `query()`, `body()`, `json()`, `timeout()`, `auth()`, `decompress()`, `proxy(&Proxy)` / `without_proxy()` / `proxy_target_addresses()`, `retry()`, `resolved_addresses()` — the last requires `advanced-routing` and is absent from lean profiles). `without_retry()` and `redirect_policy()` are available in every profile; they are disable switches, so a caller must be able to express them where the corresponding capability is compiled out. `send()` delegates to the crate-internal client dispatch. Protocol-neutral `ResolvedTarget`/`TransportHints`/`NativeRequestOptions` live in `transport_hints` so the native slice compiles without `url`; hints survive retry reconstruction, while same-origin redirects retain `resolved_target` + `proxied_target` and clear `target`/`sni_hostname`/`trace`, and cross-origin redirects fail closed. See also the `transport_hints` row below. | | `response` | Yes (requires `high-level-url`) | `Response`, `HistoryEntry` — status, version, headers, URL, body, redirect history, trailers (`trailers()` after EOF). Consumption: `bytes()`, `text()`, `bytes_stream()`, `raw_bytes_stream()`, `text_lines()`. | | `body` | Yes | `RequestBody`, `ResponseBody`, `NativeResponseBody`, `BoxBytesStream`, `SharedTrailers` — single-consumption body model. Request: `Empty \| Bytes \| Stream`. Response: `Buffered \| Streaming \| EncodedStreaming \| Consumed`. Streaming bodies hold an `Arc` lease (internal crate-private `PoolGuardArc` alias) until terminal `Err`/EOF via the fused `LeasedResponseStream`; buffered bodies drop the lease at finalization, before the caller reads. Trailers populate without buffering via shared store. Per-chunk timeouts are enforced by the crate-private `BodyTimeoutStream` (via `body_timeout_stream`) / `WriteTimeoutStream` (via `write_timeout_stream`) wrappers. | +| `native_request` | Yes | `NativeRequestBuilder` — URL-free request builder over a caller-supplied `http::Uri` (`Client::get_uri()` / `post_uri()` / `request_uri()`). Dispatches through the native frame-preserving transport: exactly one attempt, no redirects, no logical retries, no cookies, no authentication, no response decompression. The caller owns IDNA/punycode conversion. | | `service` | Yes | `NativeHttpService` — always-ready `tower_service::Service` adapter over native frame execution. | | `headers` | Yes | `Headers` — case-insensitive header map wrapper around `http::HeaderMap`. | | `error` | Yes | `Error` enum, `RequestFailure` opt-in detail wrapper, `NetworkFailureKind` classifier, and `Result` alias. Comprehensive taxonomy (`InvalidUrl` … `Http2*`, `H3*`, `ResolvedTargetRedirect`, JSON errors, `TraceCallbackAborted`) with `kind()` returning static strings for programmatic matching. | @@ -142,7 +143,7 @@ All HTTP behavior lives here (top-level modules plus `transport/`, `stream/`, an | `transport/metrics` | Yes | `TransportMetrics`, `TransportSnapshot` (+ `H3CloseKind`, `H3CloseSummary`, `H3ConnectionDiagnostic`, `H3RouteKind` under `http3`) — connector/DNS/TLS, UDS/proxy, physical admission waits/timeouts/live/high-water, established I/O inactivity timeouts, H3 creation/eviction, Alt-Svc learned/expired/cleared/rejected, H3 attempted/suppressed/fallback/drain/close/reconnect, 101 upgrades. Separate from `PoolMetrics`; physical Hyper reuse is not represented as a logical permit metric. | | `proxy` | Yes | `Proxy`, `ProxyConfig`, `ProxyAuth`, `NoProxy`, `NoProxyRule`, `ProxyDecision` — HTTP forwarding, HTTPS CONNECT tunneling, SOCKS5. Per-request override model. (cfg `proxy`) | | `redact` | Yes | `redact_headers()`, `SENSITIVE_HEADERS` plus `redact_url()`/`redact_url_string()` (require `high-level-url`) — centralized secret redaction for all `Debug`/`Display`/error output. | -| `redirect` | Yes (requires `redirects`) | `RedirectPolicy`, `redirect_method()`, `build_redirect_request()` (+ `build_redirect_request_with_redirect_policy()`; live pipeline uses crate-private `build_redirect_request_with_policy`) — method rewrites (303→GET), cross-origin header stripping, body replayability checks. Absent in the lean profile, which returns 3xx without following. | +| `redirect` | Yes | `RedirectPolicy`, `RedirectDowngradePolicy`, `is_redirect_status()`, `redirect_method()`, and `drops_body_on_redirect()` are available in every profile. The URL-based helpers — `check_downgrade()`, `is_https_downgrade()`, `check_https_downgrade()`, `build_redirect_request()`, and `build_redirect_request_with_redirect_policy()` (the live pipeline uses the crate-private `build_redirect_request_with_policy`) — require `high-level-url`. Method rewrites (303→GET), cross-origin header stripping, and body replayability checks run only when the `redirects` pipeline is compiled in; the lean profile returns 3xx without following. | | `retry` | Yes (requires `logical-retry`) | `RetryPolicy`, `RetryPolicyBuilder`, `BackoffPolicy`, `MethodPolicy`, `StatusPolicy`, `RetryCause` — exponential backoff+jitter, `Retry-After` support. Default retryable methods are `GET`/`HEAD`/`OPTIONS` only (POST/PUT/PATCH/DELETE off by default). Absent in the lean profile, which dispatches once. | | `timeout` | Yes | `Timeout`, `TimeoutBuilder`, `TimeoutPhase` — 7 phases (Pool, Connect, ProxyConnect, ProxyTls, Write, Read, Total). Request-level overrides merge with client-level per-field. | | `tls` | Yes | `TlsConfig`, `TlsConfigBuilder`, `TlsVersion`, `TrustStore`, `ClientIdentity` — replacement or additional CA roots, mTLS certs, verification toggle, version bounds. | diff --git a/docs/architecture/rust-surface-containment.md b/docs/architecture/rust-surface-containment.md index 92a1fbbd..a0e52d88 100644 --- a/docs/architecture/rust-surface-containment.md +++ b/docs/architecture/rust-surface-containment.md @@ -42,6 +42,21 @@ record, not a proposal to hide or redesign existing public items. - `Pool`, `PoolConfig`, `PoolMetrics`, and `PoolGuard`: existing public types and lifecycle/metrics observations remain frozen; route/cache refactors do not introduce a second pool or expose its private keys. +- `NativeRequestBuilder` and `Client::{get_uri, post_uri, request_uri}`: the + URL-free request builder. Its public surface is exactly the builder type, + the three `Client` entry points, and the builder's own methods. It is a + separate type from the high-level `RequestBuilder` on purpose: the + high-level builder owns URL semantics and returns the high-level + `Response`, while the native builder owns only the wire-level request and + returns a plain `http::Response`. The two are not unified behind one + type, so no existing high-level signature changes. +- `RedirectPolicy`, `RedirectDowngradePolicy`, and the request-level + `redirect_policy`/`without_retry` setters: available in every profile so a + caller can express a disable switch where the corresponding capability is + compiled out. The client-level `ClientBuilder::redirect_policy` and the + `RetryPolicy` types stay feature-gated, because the client-level policy + is the redirect loop's own default and the retry policy types own the + retry-only dependencies. Historical compatibility re-exports and feature-specific availability are covered by the six profile snapshots in `compat/rust-public-api/`. The exact diff --git a/docs/ffi/README.md b/docs/ffi/README.md index c6d78f09..add836b4 100644 --- a/docs/ffi/README.md +++ b/docs/ffi/README.md @@ -126,9 +126,19 @@ Cargo features: ```toml [dependencies] -eggfetch-ffi = { version = "0.3", features = ["http2", "cookies", "proxy"] } +eggfetch-ffi = { version = "0.4", features = ["http2", "cookies", "proxy"] } ``` +The exported C ABI is fixed, so some capabilities are always on regardless of +the flags selected: redirect control +(`eggfetch_client_builder_follow_redirects`, +`eggfetch_client_builder_max_redirects`) and Basic auth +(`eggfetch_client_builder_basic_auth`) require core's `redirects` and +`basic-auth`, which the crate's `eggfetch-core` dependency names explicitly. +They are not obtainable by turning `proxy` on: core's `proxy` feature +selects `native-http1` and does not imply the +`logical-retry`/`redirects`/`basic-auth` policy bundle. + ## Node.js Binding See `crates/eggfetch-node/` for a prototype Node.js binding using `napi-rs`. diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 90c9ddcf..e0380d88 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -27,7 +27,7 @@ Add to your `Cargo.toml`: ```toml [dependencies] -eggfetch-core = { version = "0.3", features = ["http1", "tls-rustls", "tls-native-roots"] } +eggfetch-core = { version = "0.4", features = ["http1", "tls-rustls", "tls-native-roots"] } ``` ### Feature flags @@ -61,14 +61,14 @@ default. For a deterministic embedded HTTPS client without system trust loading: ```toml -eggfetch-core = { version = "0.3", default-features = false, features = ["http1", "tls-rustls"] } +eggfetch-core = { version = "0.4", default-features = false, features = ["http1", "tls-rustls"] } ``` For a lean Bearer-only standard-route client (no advanced routing or retry/redirect/Basic machinery): ```toml -eggfetch-core = { version = "0.3", default-features = false, features = ["standard-http1", "tls-rustls"] } +eggfetch-core = { version = "0.4", default-features = false, features = ["standard-http1", "tls-rustls"] } ``` For cleartext-only: `features = ["http1"]` alone. Measured downstream diff --git a/docs/reference/compatibility-stage-decision.md b/docs/reference/compatibility-stage-decision.md index 99e89229..fa357924 100644 --- a/docs/reference/compatibility-stage-decision.md +++ b/docs/reference/compatibility-stage-decision.md @@ -5,11 +5,16 @@ The documented asyncio-supported public surfaces for `eggfetch.compat.httpx` (HTTPX 0.28.1) and `eggfetch.compat.httpx2` (HTTPX2 2.12.0) passed Stage C qualification on frozen executable SHA -`cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` (2026-11-16). The full -compatibility, extended, package, and live security gates passed on that -freeze. Earlier bindings are historical. Current evidence and binding history -are in `plans/httpx-parity-correction-status.md`; the exact facade scopes are -in `compat/httpx/0.28.1/profile.toml` and `compat/httpx2/2.12.0/profile.toml`. +`cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` (2026-11-16), where the full +compatibility, extended, package, and live security gates passed. + +**That binding is invalidated.** Core Transport M011 changed executable inputs +after it; the milestone's freeze `49f8910d…` carries Tier 1 evidence only, and +the current tree is unqualified. A fresh exact-SHA qualification is required +before any Stage C binding can be cited. Earlier bindings are historical. +Current evidence and binding history are in +`plans/httpx-parity-correction-status.md`; the exact facade scopes are in +`compat/httpx/0.28.1/profile.toml` and `compat/httpx2/2.12.0/profile.toml`. Stage C is not an unrestricted HTTPX replacement. eggfetch does not provide the top-level `httpx` distribution, Trio or AnyIO support, Python 3.8 or 3.9 diff --git a/docs/reference/compatibility.md b/docs/reference/compatibility.md index a55b533f..50a1d2f6 100644 --- a/docs/reference/compatibility.md +++ b/docs/reference/compatibility.md @@ -106,10 +106,13 @@ the GIL. ## Qualification status -The HTTPX 0.28.1 and HTTPX2 2.12.0 facades are Stage C qualified on frozen -executable SHA `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` (2026-11-16). The -full compatibility, extended, package, and live security gates passed on that -freeze. Earlier bindings are historical. Current evidence is in +The HTTPX 0.28.1 and HTTPX2 2.12.0 facades **were** Stage C qualified on +frozen executable SHA `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` (2026-11-16), +where the full compatibility, extended, package, and live security gates passed. +**That binding is invalidated**: Core Transport M011 changed executable inputs, +its freeze `49f8910d…` has Tier 1 evidence only, and the current tree is +unqualified. A fresh exact-SHA qualification is required before any binding can +be cited. Earlier bindings are historical. Current evidence is in `plans/httpx-parity-correction-status.md`; exact facade scopes are recorded in `compat/httpx/0.28.1/profile.toml` and `compat/httpx2/2.12.0/profile.toml`. diff --git a/docs/reference/feature-matrix.md b/docs/reference/feature-matrix.md index b610b9bc..49b27358 100644 --- a/docs/reference/feature-matrix.md +++ b/docs/reference/feature-matrix.md @@ -43,7 +43,7 @@ no supported profile is covered only as a side effect of `--all-features`. | Profile | Cargo recipe | Tier 1 contract matrix | Tier 2 public-surface oracle | Other gates | | --- | --- | --- | --- | --- | -| Ordinary default | `eggfetch-core = { version = "0.3" }` | yes | yes | Tier 1 workspace tests and clippy run `--all-features`; Tier 2 feature matrix runs `cargo check --all-features` | +| Ordinary default | `eggfetch-core = { version = "0.4" }` | yes | yes | Tier 1 workspace tests and clippy run `--all-features`; Tier 2 feature matrix runs `cargo check --all-features` | | H1 deterministic HTTPS | `default-features = false, features = ["http1", "tls-rustls"]` | yes | yes | Tier 2 feature matrix and the feature-gated tests (compression, proxy) build on this feature set | | H2 deterministic HTTPS | `default-features = false, features = ["http2", "tls-rustls"]` | yes | yes | none | | H1 lean Bearer client | `default-features = false, features = ["standard-http1", "tls-rustls"]` | yes | yes | Tier 1 lean behavioral suites `lean_policy_tests` and `lean_route_tests` run under this profile | @@ -67,7 +67,8 @@ M009. | API | Available | | --- | --- | | `Client` / `ClientBuilder` | Yes | -| `RequestBuilder` with method chaining | Yes | +| `RequestBuilder` with method chaining | Yes (requires `high-level-url`) | +| `NativeRequestBuilder` + `Client::{get_uri, post_uri, request_uri}` | Yes (URL-free builder over `http::Uri`; available in every profile, including those without `high-level-url`) | | `Response` (buffered + streaming) | Yes | | `Timeout` / `TimeoutBuilder` | Yes | | `TlsConfig` / `TlsConfigBuilder` | Yes | @@ -78,7 +79,7 @@ M009. | `BasicAuth` | Yes (requires `basic-auth`; lean profiles are Bearer-only) | | `BearerAuth` | Yes (available in all profiles, including lean) | | `HttpVersionPolicy` | Yes | -| `RedirectPolicy` | Yes (requires `redirects`; lean profiles return 3xx without following) | +| `RedirectPolicy` / `RedirectDowngradePolicy` | Yes (available in every profile; following redirects requires `redirects`, and lean profiles return 3xx without following) | | `Dialer` / `DialTarget` / `SocketOption` | Yes (require `advanced-routing`; absent from lean profiles) | | `ClientBuilder::dialer` / `local_address` / `socket_options` / `uds_path` | Yes (require `advanced-routing`; absent from lean profiles) | | `RequestBuilder::resolved_addresses` / `TransportHints::{sni_hostname, resolved_target}` | Yes (require `advanced-routing`; fail closed with `Unsupported` in lean profiles) | diff --git a/docs/residual-differences.md b/docs/residual-differences.md index 85aed2d9..f4a7f1ec 100644 --- a/docs/residual-differences.md +++ b/docs/residual-differences.md @@ -1,7 +1,12 @@ # Residual Differences from HTTPX 0.28.1 -The HTTPX 0.28.1 and httpx2 2.12.0 facades are Stage C qualified on frozen -executable SHA `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` (2026-11-16). The +The HTTPX 0.28.1 and httpx2 2.12.0 facades **were** Stage C qualified on +frozen executable SHA `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` (2026-11-16); +**that binding is invalidated** by Core Transport M011, which changed executable +inputs and has only Tier 1 evidence at its freeze `49f8910d…`. The current tree +is unqualified, and a fresh exact-SHA qualification is required before any +binding can be cited; the live state is recorded in +`plans/httpx-parity-correction-status.md`. The M011–M012 security correctives (H3 dial-path trust + qualification hygiene) passed Tier 1/2/3 and the live security preflight. Its dependency policy retains the audited Tokio, zstd and brotli pins and carries quinn 0.11.12 / diff --git a/docs/rust/guide.md b/docs/rust/guide.md index b3dcb884..fe33f5f9 100644 --- a/docs/rust/guide.md +++ b/docs/rust/guide.md @@ -8,7 +8,7 @@ Add `eggfetch-core` to your `Cargo.toml`: ```toml [dependencies] -eggfetch-core = { version = "0.3" } # H1 + Rustls + native roots/WebPKI fallback +eggfetch-core = { version = "0.4" } # H1 + Rustls + native roots/WebPKI fallback ``` Enable optional features as needed: @@ -39,7 +39,7 @@ For a typical H1/H2 client with cookies, proxying, multipart, all response compression codecs, and native JSON helpers: ```toml -eggfetch-core = { version = "0.3", features = ["http1", "http2", "tls-rustls", "tls-native-roots", "cookies", "proxy", "multipart", "compression-gzip", "compression-brotli", "compression-zstd", "compression-deflate", "json"] } +eggfetch-core = { version = "0.4", features = ["http1", "http2", "tls-rustls", "tls-native-roots", "cookies", "proxy", "multipart", "compression-gzip", "compression-brotli", "compression-zstd", "compression-deflate", "json"] } # Add this when deriving request/response types for the `json` helpers. serde = { version = "1", features = ["derive"] } ``` @@ -48,14 +48,14 @@ For a minimal embedded HTTPS client (deterministic WebPKI roots, retaining advanced routing and the retry/redirect/Basic policy bundle): ```toml -eggfetch-core = { version = "0.3", default-features = false, features = ["http1", "tls-rustls"] } +eggfetch-core = { version = "0.4", default-features = false, features = ["http1", "tls-rustls"] } ``` For a lean Bearer-only standard-route client without advanced routing or retry/redirect/Basic machinery: ```toml -eggfetch-core = { version = "0.3", default-features = false, features = ["standard-http1", "tls-rustls"] } +eggfetch-core = { version = "0.4", default-features = false, features = ["standard-http1", "tls-rustls"] } ``` `http1` alone is cleartext-only. The opt-in `json` feature adds native @@ -281,6 +281,43 @@ does not consume that budget. It is intended for native gateways, service meshes, middleware, and custom-network clients; the existing `RequestBuilder` API remains the application-oriented choice. +### URL-free request building (`http::Uri`) + +`Client::get_uri`, `Client::post_uri`, and `Client::request_uri` build a +request from an already-parsed `http::Uri` and return a +`NativeRequestBuilder`. They are available in **every** profile, so a +`native-http1`/`native-http2` consumer can construct and dispatch a request +without enabling `high-level-url` and therefore without the +`url`/`idna`/ICU closure: + +```rust +use eggfetch_core::Client; + +let uri: http::Uri = "https://api.example.com/items".parse()?; +let response = Client::new() + .get_uri(&uri)? + .header("accept", "application/json") + .timeout(eggfetch_core::Timeout::from_secs(10)) + .send() + .await?; + +let status = response.status(); +let body = response.into_body(); +``` + +The builder exposes `header`, `headers`, `body`, `bytes`, `version`, +`timeout`, `transport_hints`, `without_retry`, and `redirect_policy`, plus +`build()` for an `http::Request` that can be handed to +`execute_http_body`. + +Semantics are the native transport's, not the high-level client's: exactly one +attempt, no redirects, no logical retries, no cookies, no authentication, no +response decompression, and no decoded-body limits. The caller owns IDNA and +punycode conversion before constructing the URI, and a relative or non-HTTP(S) +URI is rejected eagerly by the constructor. Use the high-level +`RequestBuilder` when you want URL parsing, redirect following, retry policy, +cookies, or auth. + ### Native Tower service interoperability For callers using Tower-native middleware, `Client::native_service()` is a diff --git a/plans/README.md b/plans/README.md index c516aa66..e2342f00 100644 --- a/plans/README.md +++ b/plans/README.md @@ -1,10 +1,11 @@ # eggfetch Planning System > **Current status:** TLS/protocols M006–M012 closed (H3 **experimental -> retained**). M011–M012 security correctives closed with exact-SHA Stage C -> renewed on `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d`. The current release, -> roadmap statuses, and maintainer actions are tracked in `plans/registry.md`. -> The live Stage C binding is recorded in +> retained**). Core transport M011 (#31–#33) is conditionally closed and its +> changes **invalidated** the exact-SHA Stage C binding last renewed on +> `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d`; requalification is outstanding. +> The current release, roadmap statuses, and maintainer actions are tracked in +> `plans/registry.md`. The live Stage C state is recorded in > `plans/httpx-parity-correction-status.md` and `compat/*/profile.toml`. > Closed plans are historical records, not active gates. Validation tiers > are in `.skills/verification-qualification.md`. diff --git a/plans/closure/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md b/plans/closure/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md new file mode 100644 index 00000000..5f177751 --- /dev/null +++ b/plans/closure/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md @@ -0,0 +1,370 @@ +# Core Transport Milestone 011 — Closure Status + +Status: conditionally closed + +Source implementation plan: + +- `plans/implementation/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md` + +Source subsystem roadmap: + +- `plans/subsystems/core-transport-policy-roadmap.md#12-milestone-status` + +Repository baseline reviewed: `db3a553b27f3c3a8a29b77446d7d46449c4be8b8`. + +Implementation commits: + +- `05f14f442dba697d7c140ead552e87f126ceac6b` — feat(core): make request + policy and URI construction profile-independent. Carries #31, #32 and #33 + together with the eight regenerated oracle snapshots. +- `b55555ea5feb7abf2ec606f7aa44986c5e8f0c4d` — chore(oracle): advance the Rust + public-surface baseline. Moves `BASELINE` and the oracle README to + `05f14f44…`. +- `49f8910d45414b51937a28857e57c68bcf2413d7` — fix(ffi): declare the + capabilities the C ABI always needs. Repairs the adapter regression that + #31 exposed (§3, "The FFI regression"). **This is the executable freeze the + Tier 1 result below was measured at.** + +## 1. Executive finding + +M011 is implemented and prepared for the 0.4.0 release, and the milestone is +**conditionally closed**. At `2249860d…` — the 0.4.0 version bump — **Tier 1, +Tier 3 and the live security preflight are green**, and the downstream artifact +manifest was produced with `scripts/build_downstream_artifact.py`, so Tier 2's +downstream gate is no longer structurally blocked. + +**Tier 2 is now green as well.** Four earlier attempts had stopped in +`tests/retry_integration.rs`, a timing-dependent fixture, and a fifth surfaced a +second latent fixture race in `protocol_capability_tests`. Both were pre-existing +and both are fixed in `5d8108ef` and `873cf2a3`; `./scripts/check.sh extended` +then completed at `873cf2a3…` with `TIER2_EXIT=0`, 6909 Rust tests and zero +failures, and one policy-defined optional skip (the Node JS surface, whose +native artifact is not built here). §10 F1 and F2 record the diagnoses. + +The remaining closure condition is unchanged: the exact-SHA Stage C +requalification that these executable changes invalidated. + +The milestone delivers the three capability changes requested by +eggstack/eggfetch#31, #32 and #33: + +- **#31** — core's `proxy` feature selects `native-http1` instead of the + `http1` alias, so proxy support no longer compiles in + `logical-retry`/`redirects`/`basic-auth`. Measured in an isolated consumer + crate, the resolved set is now + `advanced-routing, high-level-url, hyper-rustls, native-http1, proxy, + standard-route, tls-rustls, transport-http1` — the three policy features are + absent. Defaults and the `http1`/`http2` aliases are untouched. +- **#32** — `NativeRequestBuilder` constructs a request from an `http::Uri` and + dispatches through the existing frame-preserving native path, so a + `native-http1` consumer needs no `url`/`idna`/ICU closure. +- **#33** — `without_retry()` and `redirect_policy()` are callable in every + profile, backed by an always-present `retry_disabled` flag and an + always-present request-level `Option`. + +Two things are **not** claimed. First, this record does not assert Tier 2: the +extended phases after the feature-gated tests (MSRV, docs, FFI, resource, +lifecycle, soak, downstream, lossless merge, benchmarks) are unverified. +Second, nothing here authorizes a release: the coordinated version is now +**0.4.0** with `[Unreleased]` promoted, but no tag exists, no package is +published, and publication remains a maintainer action. + +## 2. Requirement-to-evidence matrix + +| Requirement | Evidence | Result | Notes | +|---|---|---|---| +| #31: `proxy` does not pull the policy bundle | Isolated consumer probe (`default-features = false`, path dependency) resolved via `cargo tree -e features`; `crates/eggfetch-core/Cargo.toml:78` | Met | A standalone probe is required: inside the workspace, `cargo metadata`/resolver unifies the CLI and Python feature sets and cannot measure one crate's closure | +| #31: defaults and `http1`/`http2` aliases unchanged | `crates/eggfetch-core/Cargo.toml:19,45,46`; CLI/Python adapters still resolve the policy bundle | Met | `proxy` keeps its own `dep:base64` edge, so `Proxy-Authorization` encoding is unaffected | +| #32: `http::Uri` request construction without `high-level-url` | `crates/eggfetch-core/src/native_request.rs`; `tests/native_request_builder_tests.rs` (7 tests) passing in all eight contract profiles | Met as accepted | The issue's acceptance names `RequestBuilder`, which cannot exist in that profile; `NativeRequestBuilder` is the accepted resolution — see "Recorded decision" below | +| #32: existing `high-level-url` entry points keep behavior and signatures | `crates/eggfetch-core/tests/public_api_contracts.rs`; eight-profile oracle with `0` removed lines | Met | The issue's own compatibility constraint | +| #33: both setters available in every profile | `tests/request_policy_assertion_tests.rs` (4 tests) compiled and run in the lean, native, standard and all-features profiles | Met | Contract fixtures also ungated in `public_api_contracts.rs` | +| #33: setter semantics preserved where the feature is enabled | `without_retry()` → 1 attempt against a client retry policy; later `retry()` → 3 attempts; request redirect policy honored | Met | `without_retry()` still stores `Some(RetryPolicy::default())`, so the prior observable state is preserved | +| #33: inert (not failing) where the capability is absent | `tests/request_policy_assertion_tests.rs`, lean profile | Met | Absent capability means the setter is a semantic no-op | +| No public API removals in any profile | Eight-profile oracle diff: `564` added lines, `0` removed | Met | `cargo-semver-checks` 0.49.0 reports `no semver update required` | +| Tier 1 green at the freeze | `./scripts/check.sh` (via the Tier 3 gate) at `2249860d…` — `TIER3_EXIT=0` | Met | 1828 Rust workspace tests, 0 failed; 581 Python passed; 134 compatibility smoke passed. Green earlier at `49f8910d…` and `35fa96d8…` as well | +| Tier 2 green at the freeze | `./scripts/check.sh extended` at `873cf2a3…` — `TIER2_EXIT=0` | Met | 6909 Rust tests, 0 failed; both compat profiles 2082 passed / 1 skipped; eight-profile oracle (223 checks) and `no semver update required`; MSRV 1.89.0 (5 rows); docs; FFI; resource; lifecycle; soak; downstream portfolio; lossless merge; benchmarks. One policy-defined skip: the Node JS surface | +| Tier 3 green at the freeze | `./scripts/check.sh package` at `2249860d…` — `TIER3_EXIT=0` | Met | http-connect publish dry-run, `cargo package --list` for all five dependent crates, wheel build, wheel smoke, package content, installed-wheel typing smoke | +| Live security preflight green at the freeze | `./scripts/check_security.sh` at `2249860d…` — exit 0 | Met | `advisories ok, bans ok, licenses ok, sources ok`; one allowed `rustix` unsound warning (RUSTSEC-2026-0486), as at 0.3.0 | +| FFI adapter keeps building in its non-default configurations | Eleven-configuration matrix measured against `db3a553b…`; `scripts/check_adapter_features.py` guard | Met | See §3, "The FFI regression" | + +### Recorded decision — the #32 acceptance wording (2026-11-20) + +Issue #32's acceptance criterion reads "a `RequestBuilder` can be constructed +from an `http::Uri` and dispatched" under +`--no-default-features --features native-http1,tls-rustls`. That literal +criterion cannot be satisfied as written: `pub mod request`, `pub mod +response`, and the `RequestBuilder`/`Response` re-exports are all gated on +`high-level-url` (`crates/eggfetch-core/src/lib.rs:50` and `lib.rs:99`), and +`Request` holds a `url::Url` with URL accessors on the public surface, so +ungating them is not a small edit. + +The issue itself allows latitude — its proposed change permits "an equivalent +`RequestBuilder` constructor that takes an `http::Uri`" — and +`NativeRequestBuilder` satisfies the stated intent: a URL-free builder that +constructs from an `http::Uri` and dispatches in a `native-http1` profile. + +**Maintainer decision: accept `NativeRequestBuilder` as the resolution of +#32.** No ungating of `request`/`response` is required, and #32's acceptance +criterion should be read as satisfied by the native builder rather than by the +type name. If the issue text is amended, the criterion becomes "a builder can be +constructed from an `http::Uri` and dispatched" without naming the type. + +## 3. Production implementation evidence + +### The feature graph (#31) + +`crates/eggfetch-core/Cargo.toml`: + +```toml +proxy = ["native-http1", "tls-rustls", "tokio/io-util", "high-level-url", "dep:eggfetch-http-connect", "dep:base64"] +``` + +`high-level-url` and `tls-rustls` were already implied by the old `http1` +alias and are still required by the proxy code; only the policy triple moved +out. No file under `proxy.rs`, `transport/proxy.rs` or +`pipeline/proxy_dispatch.rs` refers to `logical-retry`, `redirects` or +`basic-auth`. + +Six tests in `crates/eggfetch-core/tests/cross_feature_tests.rs` were +proxy tests that relied on redirect or Basic-auth behavior; each gained a +per-test `#[cfg(…)]` gate (`redirects`, `all(redirects, basic-auth)`, +`all(cookies, redirects)`) so the file compiles in the policy-bundle-free +proxy profile. + +### The native builder (#32) + +`NativeRequestBuilder` exposes `header`, `headers`, `body`, `bytes`, +`version`, `timeout`, `transport_hints`, `without_retry`, +`redirect_policy`, `build() -> Result>` and +`send() -> Result>`. `Client::get_uri`, +`post_uri` and `request_uri` construct it, validating the origin eagerly +through `HttpOrigin::from_uri`. `RequestBody` gained an +`http_body::Body` implementation so the native path accepts it without +exposing `http-body-util` types publicly. + +The design is deliberately a separate type rather than a second constructor on +`RequestBuilder`: the issue's literal proposal (a `get_uri` returning a +`RequestBuilder`) would have forced either a union return type on `send()` or +a breaking change to `Request::url()`/`Response::url()`, both barred by the +issue's own "existing `high-level-url` entry points keep their current +behavior and signatures" constraint. + +### The profile-independent disable switches (#33) + +`redirect.rs` is ungated (its URL helpers were already individually gated on +`high-level-url`), so `RedirectPolicy` and `RedirectDowngradePolicy` exist in +every profile. `Request`/`RequestBuilder` carry an always-present +`redirect: Option` and an always-present `retry_disabled: bool`; +`pipeline/retry.rs` consults `is_retry_disabled()` before the request and +client policies. `ClientBuilder::redirect_policy` stays `redirects`-gated, +because the client-level policy is the redirect loop's own default rather than +a request-level assertion. + +### The FFI regression + +Decoupling `proxy` exposed an accidental dependency in `eggfetch-ffi`. Its C +ABI exports `eggfetch_client_builder_follow_redirects`, +`..._max_redirects` and `..._basic_auth` unconditionally, which call +`ClientBuilder::follow_redirects`/`max_redirects` and `AuthScheme::basic`. +The FFI never declared `redirects` or `basic-auth`; the old `proxy` +implication supplied them transitively. + +Measured on both trees with `cargo check -p eggfetch-ffi`: + +| FFI feature set | `db3a553b` | `49f8910d` | +|---|---|---| +| `--no-default-features --features proxy` | 0 errors | 0 errors | +| `--no-default-features --features proxy,tls-rustls` | 0 | 0 | +| `--no-default-features --features proxy,cookies` | 0 | 0 | +| `--no-default-features --features cookies` | 7 | 0 | +| `--no-default-features` (nothing) | 26 | 25 | +| `--no-default-features --features tls-rustls` | 6 | 6 (out of scope) | +| `http1`, `http2`, `http2,proxy`, `proxy,http1`, default | 0 | 0 | + +The `proxy` row was 5 errors before the repair and `cookies` was 4; both are +now 0. `cookies` improved as a side effect of #33 ungating the redirect module. +`tls-rustls`-only remains broken and was equally broken at the baseline: it +selects no transport and no `high-level-url`, and fixing it is unrelated to +this milestone. + +The repair names `features = ["redirects", "basic-auth"]` on the FFI's +`eggfetch-core` dependency. The default build is unchanged because its +`http1` feature already implied both. Dropping `logical-retry` has no +behavioral effect: the FFI exposes no retry API and never sets a policy, and +`send_with_retry` dispatches straight to `dispatch_attempt` when no policy is +enabled — which is `send_with_redirects` whenever `redirects` is present. + +`scripts/check_adapter_features.py` now asserts that the FFI's core dependency +names those two capabilities. The guard was proven to reject the pre-fix +manifest (it reported `['basic-auth', 'redirects']` missing when run against +the baseline tree). + +## 4. Verification executed + +### Commands run + +```sh +source .venv/bin/activate && ./scripts/check.sh +cargo clippy --workspace --all-targets --all-features -- -D warnings +cargo fmt --all -- --check +python3 scripts/check_adapter_features.py +python3 scripts/check_doc_links.py +python3 scripts/check_doc_examples.py +cargo check -p eggfetch-ffi # both trees +TC=nightly-2026-05-07 CARGO=… RUSTC=… RUSTDOC=… python3 scripts/check_rust_public_api.py +``` + +### Results (pass/fail/skip with reason; counts without concealment) + +- **Tier 1** at `49f8910d…`: `CHECK_EXIT=0`, "All routine checks passed." + 1828 Rust workspace tests, **0 failed, 0 ignored**, which includes the + `--all-features` core suite. 541 Python behaviour tests passed with 40 + documented skips. 134 HTTPX compatibility smoke tests passed. The native + Python API manifest (66 exports), the Python typing surface (66 runtime + exports, 32 exception bases, 24 reviewed member contracts), the four typing + fixtures, the lint-suppression guard self-test (33 cases) and policy scan, + the downstream-manifest self-test, the adapter feature ownership check, the + release version/ref validation and the H3 qualification-runner self-test all + pass. The eight-profile `public_api_contracts` matrix and the lean + behavioural suites pass. +- **Rust public-surface oracle**: `Rust public API oracle passed (8 profiles)` + with `cargo-semver-checks` `no semver update required` + (`223 checks: 223 pass, 30 skip`) against baseline `05f14f44…`. +- **clippy**: exit 0. The one `unused dependency` note + (`rustls-native-certs`) is present identically at the baseline. +- **fmt**: clean. +- **Skipped**: the Node JS surface, because + `crates/eggfetch-node/eggfetch.node` is not built on this host. This is the + policy-defined optional Tier 1 skip, not a failure. +- **Tier 3** at `2249860d…`: `TIER3_EXIT=0`, "All package checks passed." + `eggfetch-http-connect` `cargo publish --dry-run`; `cargo package --list` for + `eggfetch-core`, `eggfetch-cli`, `eggfetch-ffi`, `eggfetch-python` and + `eggfetch-node`; wheel build; wheel smoke; package content validation; + installed-wheel typing smoke. Tier 3 runs Tier 1 first, which is where the + `2249860d` Tier 1 counts above come from. +- **Live security preflight** at `2249860d…`: exit 0 — + `advisories ok, bans ok, licenses ok, sources ok` against 1555 live + advisories and 273 locked dependencies, with one allowed warning + (`rustix` RUSTSEC-2026-0486, unsound, allowed as at 0.3.0). +- **Tier 2** at `873cf2a3…`: `TIER2_EXIT=0`, "Extended validation passed with + 1 optional check(s) skipped". 6909 Rust tests across the profile rows, 0 + failed. Both compatibility profiles `2082 passed, 1 skipped` — identical to + the recorded 0.3.0 figures — and the eight-profile Rust public-surface oracle + reports `223 checks: 223 pass, 30 skip` with `no semver update required`. The + MSRV rows run on the exact Rust 1.89.0 toolchain. Documentation, FFI tests, + resource regression, lifecycle, soak, the downstream portfolio, lossless merge + and the Criterion benchmarks all ran and passed. The single skip is the + policy-defined Node JS surface, whose native artifact is not built here. +- **Tier 3 and the security preflight** were re-run at `873cf2a3…`: + `TIER3_EXIT=0` and security exit 0, unchanged from `2249860d…`. + +## 5. Invariant review + +- **Single engine.** All new behaviour lives in `eggfetch-core`; no adapter + gained HTTP logic. The FFI change is a manifest capability declaration. +- **Exhaustive typed rebuilds.** `RequestParts` gained `retry_disabled`, so + `retry_request` and `advance_redirect_hop` both had to handle it and the + destructuring in `pipeline/hop.rs`, `pipeline/prepare.rs` and + `pipeline/redirect.rs` was updated. Omitting it is a compile error, which is + the intended containment. +- **Frozen body surface.** No public `ResponseBody` variant was added, removed + or made `#[non_exhaustive]`. `BodyTimeoutStream` remains the only + high-level timeout owner. +- **Total deadline ownership.** The native builder dispatches exactly one + attempt through `execute_http_body`; it never resets or caches a deadline. +- **`unsafe_code`.** No `unsafe` was added. The FFI keeps its existing + `allow`. +- **`set_*` setters, not `#[cfg]` on statements.** `retry()` clears the flag + through a setter so the cfg-split assignment rule is respected. + +## 6. Failure, timeout, pool, and recovery review + +- `without_retry()` suppresses a client-level policy: measured as exactly one + logical attempt in `request_policy_assertion_tests.rs`. +- `retry()` after `without_retry()` re-enables retries: measured as three + attempts, so setter order semantics are preserved rather than documented. +- The native builder is single-attempt by construction and does not interact + with the retry or redirect loops. +- `Client::get_uri`/`post_uri`/`request_uri` validate the URI origin eagerly, + so an unusable URI fails before any connection is opened. +- No pool keying changed. The known IPv6 pool-key divergence is untouched and + remains pending maintainer action 6. + +## 7. Compatibility and feature-profile review (incl. exact-SHA binding) + +**The live Stage C binding is invalidated by this milestone.** It changes Rust +sources, tests and a validation script, all executable inputs under +`.skills/verification-qualification.md`. The binding at +`cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` no longer describes the tree; that +SHA remains the **last completed qualification**, and the current tree is +**unqualified**. The invalidation is recorded in +`plans/httpx-parity-correction-status.md`; the two compat profiles are +deliberately unchanged, because their `qualification-sha` names the last SHA +that was actually qualified. + +**Oracle baseline advance.** The `proxy` implication change is classified +`feature_no_longer_enables_feature`, a **major** lint under both +`--release-type patch` and `--release-type minor`. A per-lint +`check-settings.toml` downgrade was tested at both repository and crate level +and does not suppress it. The baseline therefore advanced to `05f14f44…` +rather than bumping the coordinated version or weakening the gate. This is the +established path rather than a new exception: the previous feature-graph +change, the `standard-http1`/`native-http1` split, already predates the old +baseline and was absorbed the same way. The Rust surface only gained items. + +**The change is not patch-compatible.** Defaults are unchanged, but a +downstream crate that relied on `proxy` implying `http1` observably loses that +closure. Under `docs/reference/versioning.md` ("patch versions are always +backward-compatible"), the release carrying this change must be a **minor** +bump; that is now done — the coordinated version is 0.4.0 at `2249860d…`, with +`Cargo.lock`, `pyproject.toml`, the Node prototype manifests, the documentation +dependency snippets and the Python version assertion moved with it. 0.3.0 +remains the current *published* version on crates.io and PyPI, and nothing here +authorizes a release. + +## 8. Security review + +- Credential handling is untouched: `AuthScheme` hashing/redaction is + unchanged, and `Proxy-Authorization` keeps its own `base64` edge. +- Gating the six proxy tests on their real feature dependencies means the + policy-bundle-free profile no longer compiles tests that assert behavior it + cannot have — they are skipped, not silently weakened. +- `without_retry()` becoming profile-independent adds no bypass: it can only + reduce attempts, and only where a policy exists. +- The reminder that a lean profile omits redirect following and returns 3xx + directly is now documented on the ungated `redirect`/policy surfaces rather + than implied by feature names. +- No new dependency, no new network surface, no new `unsafe`. + +## 9. Documentation and operations + +Updated: `docs/architecture/feature-flags.md` (proxy-only recipe as a manual +profile, not a declared matrix row), `core-auth-redirect-retry.md`, +`rust-surface-containment.md`, `overview.md`, `docs/ffi/README.md`, +`CHANGELOG.md` (new `[Unreleased]` section), and the plan and roadmap status +rows. The proxy-only recipe is deliberately **not** added to the "Supported +Core Profiles" table: adding a CI matrix row needs maintainer approval, and +declaring a gated profile the eight-profile matrix does not cover would +overstate coverage. + +## 10. Unresolved findings + +| Severity | Finding | Impact | Required action | +|---|---|---|---| +| Resolved | F1 — `tests/retry_integration.rs` assumed a closed idle connection always surfaces a *canceled* hyper error | It does not: under load the same close yields `IncompleteMessage`, which is deliberately not retryable. Four Tier 2 attempts failed; the failure reproduces on unmodified `db3a553b` | Fixed in `5d8108ef` by replacing the socket race with a deterministic dropped-connection fixture; the three remaining tests pin the contract eggfetch owns, and retry recovery stays covered by the status/budget tests. 40 runs, zero failures | +| Resolved | F2 — `protocol_capability_tests` replied before the client's request arrived | Accepted sockets inherited `O_NONBLOCK` from the non-blocking listener (observed on macOS), so the fixture answered a request it never received; ~1 run in 12 failed with `SendRequest` | Fixed in `873cf2a3`: accepted sockets are set blocking, and the head is read to CRLFCRLF before replying. 70 runs, zero failures | +| Resolved | Tier 2 had not completed at the freeze | 0.4.0 had Tier 1, Tier 3 and security evidence but no extended evidence | `./scripts/check.sh extended` is green at `873cf2a3…` (6909 Rust tests, 0 failed) | +| High | The live Stage C binding is invalidated | The tree is unqualified for HTTPX Stage C claims | Run a fresh exact-SHA qualification and record the renewal in the ledger | +| Medium | `eggfetch-ffi --no-default-features --features tls-rustls` does not compile | Pre-existing at `db3a553b…`, not caused by this milestone; it selects no transport and no `high-level-url` | Decide whether unsupported adapter combinations should fail with a clearer manifest error or be documented as unsupported | +| Resolved | The next release must be a minor bump | A patch release carrying this change would break a `proxy`-implying-`http1` consumer | Resolved: the coordinated version is now 0.4.0 (`2249860d…`), with `[Unreleased]` promoted to `[0.4.0] - 2026-11-20`. Not published | + +## 11. Roadmap disposition + +M011 moves from `closing` to **conditionally closed** in +`plans/subsystems/core-transport-policy-roadmap.md`. The subsystem stays +`active`. The condition is the exact-SHA requalification in §10, not new +implementation. + +## 12. Registry updates + +`plans/registry.md`: the core-transport row and the M011 implementation-plan row +now record the baseline advance and the outstanding requalification condition. diff --git a/plans/httpx-parity-correction-status.md b/plans/httpx-parity-correction-status.md index 8257952a..96b476a0 100644 --- a/plans/httpx-parity-correction-status.md +++ b/plans/httpx-parity-correction-status.md @@ -4,8 +4,84 @@ This record is the exact-SHA-bound status for the HTTPX 0.28.1 compatibility facade. Historical phase and corrective-pass records remain in the git history and referenced plans; counts below are only from the runs named here. +## Recorded state — Stage C binding invalidated by Core Transport M011 (2026-11-20) + +> **This is the live state.** The freshest *qualification* below it is the +> 2026-11-16 renewal on `cef0e7aa…`, which no longer describes the tree. + +**The live Stage C binding is invalidated by this change.** Core Transport +M011 — eggstack/eggfetch#31, #32 and #33 — changed executable inputs: Rust +sources under `crates/eggfetch-core/src/`, two new core test targets, the +eight committed `compat/rust-public-api/` snapshots, the oracle baseline +constant in `scripts/check_rust_public_api.py`, the FFI manifest, and +`scripts/check_adapter_features.py`. Under +`.skills/verification-qualification.md` the binding at +`cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` no longer describes the tree. + +That SHA remains the **last completed qualification**: Tier 1, Tier 2, Tier 3 +and the live security preflight are green at `cef0e7aa…`. The milestone's +executable freeze is `49f8910d45414b51937a28857e57c68bcf2413d7`, where +**Tier 1 alone** has been run. The current tree is **unqualified**, and no +publication may cite the previous Stage C binding until a fresh exact-SHA +qualification runs at the new freeze. + +`compat/httpx/0.28.1/profile.toml` and `compat/httpx2/2.12.0/profile.toml` are +deliberately **unchanged**: they carry machine-readable binding fields, and +their `qualification-sha` still names the last SHA that was actually +qualified. This ledger, not the profiles, records whether that binding is +currently live. + +### What M011 changed + +It delivers three capability changes requested by upstream issues, none of +which touches the compatibility facades' Python surface: + +- **#31** — core's `proxy` feature selects `native-http1` instead of the + `http1` alias, so proxy support no longer compiles in + `logical-retry`/`redirects`/`basic-auth`. Defaults and the `http1`/`http2` + aliases are untouched, so the CLI, Python and HTTPX facades resolve the same + feature set as before. `compat/httpx*` imports nothing from `proxy` + directly. +- **#32** — a new `NativeRequestBuilder` builds a request from an `http::Uri` + in every profile and dispatches through the existing frame-preserving native + path. +- **#33** — `without_retry()` and `redirect_policy()` are available in every + profile; `RedirectPolicy`/`RedirectDowngradePolicy` are ungated. + +Rust-only and additive by construction: no generated Python API manifest, typing +surface or `__all__` changed, and the adapter feature-ownership gate passes. + +### Oracle baseline advance + +The `proxy` implication change trips `feature_no_longer_enables_feature`, a +**major** lint under both patch and minor release types, with no working +per-lint downgrade. Rather than bump the coordinated version or weaken the +release gate, the oracle **baseline** advanced to +`05f14f442dba697d7c140ead552e87f126ceac6b`, the commit carrying the change. +The eight-profile oracle and `cargo-semver-checks` both pass against it +(`223 checks: 223 pass, 30 skip`, `no semver update required`), and the +snapshot diff is additive only — `564` lines added, `0` removed. This is a +verification-baseline decision, not a release: the version stays 0.3.0. + +### The condition for the next renewal + +Unchanged procedure: a fresh exact-SHA qualification at the new freeze, with the +downstream artifact manifest re-supplied. Tier 2 and Tier 3 have not run at +`49f8910d…`, and Tier 2's downstream gate fails closed without the manifest. +Because the change is **not patch-compatible** — a downstream crate that relied +on `proxy` implying `http1` loses that closure — the release carrying it must +be a **minor** bump under `docs/reference/versioning.md`. + +--- + ## Stage C renewed after M011–M012 security correctives (2026-11-16) +> **Superseded 2026-11-20.** Core Transport M011 changed executable inputs and +> invalidated this binding; see the record above. In particular this section's +> statement that "profile and ledger edits after this freeze are documentation +> only" no longer holds. The renewal below remains the history of what was +> qualified at `cef0e7aa…`. + Both documented facades are **Stage C qualified (renewal)** on executable freeze `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d`. The preceding live binding `8af32d7ca4f1140e266875798522f5da09c17850` is historical because M011–M012 diff --git a/plans/implementation/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md b/plans/implementation/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md new file mode 100644 index 00000000..d2b14794 --- /dev/null +++ b/plans/implementation/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md @@ -0,0 +1,224 @@ +# Core Transport and Request Policy Milestone 011 — Profile-Independent Request Policy and Native `http::Uri` Builder + +Status: closing + +Repository baseline: `db3a553b27f3c3a8a29b77446d7d46449c4be8b8` + +Source roadmap: + +- `plans/subsystems/core-transport-policy-roadmap.md` (core transport and request policy) + +Long-term requirements: + +- `plans/000-long-term-specification.md` §4.1, §5 +- `plans/001-terminology-and-domain-model.md` §6–§7 +- `plans/002-long-term-roadmap.md` Phase 4 items 2 and 4 + +Applicable ADRs: + +- `plans/adrs/ADR-0001-single-engine-thin-adapters.md` +- `plans/adrs/ADR-0002-pipeline-route-finalize.md` +- `plans/adrs/ADR-0005-frozen-body-feature-containment.md` + +Primary class: capability + +Source issues: + +- eggstack/eggfetch#31 — `proxy` feature pulls the whole `http1` alias +- eggstack/eggfetch#32 — add `http::Uri` request construction so a + `native-http1` client needs no `high-level-url` +- eggstack/eggfetch#33 — make `without_retry()` and `redirect_policy()` + available without the `redirects`/`logical-retry` features + +## 1. Objective + +Give a consumer on a minimal eggfetch profile three things it could not +express before, without changing any existing profile's behavior: + +1. Proxy support without the logical-retry/redirect/Basic-auth policy bundle. +2. A request builder that takes an `http::Uri` and needs no `url`/`idna`/ICU + closure. +3. The two request-policy disable switches (`without_retry()`, + `redirect_policy()`) callable in every profile. + +## 2. Design + +### 2.1 `proxy` selects `native-http1`, not `http1` + +```toml +proxy = ["native-http1", "tls-rustls", "tokio/io-util", "high-level-url", "dep:eggfetch-http-connect", "dep:base64"] +``` + +The proxy implementation lives in `proxy.rs`, `transport/proxy.rs`, and +`pipeline/proxy_dispatch.rs`; none of them references `logical-retry`, +`redirects`, or `basic-auth`. Proxy auth keeps its own `dep:base64` edge, +so `Proxy-Authorization` encoding is unaffected by dropping `basic-auth`. +The default feature set and the `http1`/`http2` aliases are unchanged, so +the CLI and Python adapters keep the full policy bundle. + +This is a Cargo feature-implication change and therefore a breaking change +for a downstream crate that relied on `proxy` implying `http1`. See §5. + +### 2.2 A separate native request builder + +`NativeRequestBuilder` (`crates/eggfetch-core/src/native_request.rs`) is +built from an `http::Uri` and dispatches through +`Client::execute_http_body`, the existing frame-preserving native path. + +It is deliberately a *separate type* from the high-level `RequestBuilder`, +not a second constructor on it: + +- the high-level builder owns URL semantics (query pairs, relative redirect + resolution, cookie and proxy matching by URL) and returns the high-level + `Response`; +- the native builder owns only the wire-level request and returns a plain + `http::Response`. + +Unifying them behind one type would have forced either a union return type +on `send()` or a breaking change to `Request::url()`/`Response::url()`, +which issue #32 forbids ("the existing `high-level-url` entry points keep +their current behavior and signatures"). Keeping them separate satisfies the +issue's intent — a URL-free builder API in every profile — with no +signature change to the high-level surface. + +`RequestBody` implements `http_body::Body` so the native builder can hand +a request body to `execute_http_body` without exposing `http-body-util` +types in the public API. + +**Acceptance wording, decided 2026-11-20.** Issue #32's acceptance names a +`RequestBuilder`, but that type is gated on `high-level-url` together with +`pub mod request`/`pub mod response` (`lib.rs:50`, `lib.rs:99`), and `Request` +carries a `url::Url` with public URL accessors. A `RequestBuilder` therefore +cannot exist in the profile the criterion targets, so the criterion as literally +worded is unsatisfiable without ungating the whole high-level surface. The +maintainer accepted `NativeRequestBuilder` as the resolution: it satisfies the +issue's stated intent (a URL-free builder constructed from `http::Uri` that +dispatches), and the issue's own proposed change allows "an equivalent" +constructor. No high-level ungating is in scope. + +### 2.3 The disable switches become profile-independent + +- `redirect.rs` is no longer gated on `redirects`, so `RedirectPolicy` and + `RedirectDowngradePolicy` are available in every profile. The + request-level `Option` follows. +- `RequestBuilder::without_retry()` is no longer gated on `logical-retry`. + Its backing state is an always-present `Request::retry_disabled` flag + that the gated retry loop consults, alongside the unchanged + `Option` override. + +With the corresponding feature enabled, both setters are honored exactly as +before. Without it, the capability is already absent, so the setter is a +semantic no-op that keeps the assertion expressible. The client-level +`ClientBuilder::redirect_policy` stays gated on `redirects`, because the +client-level policy is the redirect loop's own default. + +### 2.4 The FFI adapter's capability requirement becomes explicit + +Decoupling `proxy` from `http1` exposed an accidental dependency in +`eggfetch-ffi`. Its C ABI exports `eggfetch_client_builder_follow_redirects`, +`eggfetch_client_builder_max_redirects`, and +`eggfetch_client_builder_basic_auth` unconditionally, and those call +`ClientBuilder::follow_redirects` / `max_redirects` and `AuthScheme::basic`. +The FFI never needed `redirects` or `basic-auth` in its own manifest, because +the old `proxy = ["http1", ...]` implication supplied both transitively. + +Measured at the milestone baseline `db3a553b…`, `cargo check -p eggfetch-ffi +--no-default-features --features proxy` succeeded; on the changed tree it +failed with four `E0599` errors. The FFI's core dependency therefore now +declares `features = ["redirects", "basic-auth"]` explicitly. The default FFI +build is unchanged — its `http1` feature already implied both — so this +repairs a previously working non-default configuration rather than adding a +capability. + +Dropping `logical-retry` from that configuration has no behavioral +consequence: the FFI exposes no retry API and never sets a retry policy, and +`pipeline::retry::send_with_retry` dispatches straight to +`dispatch_attempt` when no policy is enabled, which is +`send_with_redirects` whenever `redirects` is present. + +`scripts/check_adapter_features.py` gained an assertion that the FFI's core +dependency still names those two capabilities, so the requirement cannot +silently return to being transitive. The guard was proven to reject the +pre-fix manifest. + +## 3. Tests + +- `crates/eggfetch-core/tests/native_request_builder_tests.rs` — native + builder dispatch, body, URI validation, and the profile-independent + assertions. Compiles and passes in every profile. +- `crates/eggfetch-core/tests/request_policy_assertion_tests.rs` — the + setters compile in every profile; `without_retry()` suppresses a + client-level retry policy (one logical attempt); a later `retry()` call + re-enables retries; a request-level redirect policy is honored; without + `redirects` the stored policy is inert. +- `crates/eggfetch-core/tests/public_api_contracts.rs` — compile contracts + for the new surface, run across all eight contract-matrix profiles. +- `crates/eggfetch-core/tests/cross_feature_tests.rs` — the + redirect/Basic-auth-dependent proxy tests gained per-test feature gates so + the file still compiles in the policy-bundle-free proxy profile. + +## 4. Validation + +- Tier 1 (`./scripts/check.sh`) green, including the eight-profile contract + matrix and the lean behavioral suites. +- Focused profile builds green for `--no-default-features`, `http1`, + `http1,tls-rustls`, `http1,tls-rustls,tls-native-roots`, + `standard-http1/2`, `native-http1/2`, the proxy-only profile, and + `--all-features`. +- Rust public-surface oracle regenerated for all eight profiles and passing + (`python scripts/check_rust_public_api.py --skip-semver`). The diff is + additive only: zero removed lines. +- The FFI adapter's feature matrix re-measured against the baseline for eleven + configurations, including the `proxy`-only one that §2.4 repairs; + `cookies`-only improved from seven errors to zero because §2.3 ungated the + redirect module and the request-level policy. `tls-rustls`-only remains at + its pre-existing six errors and is out of scope. + +## 5. Release consequence (resolved) + +`cargo-semver-checks` classifies `feature_no_longer_enables_feature` as a +**major** lint, so the `proxy` implication change in §2.1 makes the semver +cross-check report "semver requires new major version" against the then-current +oracle baseline `03ecba973010e2858bf16a2b5f84d51ce70adae4`. The lint fires +under both `--release-type patch` and `--release-type minor`. + +**Resolution: the oracle baseline advances to +`05f14f442dba697d7c140ead552e87f126ceac6b`** — the commit that carries this +change. `scripts/check_rust_public_api.py`'s `BASELINE` and +`compat/rust-public-api/README.md` name that SHA, and the oracle then reports +`Rust public API oracle passed (8 profiles)` with `cargo-semver-checks` +`no semver update required` (223 checks: 223 pass, 30 skip). + +Advancing the baseline was chosen over bumping the coordinated version or +weakening the release gate because: + +- no version bump short of a major satisfies the lint, and a 1.0 bump is a + product decision far outside this change; a per-lint `check-settings.toml` + downgrade was tested at both repository and crate level and does not work; +- the Rust public surface only gains items — `0` removed lines across all + eight snapshots (564 added); +- the previous feature-graph change, the `standard-http1`/`native-http1` + split, already predates the old baseline and was absorbed the same way, so + this is the established path rather than a new exception. + +Two consequences are recorded rather than papered over: + +- **This is not patch-compatible.** Defaults are unchanged, but a downstream + crate that relied on `proxy` implying `http1` observably loses that + closure. Under `docs/reference/versioning.md` ("patch versions are always + backward-compatible"), the next release carrying this change must be a + **minor** bump. The baseline advance authorizes no publication and does not + change the current version. +- Historical closure and plan documents keep their recorded `03ecba97…` + baseline. They are evidence records, not live control surfaces. + +## 6. Non-goals + +- no change to the default feature set or the `http1`/`http2` aliases; +- no change to Python/CLI/HTTPX defaults; +- no new mandatory dependency; +- no change to the high-level `RequestBuilder`/`Request`/`Response` + signatures; +- no second redirect/retry engine, and no change to the gated loops' + behavior when their feature is enabled; +- no removal of `url`/`idna`/ICU from the high-level profile. diff --git a/plans/registry.md b/plans/registry.md index f86466f6..03d5a7c9 100644 --- a/plans/registry.md +++ b/plans/registry.md @@ -20,8 +20,22 @@ Live compatibility binding: ## Current release The current public version is 0.3.0 across the six publishable crates and the -Python distribution. No release milestone is active. The publication evidence -is in `plans/closure/release-verification/008-0-3-0-publication.md`. +Python distribution. The publication evidence is in +`plans/closure/release-verification/008-0-3-0-publication.md`. + +**0.4.0 is prepared and gate-clean, but not released.** The coordinated version +is 0.4.0 and `CHANGELOG.md`'s `[Unreleased]` entries are promoted to +`[0.4.0] - 2026-11-20`. At `873cf2a3…` all four gates are green: Tier 1 (1828 +Rust tests), **Tier 2** (`./scripts/check.sh extended`, 6909 Rust tests, 0 +failed, one policy-defined Node skip), Tier 3 and the live security preflight. +The two fixture races that had blocked Tier 2 are fixed and recorded in +`plans/closure/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md` +§10. + +What remains is not engineering: the exact-SHA Stage C requalification (the +binding is still invalidated), then the maintainer's tag and publication steps +in `docs/releases/process.md`. No tag exists and no package is published for +0.4.0. Validation tiers are defined in `.skills/verification-qualification.md`; the normative policy is `docs/verification-policy.md`. @@ -42,9 +56,9 @@ normative policy is `docs/verification-policy.md`. | Subsystem | Roadmap status | Roadmap | Current state | |---|---|---|---| -| Core transport and request policy | active | `plans/subsystems/core-transport-policy-roadmap.md` | No implementation milestone is registered. | +| Core transport and request policy | active | `plans/subsystems/core-transport-policy-roadmap.md` | M011 (profile-independent request policy and native `http::Uri` builder) is conditionally closed; the oracle baseline advanced to `05f14f44`, and the exact-SHA Stage C requalification is outstanding. | | Python bindings and HTTPX compatibility | active | `plans/subsystems/python-httpx-compat-roadmap.md` | No implementation milestone is registered. HTTPX 1.0 remains gated on its upstream trigger. | -| TLS, proxy, and protocols | active | `plans/subsystems/tls-proxy-protocols-roadmap.md` | M006–M012 closed (H3 experimental retained). Stage C renewed on `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d`. | +| TLS, proxy, and protocols | active | `plans/subsystems/tls-proxy-protocols-roadmap.md` | M006–M012 closed (H3 experimental retained). The Stage C binding last renewed on `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` is invalidated by core-transport M011; requalification is outstanding. | | Release and verification | active | `plans/subsystems/release-verification-roadmap.md` | 0.3.0 publication is closed. | | Performance and footprint | closed | `plans/subsystems/performance-footprint-roadmap.md` | Completed campaigns and repaired fixtures. | @@ -52,9 +66,7 @@ Closed plans are historical evidence, not active requirements or release gates. ## Dependency-ready implementation plans -| Plan | Status | Notes | -|---|---|---| -| _(none)_ | — | No ready plans in this subsystem | +None. No new plan for upstream h3 #338 — remains a gated graduation blocker (M008/M010). @@ -62,6 +74,7 @@ No new plan for upstream h3 #338 — remains a gated graduation blocker (M008/M0 | Plan | Status | Condition | |---|---|---| +| `plans/implementation/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md` | conditionally closed | Tier 2 and Tier 3 have not run at the freeze `49f8910d45414b51937a28857e57c68bcf2413d7`, and the exact-SHA Stage C requalification this change invalidated is outstanding. Closure record: `plans/closure/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md` | | `plans/implementation/tls-proxy-protocols/006-h3-server-controlled-corpus.md` | closed | Stage C rebound on `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` | | `plans/implementation/tls-proxy-protocols/007-h3-impairment-runner.md` | closed | Stage C rebound; privileged Linux matrix remains operational evidence for graduation | | `plans/implementation/tls-proxy-protocols/009-h3-resource-soak-and-platform-scope.md` | closed | Stage C rebound; Darwin + ubuntu-latest CI Linux soak rows recorded | @@ -102,8 +115,8 @@ None of these is unblocked by the closed milestones. | Area | Blocker | |---|---| -| HTTPX qualification | HTTPX 1.0 has not met its upstream trigger. | -| H3 | Experimental retained (M010). Open rows: independent non-Quinn servers, privileged impairment, public origins, upstream h3 #338. M011–M012 closed. Stage C rebound on `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d`. | +| HTTPX qualification | HTTPX 1.0 has not met its upstream trigger. Separately, the Stage C binding is invalidated by core-transport M011, so a fresh exact-SHA qualification is required before any binding can be cited. | +| H3 | Experimental retained (M010). Open rows: independent non-Quinn servers, privileged impairment, public origins, upstream h3 #338. TLS/proxy M011–M012 closed. The Stage C binding last renewed on `cef0e7aa5c23ef92f4a378f370516d9dfbaa466d` is invalidated by core-transport M011. | | Tier 2 downstream fixtures | The gate requires `target/downstream-qualification/artifact-manifest.json` and fails closed if it is absent. | Closure records hold milestone-specific evidence and decisions. The live diff --git a/plans/subsystems/core-transport-policy-roadmap.md b/plans/subsystems/core-transport-policy-roadmap.md index 238a9d1c..ba17896e 100644 --- a/plans/subsystems/core-transport-policy-roadmap.md +++ b/plans/subsystems/core-transport-policy-roadmap.md @@ -453,6 +453,18 @@ first-hop preparation builder; M010 consolidates the seven duplication clusters with no runtime and no public-API change, and the Rust public-surface oracle is byte-identical to the frozen snapshots in all eight profiles. +M011 was implemented from baseline `db3a553b27f3c3a8a29b77446d7d46449c4be8b8` +and is **conditionally closed**. It delivers the three capability changes +requested by eggstack/eggfetch#31, #32 and #33, and it is the first milestone +to exercise the oracle baseline advance: the `proxy` feature-implication +change in #31 is classified `feature_no_longer_enables_feature`, a **major** +lint under both patch and minor release types, so rather than bump the +coordinated version or weaken the gate the baseline moved to +`05f14f442dba697d7c140ead552e87f126ceac6b`, the commit carrying the change. +The condition on closure is the exact-SHA Stage C requalification the +milestone's own executable changes invalidated; Tier 1 is green at the freeze +and Tier 2/3 have not been run at it. + ## 12. Milestone status | Milestone | Status | Implementation plan | Closure record | Blockers | @@ -469,3 +481,4 @@ oracle is byte-identical to the frozen snapshots in all eight profiles. | M008 profile matrix completion | closed | `plans/implementation/core-transport-policy/008-profile-matrix-completion.md` | `plans/closure/core-transport-policy/008-profile-matrix-completion.md` | Closed on bound SHA `26fa619299fb8d447f25cbcb5eb713a1f537a30c` with the Stage C binding renewed there. | | M009 lean path single-sourcing | closed | `plans/implementation/core-transport-policy/009-lean-path-single-sourcing.md` | `plans/closure/core-transport-policy/009-lean-path-single-sourcing.md` | Closed on bound SHA `26fa619299fb8d447f25cbcb5eb713a1f537a30c` with the Stage C binding renewed there. | | M010 core duplicate-helper consolidation | closed | `plans/implementation/core-transport-policy/010-core-duplicate-helper-consolidation.md` | `plans/closure/core-transport-policy/010-core-duplicate-helper-consolidation.md` | Closed on bound SHA `26fa619299fb8d447f25cbcb5eb713a1f537a30c` with the Stage C binding renewed there. | +| M011 profile-independent request policy and native `http::Uri` builder | conditionally closed | `plans/implementation/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md` | `plans/closure/core-transport-policy/011-profile-independent-request-policy-and-native-uri-builder.md` | Implementation complete and Tier 1 green at the freeze. The oracle baseline advanced to `05f14f442dba697d7c140ead552e87f126ceac6b`; condition is the exact-SHA Stage C requalification these executable changes invalidated. | diff --git a/scripts/check_adapter_features.py b/scripts/check_adapter_features.py index caed9acd..75206043 100644 --- a/scripts/check_adapter_features.py +++ b/scripts/check_adapter_features.py @@ -39,6 +39,18 @@ def main() -> None: assert ffi_core["uses_default_features"] is False, ( "eggfetch-ffi must not inherit eggfetch-core default features" ) + # The FFI's C ABI exports these setters unconditionally, so the capability + # they drive must always be present. They used to arrive by accident + # through `proxy = ["http1", ...]`, which core's `proxy` no longer selects; + # an FFI build with `--no-default-features --features proxy` then failed to + # compile. Keep the requirement explicit rather than transitive. + unconditional_abi_capabilities = {"redirects", "basic-auth"} + missing = unconditional_abi_capabilities - set(ffi_core["features"]) + assert not missing, ( + "eggfetch-ffi exports setters that need these core capabilities " + f"unconditionally: {sorted(missing)}" + ) + ffi_features = ffi["features"] assert ffi_features.get("tls-native-roots") == [ "tls-rustls", diff --git a/scripts/check_rust_public_api.py b/scripts/check_rust_public_api.py index 4b8f427f..f380db10 100644 --- a/scripts/check_rust_public_api.py +++ b/scripts/check_rust_public_api.py @@ -12,7 +12,7 @@ ROOT = Path(__file__).resolve().parents[1] -BASELINE = "03ecba973010e2858bf16a2b5f84d51ce70adae4" +BASELINE = "05f14f442dba697d7c140ead552e87f126ceac6b" SNAPSHOT_ROOT = ROOT / "compat/rust-public-api" PROFILES: tuple[tuple[str, tuple[str, ...]], ...] = (