pub struct VectorIcon {
pub view_box: f64,
pub paths: Vec<IconPath>,
}Expand description
A resolution-independent icon: a square view_box and the filled
paths inside it, back to front.
Fields§
§view_box: f64Side length of the (square) authoring box, e.g. 64.0 for a
viewBox="0 0 64 64" SVG.
paths: Vec<IconPath>Implementations§
Source§impl VectorIcon
impl VectorIcon
Sourcepub fn with_svg_path(
self,
d: &str,
fill: IconColor,
fill_rule: FillRule,
) -> Result<Self, IconPathError>
pub fn with_svg_path( self, d: &str, fill: IconColor, fill_rule: FillRule, ) -> Result<Self, IconPathError>
Append a filled path parsed from SVG path data (M, L, H,
V, C, A, Z, absolute or relative).
Returns the parse error rather than dropping the path: an icon that silently lost a contour would render as subtly wrong art with nothing to point at.
Sourcepub fn with_svg_path_nonzero(
self,
d: &str,
fill: IconColor,
) -> Result<Self, IconPathError>
pub fn with_svg_path_nonzero( self, d: &str, fill: IconColor, ) -> Result<Self, IconPathError>
with_svg_path with the default non-zero fill rule.
Sourcepub fn point_count(&self) -> usize
pub fn point_count(&self) -> usize
Total number of points across every contour — a cheap “is there any art here?” probe for tests and diagnostics.
Trait Implementations§
Source§impl Clone for VectorIcon
impl Clone for VectorIcon
Source§impl Debug for VectorIcon
impl Debug for VectorIcon
Source§impl Default for VectorIcon
impl Default for VectorIcon
Source§impl PartialEq for VectorIcon
impl PartialEq for VectorIcon
impl StructuralPartialEq for VectorIcon
Auto Trait Implementations§
impl Freeze for VectorIcon
impl RefUnwindSafe for VectorIcon
impl Send for VectorIcon
impl Sync for VectorIcon
impl Unpin for VectorIcon
impl UnsafeUnpin for VectorIcon
impl UnwindSafe for VectorIcon
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().