#[repr(u8)]pub enum ViewportPercentageLength {
Show 24 variants
Vw(CSSFloat),
Svw(CSSFloat),
Lvw(CSSFloat),
Dvw(CSSFloat),
Vh(CSSFloat),
Svh(CSSFloat),
Lvh(CSSFloat),
Dvh(CSSFloat),
Vmin(CSSFloat),
Svmin(CSSFloat),
Lvmin(CSSFloat),
Dvmin(CSSFloat),
Vmax(CSSFloat),
Svmax(CSSFloat),
Lvmax(CSSFloat),
Dvmax(CSSFloat),
Vb(CSSFloat),
Svb(CSSFloat),
Lvb(CSSFloat),
Dvb(CSSFloat),
Vi(CSSFloat),
Svi(CSSFloat),
Lvi(CSSFloat),
Dvi(CSSFloat),
}
Expand description
A viewport-relative length.
https://drafts.csswg.org/css-values/#viewport-relative-lengths
Variants§
Vw(CSSFloat)
Svw(CSSFloat)
Lvw(CSSFloat)
Dvw(CSSFloat)
Vh(CSSFloat)
Svh(CSSFloat)
Lvh(CSSFloat)
Dvh(CSSFloat)
Vmin(CSSFloat)
Svmin(CSSFloat)
Lvmin(CSSFloat)
Dvmin(CSSFloat)
Vmax(CSSFloat)
Svmax(CSSFloat)
Lvmax(CSSFloat)
Dvmax(CSSFloat)
Vb(CSSFloat)
Svb(CSSFloat)
Lvb(CSSFloat)
Dvb(CSSFloat)
Vi(CSSFloat)
Svi(CSSFloat)
Lvi(CSSFloat)
Dvi(CSSFloat)
Implementations§
source§impl ViewportPercentageLength
impl ViewportPercentageLength
sourcefn unitless_value(&self) -> CSSFloat
fn unitless_value(&self) -> CSSFloat
Return the unitless, raw value.
fn unit(&self) -> &'static str
fn unpack(&self) -> (ViewportVariant, ViewportUnit, CSSFloat)
fn try_op<O>(&self, other: &Self, op: O) -> Result<Self, ()>
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 viewport-relative length for the given viewport size.
Trait Implementations§
source§impl Clone for ViewportPercentageLength
impl Clone for ViewportPercentageLength
source§fn clone(&self) -> ViewportPercentageLength
fn clone(&self) -> ViewportPercentageLength
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 ViewportPercentageLength
impl Debug for ViewportPercentageLength
source§impl MallocSizeOf for ViewportPercentageLength
impl MallocSizeOf for ViewportPercentageLength
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 ViewportPercentageLength
impl PartialEq for ViewportPercentageLength
source§impl PartialOrd for ViewportPercentageLength
impl PartialOrd for ViewportPercentageLength
source§impl ToCss for ViewportPercentageLength
impl ToCss for ViewportPercentageLength
source§impl ToShmem for ViewportPercentageLength
impl ToShmem for ViewportPercentageLength
impl Copy for ViewportPercentageLength
impl StructuralPartialEq for ViewportPercentageLength
Auto Trait Implementations§
impl Freeze for ViewportPercentageLength
impl RefUnwindSafe for ViewportPercentageLength
impl Send for ViewportPercentageLength
impl Sync for ViewportPercentageLength
impl Unpin for ViewportPercentageLength
impl UnwindSafe for ViewportPercentageLength
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