# RustPrint > RustPrint is a focused, English-language reference for printing, formatting, output, Debug, Display, and related compiler errors in Rust. Use the Markdown resources below for agent-friendly reading. Rust code shown in checked examples is sourced from repository fixtures that are compiled or tested in CI. Debug output is for inspection and must not be treated as a stable serialization format. ## Start here - [Rust format strings - syntax, width, precision, and traits](https://rustprint.com/format/format-strings/index.md): Read Rust format strings from {} through argument capture, width, precision, alignment, escaping, and formatting traits. - [Rust print without newline: print! vs println!](https://rustprint.com/output/print-and-println/index.md): Print in Rust with or without a newline. Compare print! and println!, flush stdout for prompts, and avoid repeated stdout locking. - [Debug vs Display in Rust](https://rustprint.com/debug/debug-vs-display/index.md): Choose between Rust Debug and Display based on programmer-facing inspection versus deliberate user-facing text. ## Debugging and inspection - [Debug vs Display in Rust](https://rustprint.com/debug/debug-vs-display/index.md): Choose between Rust Debug and Display based on programmer-facing inspection versus deliberate user-facing text. - [Implement custom Debug in Rust](https://rustprint.com/debug/implement-debug/index.md): Implement Rust's Debug trait manually with Formatter::debug_struct, choose which fields appear, redact sensitive values, and keep {:#?} pretty printing. - [Print a HashMap in Rust](https://rustprint.com/debug/print-hashmap/index.md): Print a Rust HashMap with {:?} or {:#?}, understand why entry order can change, and choose deterministic output when order matters. - [Print a Vec in Rust](https://rustprint.com/debug/print-vec/index.md): Print a Rust Vec with {:?} or {:#?}, understand why {} fails, and format vector elements yourself when you need user-facing output. - [Print structs and arrays in Rust](https://rustprint.com/debug/print-struct/index.md): Print a Rust struct by deriving Debug and using {:?} or {:#?}, and print arrays with the same Debug formatting syntax. - [Rust dbg! macro: inspect values with Debug](https://rustprint.com/debug/inspect-values/index.md): Use Rust dbg! to print expressions to stderr, understand its return and move behavior, and compare compact {:?} with pretty {:#?} Debug output. - [Rust pretty print a struct with {:#?}](https://rustprint.com/debug/pretty-debug/index.md): Pretty print Rust structs, enums, maps, and nested values with {:#?}, derive Debug, and understand why Debug output is not a stable serialization format. ## Formatting errors - [Rust E0277: type doesn't implement Debug](https://rustprint.com/errors/doesnt-implement-debug/index.md): Fix Rust E0277 when a value cannot be formatted with {:?} because its type does not implement std::fmt::Debug. - [Rust E0277: type doesn't implement Display](https://rustprint.com/errors/doesnt-implement-display/index.md): Fix Rust E0277 when a type cannot be formatted with {} because it does not implement std::fmt::Display. ## Formatting - [Dynamic format strings in Rust: why format! requires a literal](https://rustprint.com/format/runtime-format-strings/index.md): Understand why Rust format! cannot use a runtime String as its format template, while runtime values still work normally. - [Escaping braces in Rust format strings](https://rustprint.com/format/escaping-braces/index.md): Print literal curly braces in Rust format strings and combine escaped braces with captured values safely. - [Implement Display for a Rust struct](https://rustprint.com/format/implement-display/index.md): Implement std::fmt::Display for a Rust struct with Formatter and write!, then use {} formatting and to_string(). - [Rust format arguments: positional, named, and captured variables](https://rustprint.com/format/arguments-and-capture/index.md): Use implicit, positional, named, and captured arguments in Rust format strings, including println! with captured variables and how argument selection ends at the colon. - [Rust format float decimals and precision](https://rustprint.com/format/precision/index.md): Format Rust floats to 2 decimal places, control precision for scientific notation and strings, and understand why integer precision is ignored. - [Rust format hex with 0x, binary with 0b, and pretty Debug](https://rustprint.com/format/alternate-format/index.md): Use Rust's # format flag to add 0x, 0b, and 0o prefixes, combine them with zero padding, and request pretty Debug output with {:#?}. - [Rust format hex, binary, octal, and scientific notation](https://rustprint.com/format/number-bases/index.md): Format Rust numbers as hex, binary, octal, or scientific notation with std::fmt suffixes, uppercase output, prefixes, width, and zero padding. - [Rust format strings - syntax, width, precision, and traits](https://rustprint.com/format/format-strings/index.md): Read Rust format strings from {} through argument capture, width, precision, alignment, escaping, and formatting traits. - [Rust leading zeros, signs, and zero padding](https://rustprint.com/format/signs-and-zero-padding/index.md): Add leading zeros and explicit signs to Rust numbers with format width and sign-aware zero padding, including prefixed hex, binary, and octal. - [Rust pad and align strings with width and fill](https://rustprint.com/format/width-alignment-fill/index.md): Pad Rust strings and formatted values with minimum width, left, center, or right alignment, and custom fill characters. ## Output - [Flush stdout in Rust](https://rustprint.com/output/flush-stdout/index.md): Flush Rust stdout after print! so prompts appear immediately, and fix flush() by importing std::io::Write. - [format_args! - deferred formatting arguments](https://rustprint.com/output/format-args/index.md): Use Rust format_args! to create fmt::Arguments for forwarding formatted values without first allocating a String. - [format! - build a String](https://rustprint.com/output/format-macro/index.md): Use Rust format! when you need an owned String produced with the standard formatting syntax. - [Rust output macros: print!, eprintln!, write!, and format!](https://rustprint.com/output/output-macros/index.md): Choose the right Rust output macro for stdout, stderr, an owned String, or an existing writer, including newline, flushing, and buffering behavior. - [Rust print without newline: print! vs println!](https://rustprint.com/output/print-and-println/index.md): Print in Rust with or without a newline. Compare print! and println!, flush stdout for prompts, and avoid repeated stdout locking. - [Rust stderr: eprint! and eprintln!](https://rustprint.com/output/stderr-eprint-eprintln/index.md): Print Rust errors, warnings, and progress messages to stderr with eprint! and eprintln!, keeping machine-readable stdout output clean. - [Rust write! and writeln! - format into strings, files, and buffers](https://rustprint.com/output/write-and-writeln/index.md): Use Rust write! and writeln! to format directly into String buffers, byte writers, files, sockets, and other write_fmt destinations. ## Reference - [Rust format specifier grammar](https://rustprint.com/reference/format-specifier-grammar/index.md): Read the exact order of fill, alignment, sign, alternate, zero, width, precision, and type in a Rust format specification. - [Rust formatting traits - Display, Debug, hex, binary, and more](https://rustprint.com/reference/formatting-traits/index.md): Map Rust format syntax such as {}, {:?}, {:x}, {:b}, and {:e} to the std::fmt traits Display, Debug, LowerHex, Binary, and LowerExp. ## Optional - [Format String Explorer](https://rustprint.com/tools/format-string/): Interactive decoder and builder for a supported single-field Rust std::fmt specification. - [Formatting Error Explainer](https://rustprint.com/tools/error-explainer/): Deterministic browser-side matcher for verified Rust formatting and output compiler diagnostics. - [All RustPrint content in one text file](https://rustprint.com/llms-full.txt): Bulk context export generated from the same documentation sources. - [Official Rust std::fmt documentation](https://doc.rust-lang.org/std/fmt/): Authoritative standard-library formatting documentation.