Expand description
Async-first HTTP client engine for eggfetch.
This crate is the single owner of HTTP behavior. The CLI and Python bindings are thin adapters that delegate to it.
§Example
use eggfetch_core::Client;
let client = Client::new();
let mut response = client
.get("https://example.com")?
.header("user-agent", "eggfetch")
.query("q", "test")
.send()
.await?;
assert!(response.status().is_success());
let bytes = response.bytes().await?;Re-exports§
pub use auth::BasicAuth;pub use auth::AuthScheme;pub use auth::BearerAuth;pub use body::BoxBytesStream;pub use body::NativeResponseBody;pub use body::RequestBody;pub use body::ResponseBody;pub use client::Client;pub use client::ClientBuilder;pub use compression::accept_encoding_value;pub use compression::ContentCoding;pub use error::Error;pub use error::NetworkFailureKind;pub use error::RequestFailure;pub use error::Result;pub use error::TransportFailureKind;pub use headers::Headers;pub use http_version::HttpVersionPolicy;pub use limits::Limits;pub use network_stream::ConnectionMetadata;pub use network_stream::ExtraInfo;pub use network_stream::NetworkStream;pub use network_stream::TlsInfo;pub use network_stream::TransportKind;pub use network_stream::UpgradedStream;pub use network_stream::UpgradedStreamVariant;pub use pool::Pool;pub use pool::PoolConfig;pub use redact::is_sensitive_header;pub use redact::redact_headers;pub use redact::SENSITIVE_HEADERS;pub use redact::redact_url;pub use redact::redact_url_string;pub use redirect::build_redirect_request_with_redirect_policy;pub use redirect::check_https_downgrade;pub use redirect::is_https_downgrade;pub use redirect::RedirectDowngradePolicy;pub use redirect::RedirectPolicy;pub use request::ProxyOverride;pub use request::Request;pub use request::RequestBuilder;pub use response::HistoryEntry;pub use response::Response;pub use retry::BackoffPolicy;pub use retry::MethodPolicy;pub use retry::ReplayCheck;pub use retry::RetryCause;pub use retry::RetryContext;pub use retry::RetryPolicy;pub use retry::RetryPolicyBuilder;pub use retry::StatusPolicy;pub use service::NativeHttpService;pub use timeout::Timeout;pub use timeout::TimeoutBuilder;pub use timeout::TimeoutPhase;pub use tls::ClientIdentity;pub use tls::TlsConfig;pub use tls::TlsConfigBuilder;pub use tls::TlsVersion;pub use tls::TrustStore;pub use transport::dialer::DialError;pub use transport::dialer::DialErrorKind;pub use transport::dialer::DialFuture;pub use transport::dialer::DialStream;pub use transport::dialer::DialTarget;pub use transport::dialer::Dialer;pub use transport::direct_connector::SocketOption;pub use transport::direct_connector::SocketOptionKind;pub use transport::lifecycle::PhysicalConnectionPolicy;pub use transport::lifecycle::TransportIoDirection;pub use transport::lifecycle::TransportIoTimeout;pub use transport::metrics::TransportMetrics;pub use transport::metrics::TransportSnapshot;pub use transport_hints::NativeRequestOptions;pub use transport_hints::ResolvedTarget;pub use transport_hints::TransportHints;
Modules§
- auth
- Authentication subsystem for eggfetch.
- body
- Body model for requests and responses.
- client
- Async client entry point.
- compression
- Response decompression.
- error
- Error type and result alias for the eggfetch engine.
- headers
- Header container.
- http_
version - HTTP version negotiation policy.
- limits
- Resource limits for the connection pool.
- network_
stream - Network stream types for connection metadata and upgraded connections.
- pool
- Connection pool subsystem.
- redact
- Centralized secret redaction for eggfetch.
- redirect
- Redirect handling engine.
- request
- High-level URL request types and builder.
- response
- Incoming response type.
- retry
- Policy-driven retry subsystem.
- service
- Service adapters for native transport-oriented consumers.
- timeout
- Phase-aware timeout configuration.
- tls
- TLS configuration for the eggfetch client.
- trace
- Core trace observer abstraction for HTTPX-compatible request tracing.
- transport
- Transport layer abstractions.
- transport_
hints - Protocol-neutral native transport controls.
Structs§
- Method
- The Request Method (VERB)