Trait sauron_core::Render

source ·
pub trait Render {
    // Required method
    fn render_with_indent(
        &self,
        buffer: &mut dyn Write,
        indent: usize,
        compressed: bool
    ) -> Result;

    // Provided methods
    fn render(&self, buffer: &mut dyn Write) -> Result { ... }
    fn render_compressed(&self, buffer: &mut dyn Write) -> Result { ... }
    fn render_to_string(&self) -> String { ... }
    fn render_to_string_pretty(&self) -> String { ... }
    fn maybe_indent(
        &self,
        buffer: &mut dyn Write,
        indent: usize,
        compressed: bool
    ) -> Result { ... }
}
Expand description

render node, elements to a writable buffer

Required Methods§

source

fn render_with_indent( &self, buffer: &mut dyn Write, indent: usize, compressed: bool ) -> Result

render instance to a writable buffer with indention

Provided Methods§

source

fn render(&self, buffer: &mut dyn Write) -> Result

render the node to a writable buffer

source

fn render_compressed(&self, buffer: &mut dyn Write) -> Result

no new_lines, no indents

source

fn render_to_string(&self) -> String

render compressed html to string

source

fn render_to_string_pretty(&self) -> String

render to string with nice indention

source

fn maybe_indent( &self, buffer: &mut dyn Write, indent: usize, compressed: bool ) -> Result

add an indent if applicable

Implementors§

source§

impl<MSG> Render for Leaf<MSG>

source§

impl<MSG> Render for Attribute<MSG>

source§

impl<MSG> Render for Element<MSG>

source§

impl<MSG> Render for Node<MSG>