Skip to main content

json_quote

Function json_quote 

Source
pub fn json_quote(text: &str) -> String
Expand description

The text as a JSON string literal, which is how every message writes a string. The escapes are the ones JSON.stringify writes: \", \\, the short forms of the control characters that have one, and \u00XX for the rest below U+0020; everything else is written as it is.