pub struct ParseOptions {
    pub parse_comments: bool,
    pub parse_declarations: bool,
    pub parse_unknown_elements: bool,
    pub parse_unknown_attributes: bool,
    pub parse_px_unit: bool,
    pub skip_unresolved_classes: bool,
    pub skip_invalid_attributes: bool,
    pub skip_invalid_css: bool,
    pub skip_paint_fallback: bool,
}
Expand description

Options that defines SVG parsing.

Fields§

§parse_comments: bool

Add comment nodes to the DOM during parsing.

§parse_declarations: bool

Add declaration nodes to the DOM during parsing.

§parse_unknown_elements: bool

Add unknown elements to the DOM during parsing.

All elements which is not defined in ElementId are unknown.

§parse_unknown_attributes: bool

Add unknown attributes to elements during parsing.

All attributes which is not defined in AttributeId are unknown.

§parse_px_unit: bool

px unit in the <length> type is rudimentary, since it’s the same as none.

By default we parse it as is, but it can be disabled.

§skip_unresolved_classes: bool

Skip unresolved references inside the class attribute.

It’s enabled by default, but if you disable it - all unresolved classes will be kept in the class attribute.

§skip_invalid_attributes: bool

Skip attributes with invalid values.

By default, attribute with an invalid value will lead to a parsing error. This flag allows converting this error into a warning.

§skip_invalid_css: bool

Skip invalid/unsupported CSS.

By default, CSS with an invalid/unsupported value will lead to a parsing error. This flag allows converting this error into a warning.

§skip_paint_fallback: bool

Ignore fallback value in paint attributes.

If this option is enabled then the color part in attributes like this fill="url(#lg1) #fff" will be ignored.

Otherwise UnsupportedPaintFallback error will occur during parsing.

Trait Implementations§

source§

impl Default for ParseOptions

source§

fn default() -> ParseOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.