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