What does {:?} mean in a Rust format string?
问题 I found out that {:?} prints an entire array in Rust. I want to know what is it called and how exactly it works. Is it only limited to printing arrays or could it also be used elsewhere for other purposes? 回答1: This is explained (along with the rest of the formatting syntax) in the std::fmt documentation. {...} surrounds all formatting directives. : separates the name or ordinal of the thing being formatted (which in this case is omitted , and thus means "the next thing") from the formatting