Expand description
§Qubit HTTP
A general-purpose HTTP infrastructure module for Rust services.
This crate provides:
- Unified HTTP client options and factory abstractions
- Loading those options from
qubit_config::ConfigReader(from_config/ factorycreate_from_config) - Consistent request/response/stream APIs
- Secure and configurable logging with sensitive header masking
- Built-in SSE decoding utilities in
sse - Unified error model and retry hints
Re-exports§
pub use constants::DEFAULT_SENSITIVE_HEADER_NAMES;
Modules§
- constants
- Crate-wide defaults and fixed tuning values for HTTP client behavior and logging.
- sse
- SSE Decoding
Structs§
- Async
Http Header Injector - Async HTTP header injector that can await external state (for example token refresh) before mutating outbound request headers.
- Cancellation
Token - A token which can be used to signal a cancellation request to one or more tasks.
- Http
Client - High-level HTTP client: default headers, injectors, interceptors, logging, timeouts, and optional per-request retry.
- Http
Client Factory - Public factory used to build reqwest-backed
HttpClientinstances. - Http
Client Options - Aggregated settings for
crate::HttpClientandcrate::HttpClientFactory. - Http
Config Error - Error type for HTTP configuration conversion failures.
- Http
Error - Unified HTTP error type.
- Http
Logger - HTTP logger bound to one pair of logging options and sensitive header policy.
- Http
Logging Options - Controls TRACE-level HTTP request/response logging in
crate::HttpLogger. - Http
Request - Immutable snapshot of a single HTTP call produced by
crate::HttpRequestBuilder. - Http
Request Builder - Builder for
HttpRequest. - Http
Request Interceptors - Ordered request interceptor list with unified application behavior.
- Http
Request Retry Override - Per-request overrides for the client retry strategy.
- Http
Request Streaming Body - Deferred streaming upload body source.
- Http
Response - Unified HTTP response with lazily consumed body.
- Http
Response Interceptors - Ordered response interceptor list with unified application behavior.
- Http
Response Meta - HTTP response metadata available before body buffering/stream consumption.
- Http
Retry Options - Retry settings for
crate::HttpClient. - Http
Timeout Options - Connect, read, write, and optional whole-request timeouts for HTTP I/O.
- Proxy
Options - Outbound proxy configuration applied when building the reqwest client.
- Retry
Options - Immutable retry option snapshot used by
crate::Retry. - Sensitive
Http Headers - Case-insensitive set of HTTP header names whose values should be masked in logs.
Enums§
- Http
Config Error Kind - Category of HTTP configuration errors.
- Http
Error Kind - Category of HTTP errors.
- Http
Request Body - Encodes how the outbound body is represented before sending via reqwest.
- Http
Retry Method Policy - HTTP method policy used to decide whether a request can be retried.
- Proxy
Type - URL scheme selector used when constructing the proxy URL for reqwest.
- Retry
Delay - Base delay strategy before jitter is applied.
- Retry
Hint - High-level classification from
crate::HttpError::retry_hintfor backoff policies. - Retry
Jitter - Jitter strategy applied after a base
crate::RetryDelayhas been calculated.
Type Aliases§
- Http
Byte Stream - Pin-boxed async stream of body chunks or errors, used by
crate::HttpResponse. - Http
Header Injector - Header injector function used to mutate outgoing request headers.
- Http
Request Body Byte Stream - Pin-boxed async stream used for request streaming upload bodies.
- Http
Request Interceptor - Request interceptor function used to mutate an outbound
HttpRequestbefore URL resolution, header merge, and network I/O. - Http
Response Interceptor - Response interceptor function used to inspect/mutate response metadata
(
status,headers,url) before the response is returned to callers. - Http
Result Resultalias for HTTP operations: success valueTorHttpError.