Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Flags

aioduct uses feature flags to control runtime, TLS, and serialization dependencies. The default feature set is empty — you must enable at least one runtime.

Available Features

FeatureDependenciesStabilityDescription
tokiotokioStableTokio async runtime
smolsmol, async-io, futures-ioStableSmol async runtime
compiocompio-runtime, async-ioExperimentalCompio runtime (io_uring / IOCP)
wasmwasm-bindgen, web-sys, js-sysExperimentalBrowser/WASM runtime
rustlsrustls, webpki-roots, rustls-pemfileStableTLS backend via rustls; requires exactly one rustls provider
rustls-ringrustls ring providerStableRing crypto provider for rustls
rustls-aws-lc-rsrustls AWS-LC providerStableAWS-LC crypto provider for rustls
rustls-native-rootsrustls-native-certsStableUse OS certificate store with either rustls provider
jsonserde, serde_json, serde_urlencodedStableJSON request/response helpers
charsetencoding_rs, mimeStableCharset decoding for response text
gzipflate2StableGzip response decompression
deflateflate2StableDeflate response decompression
brotlibrotliStableBrotli response decompression
zstdzstdStableZstd response decompression
blockingtokioStableSynchronous blocking client wrapper
hickory-dnshickory-resolver, tokioStableDNS resolution via hickory
dohhickory-resolver (https)StableDNS-over-HTTPS (implies hickory-dns)
dothickory-resolver (tls)StableDNS-over-TLS (implies hickory-dns)
towertower-service, tower-layerStableTower Service/Layer integration
tracingtracingStableTracing spans for HTTP requests
otelopentelemetry, opentelemetry-httpStableOpenTelemetry middleware
http3h3, h3-quinn, quinnExperimentalHTTP/3 transport; currently requires rustls plus one rustls provider

TLS Provider Features

Use rustls for the HTTPS backend and choose exactly one rustls crypto provider: rustls-ring or rustls-aws-lc-rs. The backend and provider flags are separate so future TLS backends, such as a reserved native-tls/OpenSSL backend, can compose with higher-level HTTP features without changing the rustls provider model. rustls-native-roots is provider-neutral: it enables the rustls backend and composes with either provider.

Compile Error Without Runtime

If no runtime feature is selected, aioduct emits a compile error:

error: aioduct: enable at least one runtime feature: tokio, smol, compio, or wasm

Common Feature Combinations

# HTTP only, tokio runtime
aioduct = { version = "0.2.0-alpha.1", features = ["tokio"] }

# HTTPS + JSON, tokio runtime
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "json"] }

# HTTPS with AWS-LC, tokio runtime
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-aws-lc-rs"] }

# HTTPS with AWS-LC and OS native roots
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls-native-roots", "rustls-aws-lc-rs"] }

# HTTP only, smol runtime
aioduct = { version = "0.2.0-alpha.1", features = ["smol"] }

# HTTPS, smol runtime
aioduct = { version = "0.2.0-alpha.1", features = ["smol", "rustls", "rustls-ring"] }

# HTTP only, compio runtime (experimental)
aioduct = { version = "0.2.0-alpha.1", features = ["compio"] }

# HTTPS + JSON + compression, tokio runtime
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "json", "gzip", "brotli", "zstd", "deflate"] }

# Blocking client (synchronous)
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "blocking"] }

# With tracing and OpenTelemetry
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "tracing", "otel"] }

# With tower integration
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "tower"] }

# Hickory DNS resolver
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "hickory-dns"] }

# DNS-over-HTTPS
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "doh"] }

# DNS-over-TLS
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "rustls", "rustls-ring", "dot"] }

# HTTP/3 with ring
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "http3", "rustls", "rustls-ring"] }

# HTTP/3 with AWS-LC
aioduct = { version = "0.2.0-alpha.1", features = ["tokio", "http3", "rustls", "rustls-aws-lc-rs"] }

Core Dependencies (Always Included)

These are pulled in regardless of feature flags:

  • hyper 1.x — HTTP/1.1 and HTTP/2 protocol engine
  • http — Standard HTTP types (Method, StatusCode, HeaderMap, etc.)
  • http-body-util — Body combinators for hyper
  • bytes — Zero-copy byte buffers
  • pin-project-lite — Safe pin projections
  • thiserror — Error derive macros
  • base64 — Base64 encoding for basic auth
  • percent-encoding — URL percent-encoding for query params and forms