pub struct PrettyPrinter<'a> { /* private fields */ }

Implementations

Add an input which should be pretty-printed

Adds multiple inputs which should be pretty-printed

Add a file which should be pretty-printed

Add multiple files which should be pretty-printed

Add STDIN as an input

Add a byte string as an input

Add a custom reader as an input

Specify the syntax file which should be used (default: auto-detect)

The character width of the terminal (default: autodetect)

The width of tab characters (default: None - do not turn tabs to spaces)

Whether or not the output should be colorized (default: true)

Whether or not to output 24bit colors (default: true)

Whether to show a header with the file name

Whether to show line numbers

Whether to paint a grid, separating line numbers, git changes and the code

Whether to paint a horizontal rule to delimit files

Whether to show modification markers for VCS changes. This has no effect if the git feature is not activated.

Whether to show “snip” markers between visible line ranges (default: no)

Text wrapping mode (default: do not wrap)

Whether or not to use ANSI italics (default: off)

If and how to use a pager (default: no paging)

Specify the command to start the pager (default: use “less”)

Specify the lines that should be printed (default: all)

Specify a line that should be highlighted (default: none). This can be called multiple times to highlight more than one line. See also: highlight_range.

Specify a range of lines that should be highlighted (default: none). This can be called multiple times to highlight more than one range of lines.

Specify the highlighting theme

Specify custom file extension / file name to syntax mappings

Pretty-print all specified inputs. This method will “use” all stored inputs. If you want to call ‘print’ multiple times, you have to call the appropriate input_* methods again.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.