pub enum Paint<'a> {
None,
Inherit,
CurrentColor,
Color(Color),
FuncIRI(&'a str, Option<PaintFallback>),
ContextFill,
ContextStroke,
}
Expand description
Representation of the <paint>
type.
Doesn’t own the data. Use only for parsing.
<icccolor>
isn’t supported.
§Examples
use svgtypes::{Paint, PaintFallback, Color};
let paint = Paint::from_str("url(#gradient) red").unwrap();
assert_eq!(paint, Paint::FuncIRI("gradient",
Some(PaintFallback::Color(Color::red()))));
let paint = Paint::from_str("inherit").unwrap();
assert_eq!(paint, Paint::Inherit);
Variants§
None
The none
value.
Inherit
The inherit
value.
CurrentColor
The currentColor
value.
Color(Color)
<color>
value.
FuncIRI(&'a str, Option<PaintFallback>)
<FuncIRI>
value with an optional fallback.
ContextFill
The context-fill
value.
ContextStroke
The context-stroke
value.
Implementations§
Trait Implementations§
impl<'a> Copy for Paint<'a>
impl<'a> Eq for Paint<'a>
impl<'a> StructuralPartialEq for Paint<'a>
Auto Trait Implementations§
impl<'a> Freeze for Paint<'a>
impl<'a> RefUnwindSafe for Paint<'a>
impl<'a> Send for Paint<'a>
impl<'a> Sync for Paint<'a>
impl<'a> Unpin for Paint<'a>
impl<'a> UnwindSafe for Paint<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)