Skip to content
masterclass Buddy

Rust · Trait

Debug

Debug formats values for programmers. Usually derive it with #[derive(Debug)], then use {:?} or {:#?} in format strings.

Last updated

Since
1.0.0

Syntax

pub trait Debug {
    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>;
}

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • core::fmt::Formatter
  • std::fmt::Formatter
  • debug_struct
  • debug_tuple
  • debug_list
  • debug_set
  • debug_map

Source: Debug in std::fmt - Rust. Checked 2026-11-03.