OperationParser

Trait OperationParser 

Source
trait OperationParser: Sized {
    // Required methods
    fn parse_in_parens<'i, 't>(
        context: &ParserContext<'_>,
        input: &mut Parser<'i, 't>,
        feature_type: FeatureType,
    ) -> Result<Self, ParseError<'i>>;
    fn new_not(inner: Box<Self>) -> Self;
    fn new_operation(conditions: Box<[Self]>, operator: Operator) -> Self;

    // Provided method
    fn parse_internal<'i, 't>(
        context: &ParserContext<'_>,
        input: &mut Parser<'i, 't>,
        feature_type: FeatureType,
        allow_or: AllowOr,
    ) -> Result<Self, ParseError<'i>> { ... }
}
Expand description

Trait for query elements that parse a series of conditions separated by AND or OR operators, or prefixed with NOT.

This is used by both QueryCondition and StyleQuery as they support similar syntax for combining multiple conditions with a boolean operator.

Required Methods§

Source

fn parse_in_parens<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, feature_type: FeatureType, ) -> Result<Self, ParseError<'i>>

Source

fn new_not(inner: Box<Self>) -> Self

Source

fn new_operation(conditions: Box<[Self]>, operator: Operator) -> Self

Provided Methods§

Source

fn parse_internal<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, feature_type: FeatureType, allow_or: AllowOr, ) -> Result<Self, ParseError<'i>>

https://drafts.csswg.org/mediaqueries-5/#typedef-media-condition or https://drafts.csswg.org/mediaqueries-5/#typedef-media-condition-without-or (depending on allow_or).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§