Context
Rust's anyhow::Error supports multiple display formats:
{}: outermost context only
{:#}: colon-joined full chain: "g failed: f failed: oh no!"
{:?}: structured debug with "Caused by:" section
Our Failure::fmt() always renders newline-separated outermost-first. This issue tracks adding the alternate formats.
Proposed API
failure.fmt() // existing: newline-separated, outermost first (matches current behaviour)
failure.fmt_inline() // new: colon-joined chain, e.g. "outer: middle: root [domain]"
failure.fmt_debug() // new: structured with "Caused by:" indented block
No operator<< overload changes needed -- callers pick the method explicitly.
Context
Rust's
anyhow::Errorsupports multiple display formats:{}: outermost context only{:#}: colon-joined full chain:"g failed: f failed: oh no!"{:?}: structured debug with "Caused by:" sectionOur
Failure::fmt()always renders newline-separated outermost-first. This issue tracks adding the alternate formats.Proposed API
No
operator<<overload changes needed -- callers pick the method explicitly.