Function htrpc::json_pretty::serialize

source ·
pub fn serialize<S, T>(value: T, serializer: S) -> Result<S::Ok, S::Error>where
    T: Serialize,
    S: Serializer,
Expand description

Serializes the value as a pretty printed JSON string.

This function can be used as the value of the serde(serialize_with) attribute (i.e., #[serde(serialize_with = "htrpc::json_pretty::serialize")]).