[−][src]Enum svgtypes::Paint
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.
Methods
impl<'a> Paint<'a>
[src]
pub fn from_str(text: &'a str) -> Result<Self, Error>
[src]
Parsers a Paint
from a StrSpan
.
We can't use the FromStr
trait because it requires
an owned value as a return type.
Trait Implementations
impl<'a> Clone for Paint<'a>
[src]
fn clone(&self) -> Paint<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> PartialEq<Paint<'a>> for Paint<'a>
[src]
impl<'a> Copy for Paint<'a>
[src]
impl<'a> Debug for Paint<'a>
[src]
Auto Trait Implementations
impl<'a> Sync for Paint<'a>
impl<'a> Send for Paint<'a>
impl<'a> Unpin for Paint<'a>
impl<'a> RefUnwindSafe for Paint<'a>
impl<'a> UnwindSafe for Paint<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,