Enum lyon::svg::parser::AttributeValue [] [src]

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

Representation of the SVG attribute value.

Variants

<color> type.

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

<length> type.

<list-of-lengths> type.

<IRI> type.

<FuncIRI> type.

<FuncIRI> type.

<number> type.

<list-of-numbers> type.

ID of the predefined value.

Unknown data.

Methods

impl<'a> AttributeValue<'a>

Converts stream data into AttributeValue.

This function supports all presentation attributes.

Errors

  • Most of the Error types can occur.
  • Data of an unknown attribute will be parsed as AttributeValue::String without errors.

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 are not fully implemented. This function will try to parse a single predefined value. Other data will be parsed as AttributeValue::String.

    Library will print a 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> PartialEq<AttributeValue<'a>> for AttributeValue<'a>

impl<'a> Debug for AttributeValue<'a>

impl<'a> Clone for AttributeValue<'a>