pub enum ContainerRelativeLength {
Cqw(CSSFloat),
Cqh(CSSFloat),
Cqi(CSSFloat),
Cqb(CSSFloat),
Cqmin(CSSFloat),
Cqmax(CSSFloat),
}
Expand description
A container query length.
Variants§
Cqw(CSSFloat)
1% of query container’s width
Cqh(CSSFloat)
1% of query container’s height
Cqi(CSSFloat)
1% of query container’s inline size
Cqb(CSSFloat)
1% of query container’s block size
Cqmin(CSSFloat)
The smaller value of cqi
or cqb
Cqmax(CSSFloat)
The larger value of cqi
or cqb
Implementations§
source§impl ContainerRelativeLength
impl ContainerRelativeLength
fn unitless_value(&self) -> CSSFloat
fn unit(&self) -> &'static str
pub(crate) fn try_op<O>(&self, other: &Self, op: O) -> Result<Self, ()>
pub(crate) fn map(&self, op: impl FnMut(f32) -> f32) -> Self
sourcepub fn to_computed_value(&self, context: &Context<'_>) -> CSSPixelLength
pub fn to_computed_value(&self, context: &Context<'_>) -> CSSPixelLength
Computes the given container-relative length.
Trait Implementations§
source§impl Clone for ContainerRelativeLength
impl Clone for ContainerRelativeLength
source§fn clone(&self) -> ContainerRelativeLength
fn clone(&self) -> ContainerRelativeLength
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 ContainerRelativeLength
impl Debug for ContainerRelativeLength
source§impl MallocSizeOf for ContainerRelativeLength
impl MallocSizeOf for ContainerRelativeLength
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 ContainerRelativeLength
impl PartialEq for ContainerRelativeLength
source§fn eq(&self, other: &ContainerRelativeLength) -> bool
fn eq(&self, other: &ContainerRelativeLength) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ContainerRelativeLength
impl PartialOrd for ContainerRelativeLength
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ToCss for ContainerRelativeLength
impl ToCss for ContainerRelativeLength
source§impl ToShmem for ContainerRelativeLength
impl ToShmem for ContainerRelativeLength
impl Copy for ContainerRelativeLength
impl StructuralPartialEq for ContainerRelativeLength
Auto Trait Implementations§
impl Freeze for ContainerRelativeLength
impl RefUnwindSafe for ContainerRelativeLength
impl Send for ContainerRelativeLength
impl Sync for ContainerRelativeLength
impl Unpin for ContainerRelativeLength
impl UnwindSafe for ContainerRelativeLength
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> 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