MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / convert_to_binary

Function convert_to_binary

lambda-http/src/response.rs:377–392  ·  view source on GitHub ↗
(body: B)

Source from the content-addressed store, hash-verified

375}
376
377fn convert_to_binary<B>(body: B) -> BodyFuture
378where
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
394fn convert_to_text<B>(body: B, content_type: &str) -> BodyFuture
395where

Callers 1

convertMethod · 0.85

Calls 1

collectMethod · 0.80

Tested by

no test coverage detected