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
sourceimpl HTMLMinifier
impl HTMLMinifier
sourceimpl 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 fn get_remove_comments(&self) -> bool
pub fn get_remove_comments(&self) -> bool
Get whether to remove HTML comments.
sourcepub fn get_minify_code(&self) -> bool
pub fn get_minify_code(&self) -> bool
Get whether to minify the content in the code
element.
sourceimpl HTMLMinifier
impl HTMLMinifier
sourceimpl 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
sourceimpl Clone for HTMLMinifier
impl Clone for HTMLMinifier
sourcefn clone(&self) -> HTMLMinifier
fn clone(&self) -> HTMLMinifier
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more