Skip to main content

Module prettier

Module prettier 

Macros§

pretty_via_display
Generate an implementation of PrettyPrint for a given type by delegating to core::fmt::Display.
pretty_via_to_string
Generate an implementation of PrettyPrint for a given type by delegating to alloc::string::ToString.

Enums§

Document

Traits§

PrettyPrint
The PrettyPrint trait is used as a building block for pretty printing data or syntax trees, as commonly seen in tools like Prettier.

Functions§

concat
Concatenate two documents, producing a single document representing both.
const_text
Same as text, but for static/constant strings
display
Display the given value using its core::fmt::Display implementation.
flatten
Use the leftmost option of every choice in the given document.
indent
Increase the indentation level of the given document by width.
nl
Render a line break (i.e. newline) in the output
pretty_print_csv
Pretty-print a list of PrettyPrint values as comma-separated items.
split
Create a document by splitting input on line breaks so ensure the invariants of text are upheld.
text
Display the given string exactly.