pub enum StyleParseErrorKind<'i> {
Show 29 variants BadUrlInDeclarationValueBlock(CowRcStr<'i>), BadStringInDeclarationValueBlock(CowRcStr<'i>), UnbalancedCloseParenthesisInDeclarationValueBlock, UnbalancedCloseSquareBracketInDeclarationValueBlock, UnbalancedCloseCurlyBracketInDeclarationValueBlock, PropertyDeclarationValueNotExhausted, UnexpectedDimension(CowRcStr<'i>), MediaQueryExpectedFeatureName(CowRcStr<'i>), MediaQueryExpectedFeatureValue, MediaQueryUnexpectedOperator, RangedExpressionWithNoValue, UnexpectedFunction(CowRcStr<'i>), PropertySyntaxField(PropertySyntaxParseError), UnexpectedNamespaceRule, UnexpectedImportRule, DisallowedImportRule, UnexpectedCharsetRule, UnexpectedIdent(CowRcStr<'i>), UnspecifiedError, UnexpectedTokenWithinNamespace(Token<'i>), ValueError(ValueParseErrorKind<'i>), SelectorError(SelectorParseErrorKind<'i>), UnknownProperty(CowRcStr<'i>), ExperimentalProperty, InvalidColor(CowRcStr<'i>, Token<'i>), InvalidFilter(CowRcStr<'i>, Token<'i>), OtherInvalidValue(CowRcStr<'i>), AnimationPropertyInKeyframeBlock, NotAllowedInPageRule,
}
Expand description

Errors that can be encountered while parsing CSS values.

Variants§

§

BadUrlInDeclarationValueBlock(CowRcStr<'i>)

A bad URL token in a DVB.

§

BadStringInDeclarationValueBlock(CowRcStr<'i>)

A bad string token in a DVB.

§

UnbalancedCloseParenthesisInDeclarationValueBlock

Unexpected closing parenthesis in a DVB.

§

UnbalancedCloseSquareBracketInDeclarationValueBlock

Unexpected closing bracket in a DVB.

§

UnbalancedCloseCurlyBracketInDeclarationValueBlock

Unexpected closing curly bracket in a DVB.

§

PropertyDeclarationValueNotExhausted

A property declaration value had input remaining after successfully parsing.

§

UnexpectedDimension(CowRcStr<'i>)

An unexpected dimension token was encountered.

§

MediaQueryExpectedFeatureName(CowRcStr<'i>)

Missing or invalid media feature name.

§

MediaQueryExpectedFeatureValue

Missing or invalid media feature value.

§

MediaQueryUnexpectedOperator

A media feature range operator was not expected.

§

RangedExpressionWithNoValue

min- or max- properties must have a value.

§

UnexpectedFunction(CowRcStr<'i>)

A function was encountered that was not expected.

§

PropertySyntaxField(PropertySyntaxParseError)

Error encountered parsing a @property’s syntax descriptor

§

UnexpectedNamespaceRule

@namespace must be before any rule but @charset and @import

§

UnexpectedImportRule

@import must be before any rule but @charset

§

DisallowedImportRule

@import rules are disallowed in the parser.

§

UnexpectedCharsetRule

Unexpected @charset rule encountered.

§

UnexpectedIdent(CowRcStr<'i>)

The @property <custom-property-name> must start with --

§

UnspecifiedError

A placeholder for many sources of errors that require more specific variants.

§

UnexpectedTokenWithinNamespace(Token<'i>)

An unexpected token was found within a namespace rule.

§

ValueError(ValueParseErrorKind<'i>)

An error was encountered while parsing a property value.

§

SelectorError(SelectorParseErrorKind<'i>)

An error was encountered while parsing a selector

§

UnknownProperty(CowRcStr<'i>)

The property declaration was for an unknown property.

§

ExperimentalProperty

The property declaration was for a disabled experimental property.

§

InvalidColor(CowRcStr<'i>, Token<'i>)

The property declaration contained an invalid color value.

§

InvalidFilter(CowRcStr<'i>, Token<'i>)

The property declaration contained an invalid filter value.

§

OtherInvalidValue(CowRcStr<'i>)

The property declaration contained an invalid value.

§

AnimationPropertyInKeyframeBlock

The declaration contained an animation property, and we were parsing this as a keyframe block (so that property should be ignored).

See: https://drafts.csswg.org/css-animations/#keyframes

§

NotAllowedInPageRule

The property is not allowed within a page rule.

Implementations§

source§

impl<'i> StyleParseErrorKind<'i>

source

pub fn new_invalid<S>(name: S, value_error: ParseError<'i>) -> ParseError<'i>where S: Into<CowRcStr<'i>>,

Create an InvalidValue parse error

Trait Implementations§

source§

impl<'i> Clone for StyleParseErrorKind<'i>

source§

fn clone(&self) -> StyleParseErrorKind<'i>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'i> Debug for StyleParseErrorKind<'i>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'i> From<SelectorParseErrorKind<'i>> for StyleParseErrorKind<'i>

source§

fn from(this: SelectorParseErrorKind<'i>) -> Self

Converts to this type from the input type.
source§

impl<'i> From<ValueParseErrorKind<'i>> for StyleParseErrorKind<'i>

source§

fn from(this: ValueParseErrorKind<'i>) -> Self

Converts to this type from the input type.
source§

impl<'i> PartialEq<StyleParseErrorKind<'i>> for StyleParseErrorKind<'i>

source§

fn eq(&self, other: &StyleParseErrorKind<'i>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'i> StructuralPartialEq for StyleParseErrorKind<'i>

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
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.
source§

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

Performs the conversion.