pub struct HTMLMinifierHelper {
pub remove_comments: bool,
pub minify_code: bool,
pub minify_js: bool,
pub minify_css: bool,
/* private fields */
}Expand description
This struct helps you generate and minify your HTML code in the same time. The output destination is outside this struct.
Fields§
§remove_comments: boolRemove HTML comments, keeping empty comments where text could form a character reference or a tag.
minify_code: boolMinify the content in the code element.
minify_js: boolMinify JavaScript in supported script elements.
minify_css: boolMinify CSS in supported style elements.
Implementations§
Source§impl HTMLMinifierHelper
impl HTMLMinifierHelper
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset this HTML minifier helper while keeping its options and allocated memory.
Sourcepub fn finish<W: HTMLWriter>(
&mut self,
out: &mut W,
) -> Result<(), HTMLMinifierError>
pub fn finish<W: HTMLWriter>( &mut self, out: &mut W, ) -> Result<(), HTMLMinifierError>
Finish the current input and report any incomplete tag or special element. An error can leave partial output in the writer.
Sourcepub fn digest<S: AsRef<[u8]>, W: HTMLWriter>(
&mut self,
text: S,
out: &mut W,
) -> Result<(), HTMLMinifierError>
pub fn digest<S: AsRef<[u8]>, W: HTMLWriter>( &mut self, text: S, out: &mut W, ) -> Result<(), HTMLMinifierError>
Input some text to generate HTML code. It is not necessary to input a full HTML text at once.
Trait Implementations§
Source§impl Clone for HTMLMinifierHelper
impl Clone for HTMLMinifierHelper
Source§impl Debug for HTMLMinifierHelper
impl Debug for HTMLMinifierHelper
Auto Trait Implementations§
impl Freeze for HTMLMinifierHelper
impl RefUnwindSafe for HTMLMinifierHelper
impl Send for HTMLMinifierHelper
impl Sync for HTMLMinifierHelper
impl Unpin for HTMLMinifierHelper
impl UnsafeUnpin for HTMLMinifierHelper
impl UnwindSafe for HTMLMinifierHelper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more