pub struct ContainerQuery {
pub name: Option<String>,
pub condition: Option<Condition>,
/* private fields */
}Expand description
One @container query, CSS Conditional 5 §6: an optional container
name and a condition on the container’s size or its custom
properties’ values.
Fields§
§name: Option<String>§condition: Option<Condition>None for a name alone, which any container of that name matches.
Implementations§
Source§impl ContainerQuery
impl ContainerQuery
Sourcepub fn parse_list(prelude: &[ComponentValue<'_>]) -> Option<Vec<ContainerQuery>>
pub fn parse_list(prelude: &[ComponentValue<'_>]) -> Option<Vec<ContainerQuery>>
A @container prelude: one or more queries, comma-separated.
Sourcepub fn parse(values: &[ComponentValue<'_>]) -> Option<ContainerQuery>
pub fn parse(values: &[ComponentValue<'_>]) -> Option<ContainerQuery>
One query.
Sourcepub fn evaluate(
&self,
size: Option<(f64, f64)>,
lengths: &QueryLengths,
style: &dyn Fn(&str) -> Option<String>,
number: &dyn Fn(&str) -> Option<Leaf>,
) -> Option<bool>
pub fn evaluate( &self, size: Option<(f64, f64)>, lengths: &QueryLengths, style: &dyn Fn(&str) -> Option<String>, number: &dyn Fn(&str) -> Option<Leaf>, ) -> Option<bool>
The condition against a container size CSS pixels wide and high
(horizontal writing), with lengths for the relative lengths in
it, style giving the container’s custom properties’ computed
values, and number a style range’s value substituted and computed
on the container (None if it isn’t a number or a dimension):
Some(true), Some(false), or None for unknown, which
@container treats as false.
Trait Implementations§
Source§impl Clone for ContainerQuery
impl Clone for ContainerQuery
Source§fn clone(&self) -> ContainerQuery
fn clone(&self) -> ContainerQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ContainerQuery
impl Debug for ContainerQuery
Source§impl Display for ContainerQuery
impl Display for ContainerQuery
Source§impl PartialEq for ContainerQuery
impl PartialEq for ContainerQuery
impl StructuralPartialEq for ContainerQuery
Auto Trait Implementations§
impl Forget for ContainerQuery
impl Freeze for ContainerQuery
impl Move for ContainerQuery
impl RefUnwindSafe for ContainerQuery
impl Send for ContainerQuery
impl Sync for ContainerQuery
impl Unpin for ContainerQuery
impl UnsafeUnpin for ContainerQuery
impl UnwindSafe for ContainerQuery
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