pub struct Formatter<'a> { /* private fields */ }
Expand description
Configures how a scope is formatted.
Implementations§
Source§impl<'a> Formatter<'a>
impl<'a> Formatter<'a>
Sourcepub fn new(dst: &'a mut String) -> Self
pub fn new(dst: &'a mut String) -> Self
Return a new formatter that writes to the given string.
Sourcepub fn indent<F, R>(&mut self, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
pub fn indent<F, R>(&mut self, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
Call the given function with the indentation level incremented by one.
Sourcepub fn is_start_of_line(&self) -> bool
pub fn is_start_of_line(&self) -> bool
Check if current destination is the start of a new line.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Formatter<'a>
impl<'a> RefUnwindSafe for Formatter<'a>
impl<'a> Send for Formatter<'a>
impl<'a> Sync for Formatter<'a>
impl<'a> Unpin for Formatter<'a>
impl<'a> !UnwindSafe for Formatter<'a>
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