Display is Rust’s standard trait for turning a value into user-facing text. Macros such as println!, print!, write!, writeln!, and format! use Display implementations when formatting with {}. section 3.6.2
A type opts into Display with impl Display for Type and must provide fmt, which receives a mutable Formatter and returns fmt::Result. Unlike an automatically derived Debug representation, Display lets you choose the text. section 3.6.2
Formatting a file value
Implement Display for FileState by matching Open and Closed, then implement Display for File with write!(f, "<{} ({})>", self.name, self.state). Because FileState also implements Display, the File implementation can format its state with {}. section 3.6.2
Displaying a wrapper error
An error enum containing I/O and address-parsing errors can implement Display with write!(f, "{:?}", self), reusing its Debug representation before implementing std::error::Error. section 8.5.2
A Display implementation typically follows these steps:
- Write impl Display for Type. section 3.6.2


