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§
Sourcefn print_html_fragment(
&self,
out: &mut impl Write,
allocator: &HtmlAllocator,
) -> Result<()>
fn print_html_fragment( &self, out: &mut impl Write, allocator: &HtmlAllocator, ) -> Result<()>
Print serialized HTML.
Sourcefn print_plain(&self, out: &mut String, allocator: &HtmlAllocator) -> Result<()>
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§
fn to_html_fragment_string(&self, allocator: &HtmlAllocator) -> Result<String>
fn to_plain_string(&self, allocator: &HtmlAllocator) -> Result<String>
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.