pub struct HtmlRenderer<'data, 'options, F> { /* private fields */ }
Expand description
Object capable of rendering events to HTML.
Implementations§
Source§impl<'data, 'options, F: Write> HtmlRenderer<'data, 'options, F>
impl<'data, 'options, F: Write> HtmlRenderer<'data, 'options, F>
Sourcepub fn new(
out: F,
options: &'options HtmlRendererOptions,
) -> HtmlRenderer<'data, 'options, F>
pub fn new( out: F, options: &'options HtmlRendererOptions, ) -> HtmlRenderer<'data, 'options, F>
Creates a new renderer that writes into a writer.
Sourcepub fn into_writer(self) -> F
pub fn into_writer(self) -> F
Consumes the writer and returns the inner file.
Sourcepub fn feed_event(&mut self, event: &AnnotatedEvent<'data>) -> Result<(), Error>
pub fn feed_event(&mut self, event: &AnnotatedEvent<'data>) -> Result<(), Error>
Feeds a single event into the renderer.
Sourcepub fn feed_stream<I>(&mut self, iter: I) -> Result<(), Error>where
I: Iterator<Item = AnnotatedEvent<'data>>,
pub fn feed_stream<I>(&mut self, iter: I) -> Result<(), Error>where
I: Iterator<Item = AnnotatedEvent<'data>>,
Feeds an event stream into the renderer.
In this case the iterator is consumed. Alternatively you can/have
to use feed_event
directly which lets you pass events by
reference instead.
Source§impl<'data, 'options> HtmlRenderer<'data, 'options, Vec<u8>>
impl<'data, 'options> HtmlRenderer<'data, 'options, Vec<u8>>
Sourcepub fn new_buffered(options: &'options HtmlRendererOptions) -> Self
pub fn new_buffered(options: &'options HtmlRendererOptions) -> Self
Creates a new html renderer writing into a buffer.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Converts the renderer into a string.
Auto Trait Implementations§
impl<'data, 'options, F> Freeze for HtmlRenderer<'data, 'options, F>where
F: Freeze,
impl<'data, 'options, F> RefUnwindSafe for HtmlRenderer<'data, 'options, F>where
F: RefUnwindSafe,
impl<'data, 'options, F> Send for HtmlRenderer<'data, 'options, F>where
F: Send,
impl<'data, 'options, F> Sync for HtmlRenderer<'data, 'options, F>where
F: Sync,
impl<'data, 'options, F> Unpin for HtmlRenderer<'data, 'options, F>where
F: Unpin,
impl<'data, 'options, F> UnwindSafe for HtmlRenderer<'data, 'options, F>where
F: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more