[−][src]Struct rustc_ast_pretty::pp::Printer
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
impl Printer[src]
pub fn word_space<W: Into<Cow<'static, str>>>(&mut self, w: W)[src]
pub fn popen(&mut self)[src]
pub fn pclose(&mut self)[src]
pub fn hardbreak_if_not_bol(&mut self)[src]
pub fn space_if_not_bol(&mut self)[src]
pub fn nbsp(&mut self)[src]
pub fn word_nbsp<S: Into<Cow<'static, str>>>(&mut self, w: S)[src]
impl Printer[src]
pub fn last_token(&self) -> Token[src]
pub fn replace_last_token(&mut self, t: Token)[src]
Be very careful with this!
pub(in pp) fn scan_eof(
&mut self
)[src]
&mut self
)
pub(in pp) fn scan_begin(
&mut self,
b: BeginToken
)[src]
&mut self,
b: BeginToken
)
pub(in pp) fn scan_end(
&mut self
)[src]
&mut self
)
pub(in pp) fn scan_break(
&mut self,
b: BreakToken
)[src]
&mut self,
b: BreakToken
)
pub(in pp) fn scan_string(
&mut self,
s: Cow<'static, str>
)[src]
&mut self,
s: Cow<'static, str>
)
pub(in pp) fn check_stream(
&mut self
)[src]
&mut self
)
pub(in pp) fn scan_push(
&mut self,
entry: BufEntry
)[src]
&mut self,
entry: BufEntry
)
pub(in pp) fn scan_pop(
&mut self
) -> usize[src]
&mut self
) -> usize
pub(in pp) fn scan_top(
&self
) -> usize[src]
&self
) -> usize
pub(in pp) fn scan_pop_bottom(
&mut self
) -> usize[src]
&mut self
) -> usize
pub(in pp) fn advance_right(
&mut self
)[src]
&mut self
)
pub(in pp) fn advance_left(
&mut self
)[src]
&mut self
)
pub(in pp) fn check_stack(
&mut self,
k: usize
)[src]
&mut self,
k: usize
)
pub(in pp) fn print_newline(
&mut self,
amount: isize
)[src]
&mut self,
amount: isize
)
pub(in pp) fn indent(
&mut self,
amount: isize
)[src]
&mut self,
amount: isize
)
pub(in pp) fn get_top(
&self
) -> PrintStackElem[src]
&self
) -> PrintStackElem
pub(in pp) fn print_begin(
&mut self,
b: BeginToken,
l: isize
)[src]
&mut self,
b: BeginToken,
l: isize
)
pub(in pp) fn print_end(
&mut self
)[src]
&mut self
)
pub(in pp) fn print_break(
&mut self,
b: BreakToken,
l: isize
)[src]
&mut self,
b: BreakToken,
l: isize
)
pub(in pp) fn print_string(
&mut self,
s: Cow<'static, str>
)[src]
&mut self,
s: Cow<'static, str>
)
pub(in pp) fn print(
&mut self,
token: Token,
l: isize
)[src]
&mut self,
token: Token,
l: isize
)
pub fn rbox(&mut self, indent: usize, b: Breaks)[src]
"raw box"
pub fn ibox(&mut self, indent: usize)[src]
Inconsistent breaking box
pub fn cbox(&mut self, indent: usize)[src]
Consistent breaking box
pub fn break_offset(&mut self, n: usize, off: isize)[src]
pub fn end(&mut self)[src]
pub fn eof(self) -> String[src]
pub fn word<S: Into<Cow<'static, str>>>(&mut self, wrd: S)[src]
pub(in pp) fn spaces(
&mut self,
n: usize
)[src]
&mut self,
n: usize
)
pub(crate) fn zerobreak(&mut self)[src]
pub fn space(&mut self)[src]
pub fn hardbreak(&mut self)[src]
pub fn is_beginning_of_line(&self) -> bool[src]
pub fn hardbreak_tok_offset(off: isize) -> Token[src]
Auto Trait Implementations
impl RefUnwindSafe for Printer
impl Send for Printer
impl Sync for Printer
impl Unpin for Printer
impl UnwindSafe for Printer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,