Skip to main content

Crate seatbelt_http

Crate seatbelt_http 

Source
Expand description

HTTP-specific extensions for the seatbelt resilience middleware.

Each seatbelt middleware is generic over its input and output types. This crate specializes them for HttpRequest / Result<HttpResponse> and adds HTTP-aware builder methods, all prefixed with http_.

§Supported middleware

Each middleware lives in its own feature-gated module with specialized type aliases and an extension trait:

ModuleFeaturePurpose
retryretryRecovery classification, request cloning, request restoration from errors.
timeouttimeoutConverts timeout events into HTTP-specific errors.
hedginghedgingRecovery classification and request cloning for tail-latency reduction.
breakerbreakerRecovery classification and rejected-request error handling.

§Shared types

  • HttpRecovery: classifies HTTP responses as recoverable. By default, 5xx status codes, 429 Too Many Requests, and request timeouts are treated as transient.
  • HttpClone: selects which HTTP methods are eligible for cloning during retries and hedging (safe-only, idempotent, or all).
  • HttpResilienceContext: the HTTP specialization of ResilienceContext.

Modules§

breakerbreaker
HTTP-specific circuit breaker middleware.
hedginghedging
HTTP-specific hedging middleware.
retryretry
HTTP-specific retry middleware.
timeouttimeout
HTTP-specific timeout middleware.

Structs§

HttpClonehedging or retry
A strategy for cloning HTTP requests for retries or hedging.
HttpRecoverybreaker or hedging or retry
Configuration for classifying the recovery information of HTTP responses.

Type Aliases§

HttpResilienceContext
Shared configuration and runtime context for HTTP resilience middleware.