Skip to main content

Crate aioduct

Crate aioduct 

Source
Expand description

Async-native HTTP client built directly on hyper 1.x.

aioduct is runtime-agnostic: enable tokio, smol, or compio via feature flags. For HTTPS, enable the rustls feature.

Re-exports§

pub use address_family::AddressFamily;
pub use bandwidth::BandwidthLimiter;
pub use body::BodyStreamLocal;
pub use body::BodyStreamSend;
pub use body::RequestBody;
pub use cache::CacheConfig;
pub use cache::CacheEntry;
pub use cache::CacheStore;
pub use cache::HttpCache;
pub use cache::InMemoryCacheStore;
pub use cookie::Cookie;
pub use cookie::CookieJar;
pub use cookie::SameSite;
pub use error::Error;
pub use error::PoolError;
pub use error::PoolLimitError;
pub use error::PoolLimitKind;
pub use error::SendError;
pub use forwarded::ForwardedElement;
pub use hsts::HstsStore;
pub use http2::Http2Config;
pub use message_signatures::AcceptSignature;
pub use message_signatures::AcceptSignatureEntry;
pub use message_signatures::AcceptSignatureFulfillment;
pub use message_signatures::AcceptSignatureParams;
pub use message_signatures::MessageSignature;
pub use message_signatures::MessageSignatureAsyncSigner;
pub use message_signatures::MessageSignatureAsyncSigningFuture;
pub use message_signatures::MessageSignatureBase;
pub use message_signatures::MessageSignatureComponent;
pub use message_signatures::MessageSignatureComponentParameter;
pub use message_signatures::MessageSignatureConfig;
pub use message_signatures::MessageSignatureError;
pub use message_signatures::MessageSignatureHeaders;
pub use message_signatures::MessageSignatureLocalAsyncSigner;
pub use message_signatures::MessageSignatureLocalAsyncSigningFuture;
pub use message_signatures::MessageSignatureParams;
pub use message_signatures::MessageSignatureRequestContext;
pub use message_signatures::MessageSignatureResponseContext;
pub use message_signatures::MessageSignatureSigner;
pub use message_signatures::MessageSignatureVerificationInput;
pub use message_signatures::MessageSignatureVerificationPolicy;
pub use message_signatures::MessageSignatureVerifier;
pub use middleware::Middleware;
pub use multipart::Multipart;
pub use multipart::Part;
pub use netrc::Netrc;
pub use netrc::NetrcMiddleware;
pub use observer::ConnectionEvent;
pub use observer::ConnectionPhase;
pub use observer::NegotiatedProtocol;
pub use observer::PoolOutcome;
pub use observer::RequestEvent;
pub use observer::RequestObserver;
pub use observer::RequestPhase;
pub use observer::RetryKind;
pub use observer::TransferDirection;
pub use proxy::NoProxy;
pub use proxy::ProxyChain;
pub use proxy::ProxyConfig;
pub use proxy::ProxySettings;
pub use proxy_credential::CompositeResolver;
pub use proxy_credential::CredentialResolver;
pub use proxy_credential::EnvCredentialResolver;
pub use redirect::RedirectAction;
pub use redirect::RedirectPolicy;
pub use retry::RetryBudget;
pub use retry::RetryConfig;
pub use retry::RetryContext;
pub use retry::RetryDecision;
pub use retry::RetryOutcome;
pub use sse::SseStreamLocal;
pub use sse::SseDecoder;
pub use sse::SseEvent;
pub use sse::SseMessage;
pub use sse::SseStream;
pub use sse::SseStreamSend;
pub use throttle::RateLimiter;
pub use traits::HttpClient;
pub use traits::RequestBuilderExt;
pub use traits::ResponseExt;
pub use problem::ProblemDetails;
pub use chunk_download::ChunkDownloadLocal;
pub use chunk_download::ChunkDownloadSend;
pub use client::HttpEngineBuilder;
pub use client::HttpEngineCore;
pub use client::HttpEngineLocal;
pub use client::HttpEngineSend;
pub use forward::ForwardBuilderSend;
pub use hickory::HickoryResolver;
pub use request::RequestBuilderLocal;
pub use request::RequestBuilderSend;
pub use response::Response;
pub use runtime::SystemResolver;
pub use runtime::ConnectorLocal;
pub use runtime::ConnectorSend;
pub use runtime::FallbackResolver;
pub use runtime::Resolve;
pub use runtime::RuntimeCompletion;
pub use runtime::RuntimeLocal;
pub use runtime::RuntimePoll;
pub use runtime::SocketConfig;
pub use runtime::StaticResolver;
pub use traits::OwnedWasiRequestBuilder;
pub use traits::OwnedWasmRequestBuilder;
pub use traits::OwnedRequestBuilderLocal;
pub use traits::OwnedRequestBuilderSend;
pub use upgrade::UpgradedLocal;
pub use upgrade::UpgradedSend;
pub use tls::TlsInfo;
pub use tls::TlsVersion;
pub use tls::Certificate;
pub use tls::Identity;
pub use tls::TlsPemBundleError;

Modules§

address_family
Address-family preference for DNS-resolved connections. Address-family preference for DNS-resolved connection candidates.
bandwidth
Token-bucket bandwidth limiter for throttling download throughput.
blocking
Blocking (synchronous) HTTP client wrapper.
body
Request and response body types. HTTP request and response body types.
cache
HTTP response caching with conditional validation.
chunk_download
Parallel range-request file downloader.
client
HTTP client with connection pooling and redirect handling.
connector
Tower-based connector layer support.
cookie
Cookie storage and automatic cookie handling.
error
Error types for HTTP operations.
forward
Request forwarding for proxy/gateway use cases. Request forwarding for proxy/gateway use cases.
forwarded
Forwarded header builder and parser (RFC 7239).
h3_transport
HTTP/3 transport layer using QUIC.
hickory
Hickory DNS resolver integration.
hsts
HSTS (HTTP Strict Transport Security) store.
http2
HTTP/2 connection configuration.
link
Link header parsing (RFC 8288).
message_signatures
RFC 9421 HTTP Message Signatures helpers.
middleware
Request/response middleware trait and stack.
multipart
Multipart/form-data request body builder.
netrc
Netrc credential file parsing and middleware.
observer
Real-time request lifecycle observer for load testing and tracing. Real-time request lifecycle observer for load testing and tracing.
problem
RFC 9457 Problem Details for HTTP APIs.
proxy
HTTP and SOCKS proxy configuration.
proxy_credential
Credential resolver trait and built-in implementations.
redirect
Redirect policy configuration.
request
Request builder for configuring and sending HTTP requests.
response
HTTP response type with status, headers, and body.
retry
Automatic retry with exponential backoff.
runtime
Async runtime abstraction layer.
sse
Server-Sent Events (SSE) stream parser. Server-Sent Events (SSE) stream parser (WHATWG spec §9.2.5).
throttle
Token-bucket rate limiter for throttling requests.
tls
TLS configuration and connector types.
traits
Consumer-facing client trait and extension traits. Consumer-facing client trait and extension traits.
upgrade
HTTP upgrade (e.g., WebSocket) support. HTTP upgrade (e.g., WebSocket) support.
wasi_p2
WASI Preview 2 HTTP client using wasi:http/outgoing-handler. WASI Preview 2 HTTP client using wasi:http/outgoing-handler.
wasm
Compatible WebAssembly browser and worker runtime support.
wasmtime
Host-side Wasmtime WASI HTTP adapter backed by native aioduct transports. Host-side Wasmtime WASI HTTP adapter backed by native aioduct.

Structs§

ForwardBuilderLocal
Builder for forwarding an incoming HTTP request on a !Send runtime.
HeaderMap
A specialized multimap for header names and values.
Method
The Request Method (VERB)
OtelMiddleware
OpenTelemetry middleware that propagates trace context and records HTTP semantic convention attributes on the current span.
PoolHostStats
Per-host pool inventory snapshot.
PoolStats
Snapshot of pool connection statistics. All counters are monotonic since engine creation. Counts reflect pool-internal handle tracking, which may differ from physical connection counts for H2/H3 multiplexed transports.
Protocol
Extension type representing the :protocol pseudo-header in HTTP/2.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
TracingMiddleware
Middleware that emits tracing events for HTTP request lifecycle.
Uri
The URI component of a request.
Version
Represents a version of the HTTP spec.

Constants§

CONTENT_DIGEST
Header field name for RFC 9530 Content-Digest.

Functions§

insert_sha256_content_digest
Insert a SHA-256 Content-Digest header for a complete body.
sha256_content_digest_value
Build a SHA-256 Content-Digest header value for a complete body.
sha256_content_digest_value_from_digest
Build a SHA-256 Content-Digest header value from a precomputed digest.

Type Aliases§

BlockingCompioClient
Blocking client backed by the compio runtime.
BlockingSmolClient
Blocking client backed by the smol runtime.
BlockingTokioClient
Blocking client backed by the tokio runtime.
CompioClient
Convenience alias for HttpEngineLocal using the compio runtime.
CompioEngine
Alias for CompioClient.
SmolClient
Convenience alias for HttpEngineSend using the smol runtime.
SmolEngine
Alias for SmolClient.
TokioClient
Convenience alias for HttpEngineSend using the Tokio runtime.
TokioEngine
Alias for TokioClient.
WasiClient
Convenience alias for the WASI Preview 2 HTTP client.
WasmClient
Convenience alias for the compatible WebAssembly host Fetch API client.