Trait html5ever_ext::Minify
[−]
[src]
pub trait Minify { fn minify_to_file_path<P: AsRef<Path>>(
&self,
html_head_and_body_tags_are_optional: bool,
html_file_path: P
) -> Result<(), HtmlError>; fn minify_to_bytes(
&self,
html_head_and_body_tags_are_optional: bool
) -> Result<Vec<u8>>; fn minify_to_writer<W: Write>(
&self,
html_head_and_body_tags_are_optional: bool,
writer: W
) -> Result<()>; }
Minifies and serializes a html5ever HTML DOM (RcDom) or node (Rc
Required Methods
fn minify_to_file_path<P: AsRef<Path>>(
&self,
html_head_and_body_tags_are_optional: bool,
html_file_path: P
) -> Result<(), HtmlError>
&self,
html_head_and_body_tags_are_optional: bool,
html_file_path: P
) -> Result<(), HtmlError>
Minifies and serializes an instance of an HTML DOM to file.
If creating AMP pages, set html_head_and_body_tags_are_optional
to false.
Wraps use of UltraMinifyingHtmlSerializer
.
If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly.
fn minify_to_bytes(
&self,
html_head_and_body_tags_are_optional: bool
) -> Result<Vec<u8>>
&self,
html_head_and_body_tags_are_optional: bool
) -> Result<Vec<u8>>
Minifies and serializes an instance of an HTML DOM to a vector of bytes.
If creating AMP pages, set html_head_and_body_tags_are_optional
to false.
Wraps use of UltraMinifyingHtmlSerializer
.
If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly.
fn minify_to_writer<W: Write>(
&self,
html_head_and_body_tags_are_optional: bool,
writer: W
) -> Result<()>
&self,
html_head_and_body_tags_are_optional: bool,
writer: W
) -> Result<()>
Minifies and serializes an instance of an HTML DOM to a writer.
If creating AMP pages, set html_head_and_body_tags_are_optional
to false.
Wraps use of UltraMinifyingHtmlSerializer
.
If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly.
Implementations on Foreign Types
impl Minify for Rc<Node>
[src]
fn minify_to_file_path<P: AsRef<Path>>(
&self,
html_head_and_body_tags_are_optional: bool,
html_file_path: P
) -> Result<(), HtmlError>
[src]
&self,
html_head_and_body_tags_are_optional: bool,
html_file_path: P
) -> Result<(), HtmlError>
fn minify_to_bytes(
&self,
html_head_and_body_tags_are_optional: bool
) -> Result<Vec<u8>>
[src]
&self,
html_head_and_body_tags_are_optional: bool
) -> Result<Vec<u8>>
fn minify_to_writer<W: Write>(
&self,
html_head_and_body_tags_are_optional: bool,
writer: W
) -> Result<()>
[src]
&self,
html_head_and_body_tags_are_optional: bool,
writer: W
) -> Result<()>
Implementors
impl Minify for RcDom