(body: B)
| 375 | } |
| 376 | |
| 377 | fn convert_to_binary<B>(body: B) -> BodyFuture |
| 378 | where |
| 379 | B: HttpBody + Unpin + Send + 'static, |
| 380 | B::Data: Send, |
| 381 | B::Error: fmt::Debug, |
| 382 | { |
| 383 | Box::pin(async move { |
| 384 | Body::from( |
| 385 | body.collect() |
| 386 | .await |
| 387 | .expect("unable to read bytes from body") |
| 388 | .to_bytes() |
| 389 | .to_vec(), |
| 390 | ) |
| 391 | }) |
| 392 | } |
| 393 | |
| 394 | fn convert_to_text<B>(body: B, content_type: &str) -> BodyFuture |
| 395 | where |