Struct sparkly::Doc [] [src]

pub struct Doc { /* fields omitted */ }

The type of pretty-printed text.

Methods

impl Doc
[src]

[src]

Returns an empty Doc.

[src]

Expands to a newline, which will never be shortened.

[src]

Expands to the given string, if it will fit, or a newline if it won't.

[src]

Concatenates Docs, putting newlines between them.

[src]

Returns a Doc that always expands to a space.

[src]

Returns a Doc that expands to a space if it will fit, or a newline if it won't.

[src]

Returns a Doc that represents a point where a line may be split if needed.

[src]

Constructs a Doc containing the given text with the given style.

impl Doc
[src]

[src]

Appends one Doc to another.

[src]

Brackets a Doc between two constant strings.

[src]

Groups the contents of a Doc.

[src]

Joins Docs, placing the self Doc between them.

[src]

Nests the Doc with the given amount of indentation.

[src]

Applies a style to a Doc.

impl Doc
[src]

[src]

Returns an object that implements Display for the current size of the terminal, or 80 columns wide if it cannot be detected. Color is enabled if stdout is a TTY.

Terminal width detection requires the termion feature.

[src]

Returns an object that implements Display for the given options.

Trait Implementations

impl From<&'static str> for Doc
[src]

[src]

Performs the conversion.

impl From<String> for Doc
[src]

[src]

Performs the conversion.

impl FromIterator<Doc> for Doc
[src]

[src]

Creates a value from an iterator. Read more

impl Clone for Doc
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Doc
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Doc
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl From<DocInner> for Doc
[src]

[src]

Performs the conversion.

impl Sparkly for Doc
[src]

[src]

Returns a Doc corresponding to the value.