Skip to main content

eggfetch_core/
lib.rs

1//! Async-first HTTP client engine for eggfetch.
2//!
3//! This crate is the single owner of HTTP behavior. The CLI and Python
4//! bindings are thin adapters that delegate to it.
5//!
6//! # Example
7//!
8//! ```no_run
9//! # async fn example() -> eggfetch_core::Result<()> {
10//! use eggfetch_core::Client;
11//!
12//! let client = Client::new();
13//! let mut response = client
14//!     .get("https://example.com")?
15//!     .header("user-agent", "eggfetch")
16//!     .query("q", "test")
17//!     .send()
18//!     .await?;
19//!
20//! assert!(response.status().is_success());
21//! let bytes = response.bytes().await?;
22//! # Ok(())
23//! # }
24//! ```
25
26#![deny(missing_docs)]
27
28pub mod auth;
29pub mod body;
30pub mod client;
31pub mod compression;
32#[cfg(feature = "cookies")]
33pub mod cookie;
34pub mod error;
35mod h2_headers;
36pub mod headers;
37pub mod http_version;
38pub mod limits;
39#[cfg(feature = "multipart")]
40pub mod multipart;
41pub mod network_stream;
42pub(crate) mod pipeline;
43pub mod pool;
44#[cfg(feature = "proxy")]
45pub mod proxy;
46pub mod redact;
47pub mod redirect;
48pub mod request;
49pub mod response;
50pub(crate) mod response_decode;
51pub mod retry;
52pub(crate) mod stream;
53pub mod timeout;
54pub mod tls;
55pub mod trace;
56pub mod transport;
57
58pub use auth::{AuthScheme, BasicAuth, BearerAuth};
59pub use body::{BoxBytesStream, RequestBody, ResponseBody, SharedTrailers};
60pub use client::{Client, ClientBuilder};
61pub use compression::{accept_encoding_value, ContentCoding};
62pub use error::{Error, Result};
63pub use headers::Headers;
64pub use http::Method;
65pub use http_version::HttpVersionPolicy;
66pub use limits::Limits;
67#[cfg(feature = "multipart")]
68pub use multipart::{Boundary, Multipart, MultipartEncoder, Part, PartBody};
69pub use network_stream::{
70    ConnectionMetadata, ExtraInfo, NetworkStream, TlsInfo, TransportKind, UpgradedStream,
71    UpgradedStreamVariant,
72};
73pub use pool::{Pool, PoolConfig};
74#[cfg(feature = "proxy")]
75pub use proxy::{NoProxy, NoProxyRule, Proxy, ProxyAuth, ProxyConfig, ProxyDecision, ProxyRule};
76pub use redact::{
77    is_sensitive_header, redact_headers, redact_url, redact_url_string, SENSITIVE_HEADERS,
78};
79pub use redirect::RedirectPolicy;
80pub use request::{ProxyOverride, Request, RequestBuilder, TransportHints};
81pub use response::{HistoryEntry, Response};
82pub use retry::{
83    BackoffPolicy, MethodPolicy, ReplayCheck, RetryCause, RetryContext, RetryPolicy,
84    RetryPolicyBuilder, StatusPolicy,
85};
86pub use timeout::{Timeout, TimeoutBuilder, TimeoutPhase};
87pub use tls::{ClientIdentity, TlsConfig, TlsConfigBuilder, TlsVersion, TrustStore};
88/// Socket option for direct TCP connections.
89pub use transport::direct_connector::{SocketOption, SocketOptionKind};
90#[cfg(feature = "http3")]
91pub use transport::metrics::{H3CloseKind, H3CloseSummary, H3ConnectionDiagnostic, H3RouteKind};
92pub use transport::metrics::{TransportMetrics, TransportSnapshot};