pub fn to_json<T>(value: &T) -> crate::Result<Bytes>
where
    T: ?Sized + Serialize,
{
    Ok(Bytes::from(serde_json::to_vec(value)?))
}
/// Serialize a type to json.
Serialize a type to json.
Serialize a type to json .
pub fn to_json<T>(value: &T) -> crate::Result<Bytes>
where
    T: ?Sized + Serialize,
{
    Ok(Bytes::from(serde_json::to_vec(value)?))
}
pub fn to_json < T > ( value : & T ) -> crate :: Result < Bytes > where T : ? Sized + Serialize , { Ok ( Bytes :: from ( serde_json :: to_vec ( value ) ? ) ) }
Serialize a type to json.
Serialize a type to json .
value
&T