Function vector::serde::json::to_bytes

source ·
pub fn to_bytes<T>(value: &T) -> Result<BytesMut>
where T: ?Sized + Serialize,
Expand description

Serialize the given data structure as JSON to BytesMut.

§Errors

Serialization can fail if T’s implementation of Serialize decides to fail, or if T contains a map with non-string keys.