Struct rustc_ast_pretty::pp::Printer[][src]

pub struct Printer {
    out: String,
    buf_max_len: usize,
    margin: isize,
    space: isize,
    left: usize,
    right: usize,
    buf: Vec<BufEntry>,
    left_total: isize,
    right_total: isize,
    scan_stack: VecDeque<usize>,
    print_stack: Vec<PrintStackElem>,
    pending_indentation: isize,
}

Fields

out: Stringbuf_max_len: usizemargin: isize

Width of lines we’re constrained to

space: isize

Number of spaces left on line

left: usize

Index of left side of input stream

right: usize

Index of right side of input stream

buf: Vec<BufEntry>

Ring-buffer of tokens and calculated sizes

left_total: isize

Running size of stream “…left”

right_total: isize

Running size of stream “…right”

scan_stack: VecDeque<usize>

Pseudo-stack, really a ring too. Holds the primary-ring-buffers index of the Begin that started the current block, possibly with the most recent Break after that Begin (if there is any) on top of it. Stuff is flushed off the bottom as it becomes irrelevant due to the primary ring-buffer advancing.

print_stack: Vec<PrintStackElem>

Stack of blocks-in-progress being flushed by print

pending_indentation: isize

Buffered indentation to avoid writing trailing whitespace

Implementations

Be very careful with this!

“raw box”

Inconsistent breaking box

Consistent breaking box

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

Performs the conversion.

Performs the conversion.

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.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 168 bytes