Struct svgolib::SvgOptimizer
source · pub struct SvgOptimizer {
pub optimizer: Optimizer,
pub svg: Svg,
}
Fields§
§optimizer: Optimizer
§svg: Svg
Implementations§
source§impl SvgOptimizer
impl SvgOptimizer
pub fn new(svg: Svg, optimizer: Optimizer) -> Self
sourcepub fn open(buf: File) -> Result<Self>
pub fn open(buf: File) -> Result<Self>
Opens a SVG file from a File
and creates an instance of SvgOptimizer
with it if valid.
sourcepub fn write<W: Write>(&self, write: W) -> Result<()>
pub fn write<W: Write>(&self, write: W) -> Result<()>
Writes the underlying Svg
to a std::io::Write
instance.
sourcepub fn add_optimization(&mut self, optim: Optimization)
pub fn add_optimization(&mut self, optim: Optimization)
Appends an Optimization
to be performed on the SVG when
the [optimize
] method is called.
Auto Trait Implementations§
impl Freeze for SvgOptimizer
impl RefUnwindSafe for SvgOptimizer
impl Send for SvgOptimizer
impl Sync for SvgOptimizer
impl Unpin for SvgOptimizer
impl UnwindSafe for SvgOptimizer
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