pub struct EpubOptimizer;Expand description
EPUB 3 Lossless Optimizer and Minifier engine.
Implementations§
Source§impl EpubOptimizer
impl EpubOptimizer
Sourcepub fn optimize(
book: &mut Book,
options: &EpubOptimizerOptions,
) -> OptimizationReport
pub fn optimize( book: &mut Book, options: &EpubOptimizerOptions, ) -> OptimizationReport
Optimize a loaded Book instance in-place with the specified options.
Sourcepub fn minify_html(html: &str) -> String
pub fn minify_html(html: &str) -> String
Minify HTML content by removing HTML comments and collapsing redundant whitespace.
Sourcepub fn minify_css(css: &str) -> String
pub fn minify_css(css: &str) -> String
Minify CSS style sheets by removing CSS comments and collapsing whitespace.
Sourcepub fn purge_css(
css: &str,
used_classes: &AHashSet<String>,
used_ids: &AHashSet<String>,
used_tags: &AHashSet<String>,
) -> (String, usize)
pub fn purge_css( css: &str, used_classes: &AHashSet<String>, used_ids: &AHashSet<String>, used_tags: &AHashSet<String>, ) -> (String, usize)
Purge unreferenced CSS rules based on observed classes, IDs, and HTML tags.
Sourcepub fn deduplicate_assets(
archive: &mut EpubArchive,
sections: &mut [Section],
) -> usize
pub fn deduplicate_assets( archive: &mut EpubArchive, sections: &mut [Section], ) -> usize
Deduplicate identical images and fonts across the EPUB archive.
Auto Trait Implementations§
impl Freeze for EpubOptimizer
impl RefUnwindSafe for EpubOptimizer
impl Send for EpubOptimizer
impl Sync for EpubOptimizer
impl Unpin for EpubOptimizer
impl UnsafeUnpin for EpubOptimizer
impl UnwindSafe for EpubOptimizer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more