Skip to content
masterclass Buddy

Rust · Trait

Display

Display defines the user-facing text produced by {} formatting. Implementing it also provides ToString and enables .to_string().

Last updated

Since
1.0.0

Syntax

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

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

Subscribe
  • ToString
  • Debug
  • Formatter
  • FromStr
  • format!
  • write!

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