Struct html_minifier::HTMLMinifier
source · pub struct HTMLMinifier { /* private fields */ }
Expand description
This struct helps you generate and minify your HTML code in the same time. The output destination is inside this struct.
Implementations§
source§impl HTMLMinifier
impl HTMLMinifier
source§impl HTMLMinifier
impl HTMLMinifier
sourcepub fn set_remove_comments(&mut self, remove_comments: bool)
pub fn set_remove_comments(&mut self, remove_comments: bool)
Set whether to remove HTML comments.
sourcepub fn set_minify_code(&mut self, minify_code: bool)
pub fn set_minify_code(&mut self, minify_code: bool)
Set whether to minify the content in the code
element.
sourcepub const fn get_remove_comments(&self) -> bool
pub const fn get_remove_comments(&self) -> bool
Get whether to remove HTML comments.
sourcepub const fn get_minify_code(&self) -> bool
pub const fn get_minify_code(&self) -> bool
Get whether to minify the content in the code
element.
source§impl HTMLMinifier
impl HTMLMinifier
source§impl HTMLMinifier
impl HTMLMinifier
sourcepub fn digest<S: AsRef<[u8]>>(
&mut self,
text: S
) -> Result<(), HTMLMinifierError>
pub fn digest<S: AsRef<[u8]>>( &mut self, text: S ) -> Result<(), HTMLMinifierError>
Input some text to generate HTML code. It is not necessary to input a full HTML text at once.
sourcepub unsafe fn indigest<S: AsRef<[u8]>>(&mut self, text: S)
pub unsafe fn indigest<S: AsRef<[u8]>>(&mut self, text: S)
Directly input some text to generate HTML code. The text will just be appended to the output buffer instead of being through the helper.
When to Use This?
If the text has been minified, you can consider to use this method to get a better performance.
Trait Implementations§
source§impl Clone for HTMLMinifier
impl Clone for HTMLMinifier
source§fn clone(&self) -> HTMLMinifier
fn clone(&self) -> HTMLMinifier
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HTMLMinifier
impl Debug for HTMLMinifier
Auto Trait Implementations§
impl RefUnwindSafe for HTMLMinifier
impl Send for HTMLMinifier
impl Sync for HTMLMinifier
impl Unpin for HTMLMinifier
impl UnwindSafe for HTMLMinifier
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