pub struct SvgHandle { /* private fields */ }Expand description
Handle used to hold SVG data in memory.
You can create this from one of the read methods in
Loader.
Implementations§
source§impl SvgHandle
impl SvgHandle
sourcepub fn has_element_with_id(&self, id: &str) -> Result<bool, RenderingError>
pub fn has_element_with_id(&self, id: &str) -> Result<bool, RenderingError>
Checks if the SVG has an element with the specified id.
Note that the id must be a plain fragment identifier like #foo, with
a leading # character.
The purpose of the Err() case in the return value is to indicate an
incorrectly-formatted id argument.
sourcepub fn set_stylesheet(&mut self, css: &str) -> Result<(), LoadingError>
pub fn set_stylesheet(&mut self, css: &str) -> Result<(), LoadingError>
Sets a CSS stylesheet to use for an SVG document.
During the CSS cascade, the specified stylesheet will be used with a “User” origin.
Note that @import rules will not be resolved, except for data: URLs.
Auto Trait Implementations§
impl !Freeze for SvgHandle
impl !RefUnwindSafe for SvgHandle
impl !Send for SvgHandle
impl !Sync for SvgHandle
impl Unpin for SvgHandle
impl !UnwindSafe for SvgHandle
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
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§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.