Struct style::queries::feature_expression::QueryFeatureExpression
source · pub struct QueryFeatureExpression {
feature_type: FeatureType,
feature_index: usize,
kind: QueryFeatureExpressionKind,
}
Expand description
A feature expression contains a reference to the feature, the value the query contained, and the range to evaluate.
Fields§
§feature_type: FeatureType
§feature_index: usize
§kind: QueryFeatureExpressionKind
Implementations§
source§impl QueryFeatureExpression
impl QueryFeatureExpression
fn new( feature_type: FeatureType, feature_index: usize, kind: QueryFeatureExpressionKind, ) -> Self
fn write_name<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn feature(&self) -> &'static QueryFeatureDescription
sourcepub fn feature_flags(&self) -> FeatureFlags
pub fn feature_flags(&self) -> FeatureFlags
Returns the feature flags for our feature.
sourcepub fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
feature_type: FeatureType,
) -> Result<Self, ParseError<'i>>
pub fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, feature_type: FeatureType, ) -> Result<Self, ParseError<'i>>
Parse a feature expression of the form:
(media-feature: media-value)
fn parse_feature_name<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, feature_type: FeatureType, ) -> Result<(usize, Option<LegacyRange>), ParseError<'i>>
sourcefn parse_multi_range_syntax<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
feature_type: FeatureType,
) -> Result<Self, ParseError<'i>>
fn parse_multi_range_syntax<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, feature_type: FeatureType, ) -> Result<Self, ParseError<'i>>
Parses the following range syntax:
(feature-value
sourcepub fn parse_in_parenthesis_block<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
feature_type: FeatureType,
) -> Result<Self, ParseError<'i>>
pub fn parse_in_parenthesis_block<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, feature_type: FeatureType, ) -> Result<Self, ParseError<'i>>
Parse a feature expression where we’ve already consumed the parenthesis.
sourcepub fn matches(&self, context: &Context<'_>) -> KleeneValue
pub fn matches(&self, context: &Context<'_>) -> KleeneValue
Returns whether this query evaluates to true for the given device.
Trait Implementations§
source§impl Clone for QueryFeatureExpression
impl Clone for QueryFeatureExpression
source§fn clone(&self) -> QueryFeatureExpression
fn clone(&self) -> QueryFeatureExpression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for QueryFeatureExpression
impl Debug for QueryFeatureExpression
source§impl MallocSizeOf for QueryFeatureExpression
impl MallocSizeOf for QueryFeatureExpression
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl PartialEq for QueryFeatureExpression
impl PartialEq for QueryFeatureExpression
source§impl ToCss for QueryFeatureExpression
impl ToCss for QueryFeatureExpression
source§impl ToShmem for QueryFeatureExpression
impl ToShmem for QueryFeatureExpression
impl StructuralPartialEq for QueryFeatureExpression
Auto Trait Implementations§
impl Freeze for QueryFeatureExpression
impl RefUnwindSafe for QueryFeatureExpression
impl Send for QueryFeatureExpression
impl Sync for QueryFeatureExpression
impl Unpin for QueryFeatureExpression
impl UnwindSafe for QueryFeatureExpression
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert