Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
100k
10k
10ms
5xx
191
1h
1ms
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Please see each crate's change log below:
- [`ohno_macros`](./crates/ohno_macros/CHANGELOG.md)
- [`recoverable`](./crates/recoverable/CHANGELOG.md)
- [`seatbelt`](./crates/seatbelt/CHANGELOG.md)
- [`seatbelt_http`](./crates/seatbelt_http/CHANGELOG.md)
- [`templated_uri`](./crates/templated_uri/CHANGELOG.md)
- [`templated_uri_macros`](./crates/templated_uri_macros/CHANGELOG.md)
- [`templated_uri_macros_impl`](./crates/templated_uri_macros_impl/CHANGELOG.md)
Expand Down
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ohno = { path = "crates/ohno", default-features = false, version = "0.3.2" }
ohno_macros = { path = "crates/ohno_macros", default-features = false, version = "0.3.0" }
recoverable = { path = "crates/recoverable", default-features = false, version = "0.1.2" }
seatbelt = { path = "crates/seatbelt", default-features = false, version = "0.5.0" }
seatbelt_http = { path = "crates/seatbelt_http", default-features = false, version = "0.2.0" }
templated_uri = { path = "crates/templated_uri", default-features = false, version = "0.2.0" }
templated_uri_macros = { path = "crates/templated_uri_macros", default-features = false, version = "0.2.0" }
templated_uri_macros_impl = { path = "crates/templated_uri_macros_impl", default-features = false, version = "0.2.0" }
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ These are the primary crates built out of this repo:
- [`ohno`](./crates/ohno/README.md) - High-quality Rust error handling.
- [`recoverable`](./crates/recoverable/README.md) - Recovery information and classification for resilience patterns.
- [`seatbelt`](./crates/seatbelt/README.md) - Resilience and recovery mechanisms for fallible operations.
- [`seatbelt_http`](./crates/seatbelt_http/README.md) - HTTP-specific extensions for the seatbelt crate.
- [`templated_uri`](./crates/templated_uri/README.md) - Standards-compliant URI handling with templating, safety validation, and data classification
- [`thread_aware`](./crates/thread_aware/README.md) - Facilities to support thread-isolated state.
- [`tick`](./crates/tick/README.md) - Provides primitives to interact with and manipulate machine time.
Expand Down
7 changes: 7 additions & 0 deletions crates/seatbelt_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## [0.2.0] - 2026-05-19

- ✨ Features

- introduce seatbelt_http crate
55 changes: 55 additions & 0 deletions crates/seatbelt_http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

[package]
name = "seatbelt_http"
description = "HTTP-specific extensions for the seatbelt crate."
version = "0.2.0"
readme = "README.md"
keywords = ["oxidizer", "resilience", "seatbelt", "http", "recovery"]
categories = ["data-structures", "network-programming"]

edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository = "https://github.com/microsoft/oxidizer/tree/main/crates/seatbelt_http"

[package.metadata.cargo_check_external_types]
allowed_external_types = [
# Workspace sibling crates
"http_extensions::*",
"seatbelt::*",
"recoverable::Recovery",
"recoverable::RecoveryInfo",
"recoverable::RecoveryKind",
"tick::clock::Clock",
]

[package.metadata.docs.rs]
all-features = true

[features]
timeout = ["seatbelt/timeout", "dep:tick"]
retry = ["seatbelt/retry", "dep:tick"]
hedging = ["seatbelt/hedging", "dep:tick"]
breaker = ["seatbelt/breaker", "dep:templated_uri", "dep:tick"]

[dependencies]
http = { workspace = true }
http_extensions = { workspace = true }
seatbelt = { workspace = true }
templated_uri = { workspace = true, optional = true }
tick = { workspace = true, optional = true }

[dev-dependencies]
futures = { workspace = true, features = ["executor"] }
http_extensions = { workspace = true, features = ["test-util"] }
layered = { workspace = true }
mutants = { workspace = true }
ohno = { workspace = true }
tick = { workspace = true, features = ["test-util"] }

[lints]
workspace = true
59 changes: 59 additions & 0 deletions crates/seatbelt_http/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<div align="center">
<img src="./logo.png" alt="Seatbelt Http Logo" width="96">

# Seatbelt Http

[![crate.io](https://img.shields.io/crates/v/seatbelt_http.svg)](https://crates.io/crates/seatbelt_http)
[![docs.rs](https://docs.rs/seatbelt_http/badge.svg)](https://docs.rs/seatbelt_http)
[![MSRV](https://img.shields.io/crates/msrv/seatbelt_http)](https://crates.io/crates/seatbelt_http)
[![CI](https://github.com/microsoft/oxidizer/actions/workflows/main.yml/badge.svg?event=push)](https://github.com/microsoft/oxidizer/actions/workflows/main.yml)
[![Coverage](https://codecov.io/gh/microsoft/oxidizer/graph/badge.svg?token=FCUG0EL5TI)](https://codecov.io/gh/microsoft/oxidizer)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)
<a href="../.."><img src="../../logo.svg" alt="This crate was developed as part of the Oxidizer project" width="20"></a>

</div>

HTTP-specific extensions for the [`seatbelt`][__link0] resilience middleware.

Each [`seatbelt`][__link1] middleware is generic over its input and output types.
This crate specializes them for [`HttpRequest`][__link2] /
[`Result<HttpResponse>`][__link3] 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:

|Module|Feature|Purpose|
|------|-------|-------|
|`retry`|`retry`|Recovery classification, request cloning, request restoration from errors.|
|`timeout`|`timeout`|Converts timeout events into HTTP-specific errors.|
|`hedging`|`hedging`|Recovery classification and request cloning for tail-latency reduction.|
|`breaker`|`breaker`|Recovery classification and rejected-request error handling.|

## Shared types

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


<hr/>
<sub>
This crate was developed as part of <a href="../..">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/seatbelt_http">source code</a>.
</sub>

[__cargo_doc2readme_dependencies_info]: ggGkYW0CYXSEGy4k8ldDFPOhG2VNeXtD5nnKG6EPY6OfW5wBG8g18NOFNdxpYXKEG0zpOHumdJRlG7vvc1rvGGXMG8lb6BInDEwlGyUJKXppjYapYWSDgm9odHRwX2V4dGVuc2lvbnNlMC40LjCCaHNlYXRiZWx0ZTAuNS4wgm1zZWF0YmVsdF9odHRwZTAuMi4w
[__link0]: https://crates.io/crates/seatbelt/0.5.0
[__link1]: https://crates.io/crates/seatbelt/0.5.0
[__link2]: https://docs.rs/http_extensions/0.4.0/http_extensions/?search=HttpRequest
[__link3]: https://docs.rs/http_extensions/0.4.0/http_extensions/?search=Result
[__link4]: https://docs.rs/seatbelt_http/0.2.0/seatbelt_http/?search=HttpRecovery
[__link5]: https://docs.rs/seatbelt_http/0.2.0/seatbelt_http/?search=HttpClone
[__link6]: https://docs.rs/seatbelt_http/0.2.0/seatbelt_http/type.HttpResilienceContext.html
[__link7]: https://docs.rs/seatbelt/0.5.0/seatbelt/?search=ResilienceContext
3 changes: 3 additions & 0 deletions crates/seatbelt_http/favicon.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions crates/seatbelt_http/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading