[][src]Enum wasm_svg_graphics::prelude::AttrValue

pub enum AttrValue {
    ViewBox(ViewBoxProps),
    Identifier(IdentifierProps),
    Color(Color),
    TColor(TColor),
    Integer(i32),
    Float(f64),
    Reference(IdentifierProps),
    PathDefinitionValue(PathDefinitionString),
}

A value an Element Attribute may have

Variants

ViewBox(ViewBoxProps)
Identifier(IdentifierProps)
Color(Color)
TColor(TColor)
Integer(i32)
Float(f64)

NOTE

Will be rounded to two decimal points

Reference(IdentifierProps)
PathDefinitionValue(PathDefinitionString)

Methods

impl AttributeValue[src]

pub fn new_viewbox(x: i32, y: i32, width: i32, height: i32) -> AttributeValue[src]

Create new AttributeValue::ViewBox

Note

For a shorthand look at: From<(i32, i32, i32, i32)>

pub fn new_id(id: &str) -> Result<AttributeValue, usize>[src]

Create new AttributeValue::Identifier

Note

Will return error if not allowed characters are used

pub fn new_color(red: u8, green: u8, blue: u8) -> AttributeValue[src]

Create new AttributeValue::Color

Note

For a shorthand look at: From<(Color)>

pub fn new_integer(number: i32) -> AttributeValue[src]

Create new AttributeValue::Integer

Note

For a shorthand look at: From

pub fn new_float(number: f64) -> AttributeValue[src]

Create new AttributeValue::Float

Note

For a shorthand look at: From

pub fn new_reference(reference_id: &str) -> Result<AttributeValue, usize>[src]

Create new AttributeValue::Reference

Note

Will return error if not allowed characters are used

pub fn new_path_definition(path_string: PathDefinitionString) -> AttributeValue[src]

Create a new AttributeValue::PathDefinitionValue

Trait Implementations

impl Clone for AttributeValue[src]

impl Debug for AttributeValue[src]

impl From<(i32, i32, i32, i32)> for AttributeValue[src]

Shorthand to create [AttributeValue::ViewBox]

impl From<Color> for AttributeValue[src]

Shorthand to create [AttributeValue::Color]

impl From<PathDefinitionString> for AttributeValue[src]

Shorthand to create [AttributeValue::PathDefinitionValue]

impl From<TColor> for AttributeValue[src]

Shorthand to create [AttributeValue::TColor]

impl From<f64> for AttributeValue[src]

Shorthand to create [AttributeValue::Float]

impl From<i32> for AttributeValue[src]

Shorthand to create [AttributeValue::Integer]

impl Hash for AttributeValue[src]

impl ToString for AttributeValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.