skip to content
==> README.md <==
1# @ajax/mesh-debug-str
2
3A string quoted the way Rust's `{:?}` prints a `&str`: in double quotes, with `\"`, `\\`, `\t`, `\r`,
4`\n`, `\0` and `\u{..}` for other control characters. The port's error messages use it so they read
5exactly as the Rust's (`items "x": ...`).
6
7## Ported from
8
9[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): the many
10`{s:?}` in `crates/mesh-host`'s messages (`jobs.rs` among them).
11
12## Differences
13
14Rust also escapes Unicode grapheme extenders and unprintable non-ASCII characters (`\u{..}`); here
15non-ASCII UTF-8 passes through unchanged. The mesh's names and words are ASCII.
16
17## Tests
18
19`tests/debug_str.c`: every escape, against what `format!("{:?}", s)` prints.
20
21## Licence
22
23MIT. See the repository's LICENSE.