Print

Trait Print 

Source
pub trait Print {
    // Required methods
    fn print_html_fragment(
        &self,
        out: &mut impl Write,
        allocator: &HtmlAllocator,
    ) -> Result<()>;
    fn print_plain(
        &self,
        out: &mut String,
        allocator: &HtmlAllocator,
    ) -> Result<()>;

    // Provided methods
    fn to_html_fragment_string(
        &self,
        allocator: &HtmlAllocator,
    ) -> Result<String> { ... }
    fn to_plain_string(&self, allocator: &HtmlAllocator) -> Result<String> { ... }
}

Required Methods§

Source

fn print_html_fragment( &self, out: &mut impl Write, allocator: &HtmlAllocator, ) -> Result<()>

Print serialized HTML.

Source

fn print_plain(&self, out: &mut String, allocator: &HtmlAllocator) -> Result<()>

Print plain text, completely ignoring HTML markup. Can currently only give an error if encountering preserialized HTML.

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Print for (KString, KString)

Source§

fn print_html_fragment( &self, out: &mut impl Write, allocator: &HtmlAllocator, ) -> Result<()>

Source§

fn print_plain( &self, _out: &mut String, _allocator: &HtmlAllocator, ) -> Result<()>

Implementors§