pub struct Printer {
    out: String,
    space: isize,
    buf: RingBuffer<BufEntry>,
    left_total: isize,
    right_total: isize,
    scan_stack: VecDeque<usize>,
    print_stack: Vec<PrintFrame>,
    indent: usize,
    pending_indentation: isize,
    last_printed: Option<Token>,
}

Fields

out: Stringspace: isize

Number of spaces left on line

buf: RingBuffer<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<PrintFrame>

Stack of blocks-in-progress being flushed by print

indent: usize

Level of indentation of current line

pending_indentation: isize

Buffered indentation to avoid writing trailing whitespace

last_printed: Option<Token>

The token most recently popped from the left boundary of the ring-buffer for printing

Implementations

“raw box”

Inconsistent breaking box

Consistent breaking box

Be very careful with this!

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.

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: 192 bytes