pub struct Formatter<'fmt> { /* private fields */ }Expand description
The Formatter is the biome_console equivalent to std::fmt::Formatter:
it’s never constructed directly by consumers, and can only be used through
the mutable reference passed to implementations of the Display trait).
It manages the state of the markup to print, and implementations of
Display can call into its methods to append content into the current
printing session
Implementations§
Source§impl<'fmt> Formatter<'fmt>
impl<'fmt> Formatter<'fmt>
Sourcepub fn new(writer: &'fmt mut dyn Write) -> Self
pub fn new(writer: &'fmt mut dyn Write) -> Self
Create a new instance of the Formatter using the provided writer for printing
pub fn wrap_writer<'b: 'c, 'c>( &'b mut self, wrap: impl FnOnce(&'b mut dyn Write) -> &'c mut dyn Write, ) -> Formatter<'c>
Sourcepub fn write_markup(&mut self, markup: Markup<'_>) -> Result<()>
pub fn write_markup(&mut self, markup: Markup<'_>) -> Result<()>
Write a piece of markup into this formatter
Auto Trait Implementations§
impl<'fmt> Freeze for Formatter<'fmt>
impl<'fmt> !RefUnwindSafe for Formatter<'fmt>
impl<'fmt> !Send for Formatter<'fmt>
impl<'fmt> !Sync for Formatter<'fmt>
impl<'fmt> Unpin for Formatter<'fmt>
impl<'fmt> !UnwindSafe for Formatter<'fmt>
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