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: isizeWidth of lines we’re constrained to
space: isizeNumber of spaces left on line
left: usizeIndex of left side of input stream
right: usizeIndex of right side of input stream
buf: Vec<BufEntry>Ring-buffer of tokens and calculated sizes
left_total: isizeRunning size of stream “…left”
right_total: isizeRunning 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: isizeBuffered indentation to avoid writing trailing whitespace
Implementations
Be very careful with this!
Auto Trait Implementations
impl RefUnwindSafe for Printer
impl UnwindSafe for Printer
Blanket Implementations
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