pub fn to_json<T>(value: &T) -> Result<Bytes, Error>where T: Serialize + ?Sized,
Serialize a type to JSON.