Skip to main content

encode_to_string_pretty

Function encode_to_string_pretty 

Source
pub fn encode_to_string_pretty<M: TextFormat>(msg: &M) -> String
Available on crate feature text only.
Expand description

Encode a message as a multi-line textproto string with 2-space indent.

One field per line; nested messages are indented. A trailing newline is appended when the output is non-empty, matching txtpbfmt and POSIX text-file conventions.