MCPcopy Create free account
hub / github.com/aws/aws-lambda-rust-runtime / serialize

Method serialize

lambda-events/src/encodings/http.rs:178–191  ·  view source on GitHub ↗
(&self, serializer: S)

Source from the content-addressed store, hash-verified

176
177impl Serialize for Body {
178 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
179 where
180 S: Serializer,
181 {
182 match self {
183 Body::Text(data) => {
184 serializer.serialize_str(::std::str::from_utf8(data.as_ref()).map_err(S::Error::custom)?)
185 }
186 Body::Binary(data) => {
187 serializer.collect_str(&Base64Display::new(data, &base64::engine::general_purpose::STANDARD))
188 }
189 Body::Empty => serializer.serialize_unit(),
190 }
191 }
192}
193
194impl<'de> Deserialize<'de> for Body {

Callers

nothing calls this directly

Calls 1

as_refMethod · 0.80

Tested by

no test coverage detected