Function ruma_serde::to_canonical_json_string[][src]

pub fn to_canonical_json_string<T: Serialize>(val: &T) -> Result<String, Error>
Expand description

Returns a canonical JSON string according to Matrix specification.

This function should be preferred over serde_json::to_string since it checks the size of the canonical string. Matrix canonical JSON enforces a size limit of less than 65,535 when sending PDU’s for the server-server protocol.