(&mut self)
| 226 | /// valid json, or the json is not accepted by the `serde::Deserialize` impl. |
| 227 | #[cfg(feature = "json")] |
| 228 | pub async fn json<T: for<'a> serde::Deserialize<'a>>(&mut self) -> Result<T, Error> { |
| 229 | let str = self.str_contents().await?; |
| 230 | serde_json::from_str(str).context("decoding body contents as json") |
| 231 | } |
| 232 | |
| 233 | pub(crate) fn from_incoming(body: WasiIncomingBody, size_hint: BodyHint) -> Self { |
| 234 | Body(BodyInner::Incoming(Incoming { body, size_hint })) |
no test coverage detected