Expand description
This crate defines a Wadler-style pretty-printing API.
Start with the static functions of Doc.
§Quick start
Let’s pretty-print simple sexps! We want to pretty print sexps like
(1 2 3)
or, if the line would be too long, like
((1)
(2 3)
(4 5 6))
A simple symbolic expression consists of a numeric atom or a nested ordered list of symbolic expression children.
Modules§
Macros§
- docs
- Concatenates a number of documents (or values that can be converted into a document via the
Pretty
trait, like&str
)
Structs§
- Ansi
Style - The definition of the ANSI styles.
- Ansi
Writer - A writer that supports ANSI escape codes.
- Buffer
Write - Represents a terminal writer.
- FmtWrite
- Writes to something implementing
std::fmt::Write
- IoWrite
- Writes to something implementing
std::io::Write
- Pretty
Formatter - The given text, which must not contain line breaks.
- Pretty
Provider - Represents a pretty-printable tree provider.
- Terminal
Writer - Represents a terminal writer.
Enums§
- Ansi
Ability - The ability of a writer to support ANSI escape codes.
- Ansi
Color - The definition of the ANSI colors.
- Pretty
Tree - The concrete document type. This type is not meant to be used directly. Instead use the static
functions on
Doc
or the methods on anDocAllocator
.
Traits§
- Pretty
Builder - The
PrettyPrint
trait is implemented by types that can be pretty-printed. - Pretty
Print - Marker trait for types that can be pretty printed.
- Render
- Trait representing the operations necessary to render a document
- Render
Annotated - Trait representing the operations necessary to write an annotated document.