pub struct Html;Available on crate feature
html only.Expand description
Formatter implementation for highlighting into HTML with class names.
Note: you will need to wrap the output in a <pre> tag for correct whitespacing.
This formatter implementation deliberately avoids emitting the tag in order to keep its output as generic as possible.
Trait Implementations§
Source§impl Formatter for Html
impl Formatter for Html
Source§fn write<W>(
&self,
source: &str,
writer: &mut W,
event: HighlightEvent,
) -> Result<()>where
W: Write,
fn write<W>(
&self,
source: &str,
writer: &mut W,
event: HighlightEvent,
) -> Result<()>where
W: Write,
Source§fn write_io<W>(
&self,
source: &str,
writer: &mut W,
event: HighlightEvent,
) -> Result<()>where
W: Write,
fn write_io<W>(
&self,
source: &str,
writer: &mut W,
event: HighlightEvent,
) -> Result<()>where
W: Write,
Source§fn start<W>(&self, source: &str, writer: &mut W) -> Result<()>where
W: Write,
fn start<W>(&self, source: &str, writer: &mut W) -> Result<()>where
W: Write,
Optional method for one-off initial formatter operations (
std::fmt::Write version.)
The default implementation is a no-op. Read moreSource§fn finish<W>(&self, source: &str, writer: &mut W) -> Result<()>where
W: Write,
fn finish<W>(&self, source: &str, writer: &mut W) -> Result<()>where
W: Write,
Optional method for one-off final formatter operations (
std::fmt::Write version.)
The default implementation is a no-op. Read moreAuto Trait Implementations§
impl Freeze for Html
impl RefUnwindSafe for Html
impl Send for Html
impl Sync for Html
impl Unpin for Html
impl UnwindSafe for Html
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