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
§Author
Haixing Hu
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
Header Injector - Async 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 that applies options, header injection, logging, and timeouts.
- 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 Retry Override - Per-request overrides for the client retry strategy.
- Http
Response - Complete HTTP response after the body has been read into memory.
- Http
Retry Options - Retry settings for
crate::HttpClient. - Http
Stream Response - HTTP response metadata plus a lazy body stream (from
crate::HttpClient::execute_stream). - Proxy
Options - Outbound proxy configuration applied when building the reqwest client.
- Sensitive
Headers - Case-insensitive set of HTTP header names whose values should be masked in logs.
- Timeout
Options - Connect, read, write, and optional whole-request timeouts for HTTP I/O.
Enums§
- Delay
- Base delay strategy before jitter is applied.
- 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.
- Jitter
- Jitter applied after a base
crate::Delayhas been calculated. - Proxy
Type - URL scheme selector used when constructing the proxy URL for reqwest.
- Retry
Hint - High-level classification from
crate::HttpError::retry_hintfor backoff policies.
Type Aliases§
- Header
Injector - Header injector function used to mutate outgoing request headers.
- Http
Byte Stream - Pin-boxed async stream of body chunks or errors, used by
crate::HttpStreamResponse. - Http
Result Resultalias for HTTP operations: success valueTorHttpError.