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: isizeExpand description
Width of lines we’re constrained to
space: isizeExpand description
Number of spaces left on line
left: usizeExpand description
Index of left side of input stream
right: usizeExpand description
Index of right side of input stream
buf: Vec<BufEntry>Expand description
Ring-buffer of tokens and calculated sizes
left_total: isizeExpand description
Running size of stream “…left”
right_total: isizeExpand description
Running size of stream “…right”
scan_stack: VecDeque<usize>Expand description
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>Expand description
Stack of blocks-in-progress being flushed by print
pending_indentation: isizeExpand description
Buffered indentation to avoid writing trailing whitespace
Implementations
impl Printer[src]
impl Printer[src]impl Printer[src]
impl Printer[src]pub fn last_token(&self) -> Token[src]
pub fn replace_last_token(&mut self, t: Token)[src]
pub fn replace_last_token(&mut self, t: Token)[src]Be very careful with this!