pub enum Paint<'a> {
None,
Inherit,
CurrentColor,
Color(Color),
FuncIRI(&'a str, Option<PaintFallback>),
}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.
Implementations
Trait Implementations
impl<'a> Copy for Paint<'a>
impl<'a> StructuralPartialEq for Paint<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more