pub struct Formatter { /* private fields */ }Implementations§
source§impl Formatter
impl Formatter
pub fn new(ts: TokenStream) -> Self
pub fn finish(self) -> String
pub fn last_char(&self) -> Option<char>
pub fn flush_non_preceding_comments(&mut self, next: &impl Span)
pub fn indent(&self) -> usize
pub fn set_indent(&mut self, indent: usize)
pub fn column(&self) -> usize
pub fn has_newline_until(&self, next: &impl Span) -> bool
pub fn write_span(&mut self, span: &impl Span)
pub fn write_newlines(&mut self, n: usize)
pub fn write_newline(&mut self)
pub fn write_space(&mut self)
pub fn write_spaces(&mut self, n: usize)
pub fn write_subsequent_comments(&mut self)
pub fn set_next_comment_indent(&mut self, n: usize)
pub fn with_scoped_indent<F>(&mut self, f: F)where F: FnOnce(&mut Self),
pub fn with_single_line_mode<F>(&mut self, f: F)where F: FnOnce(&mut Self),
pub fn skip_formatting(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Formatter
impl Send for Formatter
impl Sync for Formatter
impl Unpin for Formatter
impl UnwindSafe for Formatter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more