Struct rsvg::handle::LoadOptions
source · pub struct LoadOptions {
pub url_resolver: UrlResolver,
pub unlimited_size: bool,
pub keep_image_data: bool,
}
Expand description
Loading options for SVG documents.
Fields§
§url_resolver: UrlResolver
Load url resolver; all references will be resolved with respect to this.
unlimited_size: bool
Whether to turn off size limits in libxml2.
keep_image_data: bool
Whether to keep original (undecoded) image data to embed in Cairo PDF surfaces.
Implementations§
source§impl LoadOptions
impl LoadOptions
sourcepub fn new(url_resolver: UrlResolver) -> Self
pub fn new(url_resolver: UrlResolver) -> Self
Creates a LoadOptions
with defaults, and sets the url resolver
.
sourcepub fn with_unlimited_size(self, unlimited: bool) -> Self
pub fn with_unlimited_size(self, unlimited: bool) -> Self
Sets whether libxml2’s limits on memory usage should be turned off.
This should only be done for trusted data.
sourcepub fn keep_image_data(self, keep: bool) -> Self
pub fn keep_image_data(self, keep: bool) -> Self
Sets whether to keep the original compressed image data from referenced JPEG/PNG images.
This is only useful for rendering to Cairo PDF surfaces, which can embed the original, compressed image data instead of uncompressed RGB buffers.
sourcepub fn copy_with_base_url(&self, base_url: &AllowedUrl) -> Self
pub fn copy_with_base_url(&self, base_url: &AllowedUrl) -> Self
Creates a new LoadOptions
with a different url resolver
.
This is used when loading a referenced file that may in turn cause other files
to be loaded, for example <image xlink:href="subimage.svg"/>
Auto Trait Implementations§
impl RefUnwindSafe for LoadOptions
impl Send for LoadOptions
impl Sync for LoadOptions
impl Unpin for LoadOptions
impl UnwindSafe for LoadOptions
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.