macro_rules! write_val {
($w:ident, $v:ident, $f:expr) => { ... };
}Expand description
Write a value as JSON superset, using a function $f to write sub-values.
This macro writes strings by replacing invalid UTF-8 characters with the Unicode replacement character. That way, this macro can be used not only for writers, but also for formatters, which require all output to be valid UTF-8. However, the JSON/YAML writers usually override this behaviour, yielding invalid UTF-8 characters as-is.