pub struct PrettyPrinterState { /* private fields */ }Expand description
Mutable state threaded through a recursive pretty printer.
Implementations§
Source§impl PrettyPrinterState
impl PrettyPrinterState
Sourcepub fn new(max_width: usize, indent: IndentStyle) -> Self
pub fn new(max_width: usize, indent: IndentStyle) -> Self
Creates a new printer state.
Sourcepub fn push_indent(&mut self)
pub fn push_indent(&mut self)
Increases indentation depth.
Sourcepub fn pop_indent(&mut self)
pub fn pop_indent(&mut self)
Decreases indentation depth.
Sourcepub fn over_width(&self) -> bool
pub fn over_width(&self) -> bool
Returns true if the current line is past max_width.
Auto Trait Implementations§
impl Freeze for PrettyPrinterState
impl RefUnwindSafe for PrettyPrinterState
impl Send for PrettyPrinterState
impl Sync for PrettyPrinterState
impl Unpin for PrettyPrinterState
impl UnsafeUnpin for PrettyPrinterState
impl UnwindSafe for PrettyPrinterState
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