pub struct HtmlEmitter { /* private fields */ }Expand description
Emits static HTML by reacting to walker enter/leave events. Container
nodes split into open_tag / close_tag halves; leaves write their
markup once on enter. Tables are rendered up-front in enter Table
(rows + cells aren’t Node variants the walker can surface) and
in_table_depth suppresses subsequent walker events on cell content.
Owns its own DiagnosticEngine during the walk; merge into the
caller’s engine via into_parts after the walk completes.
Implementations§
Source§impl HtmlEmitter
impl HtmlEmitter
pub fn new() -> Self
pub fn new_with_options(options: RenderOptions) -> Self
pub fn into_string(self) -> String
Sourcepub fn into_parts(self) -> (String, DiagnosticEngine<Code>)
pub fn into_parts(self) -> (String, DiagnosticEngine<Code>)
Take both buffers: the rendered HTML and the per-emitter diagnostic
engine. Caller merges the diags into a shared engine via
outer.extend(diag).
Sourcepub fn render(doc: &Document) -> (String, DiagnosticEngine<Code>)
pub fn render(doc: &Document) -> (String, DiagnosticEngine<Code>)
Drive the walker; return (html, diag). Use when no other sink
shares the walk.
pub fn render_with( doc: &Document, options: RenderOptions, ) -> (String, DiagnosticEngine<Code>)
Trait Implementations§
Source§impl Default for HtmlEmitter
impl Default for HtmlEmitter
Auto Trait Implementations§
impl Freeze for HtmlEmitter
impl RefUnwindSafe for HtmlEmitter
impl Send for HtmlEmitter
impl Sync for HtmlEmitter
impl Unpin for HtmlEmitter
impl UnsafeUnpin for HtmlEmitter
impl UnwindSafe for HtmlEmitter
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