Struct biome_formatter::Inspect
source · pub struct Inspect<'inner, Context, Inspector> { /* private fields */ }
Expand description
Buffer that allows you inspecting elements as they get written to the formatter.
Trait Implementations§
source§impl<'inner, Context, Inspector> Buffer for Inspect<'inner, Context, Inspector>where
Inspector: FnMut(&FormatElement),
impl<'inner, Context, Inspector> Buffer for Inspect<'inner, Context, Inspector>where
Inspector: FnMut(&FormatElement),
source§fn write_element(&mut self, element: FormatElement) -> FormatResult<()>
fn write_element(&mut self, element: FormatElement) -> FormatResult<()>
Writes a crate::FormatElement into this buffer, returning whether the write succeeded. Read more
source§fn state(&self) -> &FormatState<Self::Context>
fn state(&self) -> &FormatState<Self::Context>
Returns the formatting state relevant for this formatting session.
source§fn state_mut(&mut self) -> &mut FormatState<Self::Context>
fn state_mut(&mut self) -> &mut FormatState<Self::Context>
Returns the mutable formatting state relevant for this formatting session.
source§fn snapshot(&self) -> BufferSnapshot
fn snapshot(&self) -> BufferSnapshot
Takes a snapshot of the Buffers state, excluding the formatter state.
source§fn restore_snapshot(&mut self, snapshot: BufferSnapshot)
fn restore_snapshot(&mut self, snapshot: BufferSnapshot)
Restores the snapshot buffer Read more
Auto Trait Implementations§
impl<'inner, Context, Inspector> Freeze for Inspect<'inner, Context, Inspector>where
Inspector: Freeze,
impl<'inner, Context, Inspector> !RefUnwindSafe for Inspect<'inner, Context, Inspector>
impl<'inner, Context, Inspector> !Send for Inspect<'inner, Context, Inspector>
impl<'inner, Context, Inspector> !Sync for Inspect<'inner, Context, Inspector>
impl<'inner, Context, Inspector> Unpin for Inspect<'inner, Context, Inspector>where
Inspector: Unpin,
impl<'inner, Context, Inspector> !UnwindSafe for Inspect<'inner, Context, Inspector>
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
source§impl<T> BufferExtensions for Twhere
T: Buffer,
impl<T> BufferExtensions for Twhere
T: Buffer,
source§fn inspect<F>(&mut self, inspector: F) -> Inspect<'_, Self::Context, F>where
F: FnMut(&FormatElement),
fn inspect<F>(&mut self, inspector: F) -> Inspect<'_, Self::Context, F>where
F: FnMut(&FormatElement),
Returns a new buffer that calls the passed inspector for every element that gets written to the output
source§fn start_recording(&mut self) -> Recording<'_, Self>
fn start_recording(&mut self) -> Recording<'_, Self>
Starts a recording that gives you access to all elements that have been written between the start
and end of the recording Read more
source§fn write_elements<I>(&mut self, elements: I) -> FormatResult<()>where
I: IntoIterator<Item = FormatElement>,
fn write_elements<I>(&mut self, elements: I) -> FormatResult<()>where
I: IntoIterator<Item = FormatElement>,
Writes a sequence of elements into this buffer.