Enum svgparser::AttributeValue [] [src]

pub enum AttributeValue<'a> {
    Color(RgbColor),
    EntityRef(&'a [u8]),
    Length(Length),
    LengthList(LengthList<'a>),
    IRI(&'a [u8]),
    FuncIRI(&'a [u8]),
    Number(f64),
    NumberList(NumberList<'a>),
    PredefValue(ValueId),
    String(&'a [u8]),
}

Representation of SVG attribute value.

Variants

<color> type.

Reference to ENTITY. Contains only name from &name;.

<length> type.

<list-of-lengths> type.

<IRI> type.

<FuncIRI> type.

<number> type.

<list-of-numbers> type.

ID of predefined value.

Unknown data.

Methods

impl<'a> AttributeValue<'a>
[src]

Converts stream data into AttributeValue.

This function supports all presentation attributes.

Errors

  • Most of the Error types can occur.
  • Data of unknown attribute will be parsed as AttributeValue::String, without errors.
  • Fallback color for <paint> type is not supported. It will be skipped. Example: fill="#linearGradient1 #f00".

Notes

  • <transform>, <path> and <style> values should be parsed using their own tokenizer's. This function will parse them as AttributeValue::String, aka ignores.
  • enable-background and cursor not fully implemented. This function will try to parse a single predefined value. Other data will be parsed as AttributeValue::String.

    Library will print warning to stdout.

  • viewBox will be parsed as AttributeValue::NumberList.

  • <opacity> value will be bounded to 0..1 range.

  • This function didn't correct most of the numeric values. If value has an incorrect data, like viewBox='0 0 -1 -5' (negative w/h is error), it will be parsed as is.

Trait Implementations

impl<'a> Clone for AttributeValue<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> PartialEq for AttributeValue<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Debug for AttributeValue<'a>
[src]

Formats the value using the given formatter.