pub struct HtmlRenderer { /* private fields */ }Expand description
A stateless, streaming HTML renderer. Each render call decodes a self-contained snapshot batch into a transient map, walks it once, and streams HTML text out — zero state retained across calls. A pure function of the opcode stream (Renderer Statelessness).
Implementations§
Source§impl HtmlRenderer
impl HtmlRenderer
Sourcepub fn with_debug_comments(self, on: bool) -> Self
pub fn with_debug_comments(self, on: bool) -> Self
Enable/disable debug comments. When on, each rendered node is prefixed
with an HTML comment naming its component and the modifiers applied
(see [crate::debug]).
Sourcepub fn debug_comments(&self) -> bool
pub fn debug_comments(&self) -> bool
Whether debug comments are enabled.
Sourcepub fn render_document(
&self,
opcodes: &[Opcode],
strings: &[u8],
root: u32,
) -> String
pub fn render_document( &self, opcodes: &[Opcode], strings: &[u8], root: u32, ) -> String
Render the subtree rooted at root as a full HTML document.
Sourcepub fn render_fragment(
&self,
opcodes: &[Opcode],
strings: &[u8],
root: u32,
) -> String
pub fn render_fragment( &self, opcodes: &[Opcode], strings: &[u8], root: u32, ) -> String
Render the subtree rooted at root as an HTML fragment (no <html>).
SET_DESIGN_TOKEN overrides are applied to the document head by
render_document; a fragment is assumed to be embedded in a document
that already defines the token variables.
Trait Implementations§
Source§impl Clone for HtmlRenderer
impl Clone for HtmlRenderer
impl Copy for HtmlRenderer
Auto Trait Implementations§
impl Freeze for HtmlRenderer
impl RefUnwindSafe for HtmlRenderer
impl Send for HtmlRenderer
impl Sync for HtmlRenderer
impl Unpin for HtmlRenderer
impl UnsafeUnpin for HtmlRenderer
impl UnwindSafe for HtmlRenderer
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