-
I'm trying to create some impedance-matching glue between I've tried using I'm fairly new to Rust, so I may be "using it wrong", or trying to do something that should be done some other way. Basically would like to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think I cracked the nut (but welcome feedback if there's a better way!): use lambda_http as LH;
use axum::http as AH;
use axum::body::BoxBody;
use hyper::body::to_bytes;
async fn lambda_http_response_from_axum(resp: AH::Response<BoxBody>) -> Result<LH::Response<LH::Body>, LH::Error> {
let (head, body) = resp.into_parts();
let raw = to_bytes(body).await?;
let resp = LH::Response::from_parts(head, LH::Body::Binary(raw.to_vec()));
Ok(resp)
} Still need to properly handle content type.... |
Beta Was this translation helpful? Give feedback.
I think I cracked the nut (but welcome feedback if there's a better way!):
Still need to properly handle content type....