Skip to main content

to_ascii_json_string

Function to_ascii_json_string 

Source
pub fn to_ascii_json_string<T>(value: &T) -> Result<String>
where T: Serialize + ?Sized,
Expand description

Serialize JSON while escaping non-ASCII string content as \uXXXX.

This is useful when JSON needs to remain parseable as JSON but must be carried through ASCII-safe transports such as HTTP headers.