Skip to main content

EventHtmlRenderer

Struct EventHtmlRenderer 

Source
pub struct EventHtmlRenderer<'a, W> { /* private fields */ }
Expand description

Render semantic events directly into a caller-owned writer.

Parser output and crate::Document::events use exactly this renderer. The renderer retains nesting state and footnote bodies, never the full event stream.

Implementations§

Source§

impl<'a, W: Write> EventHtmlRenderer<'a, W>

Source

pub fn new( source: &'a str, options: &'a CompileOptions, output: &'a mut W, ) -> Self

Construct a renderer writing directly into output.

Source

pub fn render<'e>( &mut self, events: impl IntoIterator<Item = Result<Event<'e>, StreamError>>, ) -> Result<(), StreamError>

Pull an entire event source into the output writer.

§Errors

Propagates parse, source-range, malformed-stream, and output errors.

Source

pub fn event(&mut self, event: Event<'_>) -> Result<(), StreamError>

Consume one event without retaining it.

§Errors

Propagates invalid source ranges, malformed streams, and writer errors.

Auto Trait Implementations§

§

impl<'a, W> !UnwindSafe for EventHtmlRenderer<'a, W>

§

impl<'a, W> Freeze for EventHtmlRenderer<'a, W>

§

impl<'a, W> RefUnwindSafe for EventHtmlRenderer<'a, W>

§

impl<'a, W> Send for EventHtmlRenderer<'a, W>
where &'a mut W: Send,

§

impl<'a, W> Sync for EventHtmlRenderer<'a, W>
where &'a mut W: Sync,

§

impl<'a, W> Unpin for EventHtmlRenderer<'a, W>

§

impl<'a, W> UnsafeUnpin for EventHtmlRenderer<'a, W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.