Trait svgbob::Render

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

    // Provided methods
    fn render(&self, buffer: &mut dyn Write) -> Result<(), Error> { ... }
    fn render_compressed(&self, buffer: &mut dyn Write) -> Result<(), Error> { ... }
    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<(), Error> { ... }
}
Expand description

render node, elements to a writable buffer

Required Methods§

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

render instance to a writable buffer with indention

Provided Methods§

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

render the node to a writable buffer

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

no new_lines, no indents

fn render_to_string(&self) -> String

render compressed html to string

fn render_to_string_pretty(&self) -> String

render to string with nice indention

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

add an indent if applicable

Implementations on Foreign Types§

§

impl<MSG> Render for Node<&'static str, &'static str, Leaf, &'static str, AttributeValue<MSG>>

§

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

§

impl<MSG> Render for Attribute<&'static str, &'static str, AttributeValue<MSG>>

§

fn render_with_indent( &self, buffer: &mut dyn Write, _indent: usize, _compressed: bool ) -> Result<(), Error>

§

impl<MSG> Render for Element<&'static str, &'static str, Leaf, &'static str, AttributeValue<MSG>>

§

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

Implementors§

§

impl Render for Leaf