Trait EscapeJson

Source
pub trait EscapeJson {
    // Required method
    fn escape_json(&self) -> String;
}
Expand description

Escape a string for JSON.

This is useful to escape the content of a message, for example. Withouht escaping, the JSON would be invalid and the API would return an error.

Required Methods§

Implementations on Foreign Types§

Source§

impl EscapeJson for str

Source§

impl EscapeJson for String

Implementors§