MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / json

Method json

src/http/body.rs:228–231  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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 }))

Callers 3

fetch_locationsFunction · 0.80
fetch_weatherFunction · 0.80
mainFunction · 0.80

Calls 1

str_contentsMethod · 0.80

Tested by

no test coverage detected