rama-http-hyperium 0.3.0-rc1

conversions between rama-http-types and the hyperium `http` crate (ecosystem interop)
Documentation

Conversions between the native rama-http-types types and the hyperium http crate equivalents, for interop with the wider http/tower/hyper ecosystem.

rama-http-types is http-free; this crate is the opt-in bridge, exposed as two sealed, fallible extension traits: [TryIntoHyperiumHttp] (rama → http) and [TryIntoRamaHttp] (http → rama). They are local traits, so they implement the foreign http types directly (no orphan rule, no conversion marker) and are callable as plain methods.

The conversions are fallible by design: an invalid method/status, an unrepresentable URI, or an invalid header name/value is surfaced as an error (the direction's natural catch-all — [http::Error] one way, [rama_http_types::Error] the other) rather than silently coerced.

Bodies are bridged (not copied) by [HyperiumBody] / [RamaBody], which wrap rama's Body ↔ the external [http_body::Body], converting only trailer frames.

use rama_http_hyperium::{TryIntoHyperiumHttp, TryIntoRamaHttp};

let hyper_req = http::Request::builder().uri("http://example.com/").body(()).unwrap();
let rama_req: rama_http_types::Request<()> = hyper_req.try_into_rama_http().unwrap();
assert_eq!(rama_req.uri().to_string(), "http://example.com/");

let back: http::Request<()> = rama_req.try_into_hyperium_http().unwrap();
assert_eq!(back.uri(), "http://example.com/");