Enum parcel_css::values::length::LengthValue
source · [−]pub enum LengthValue {
Show 49 variants
Px(CSSNumber),
In(CSSNumber),
Cm(CSSNumber),
Mm(CSSNumber),
Q(CSSNumber),
Pt(CSSNumber),
Pc(CSSNumber),
Em(CSSNumber),
Rem(CSSNumber),
Ex(CSSNumber),
Rex(CSSNumber),
Ch(CSSNumber),
Rch(CSSNumber),
Cap(CSSNumber),
Rcap(CSSNumber),
Ic(CSSNumber),
Ric(CSSNumber),
Lh(CSSNumber),
Rlh(CSSNumber),
Vw(CSSNumber),
Lvw(CSSNumber),
Svw(CSSNumber),
Dvw(CSSNumber),
Cqw(CSSNumber),
Vh(CSSNumber),
Lvh(CSSNumber),
Svh(CSSNumber),
Dvh(CSSNumber),
Cqh(CSSNumber),
Vi(CSSNumber),
Svi(CSSNumber),
Lvi(CSSNumber),
Dvi(CSSNumber),
Cqi(CSSNumber),
Vb(CSSNumber),
Svb(CSSNumber),
Lvb(CSSNumber),
Dvb(CSSNumber),
Cqb(CSSNumber),
Vmin(CSSNumber),
Svmin(CSSNumber),
Lvmin(CSSNumber),
Dvmin(CSSNumber),
Cqmin(CSSNumber),
Vmax(CSSNumber),
Svmax(CSSNumber),
Lvmax(CSSNumber),
Dvmax(CSSNumber),
Cqmax(CSSNumber),
}
Variants
Px(CSSNumber)
A length in pixels.
In(CSSNumber)
A length in inches. 1in = 96px.
Cm(CSSNumber)
A length in centimeters. 1cm = 96px / 2.54.
Mm(CSSNumber)
A length in millimeters. 1mm = 1/10th of 1cm.
Q(CSSNumber)
A length in quarter-millimeters. 1Q = 1/40th of 1cm.
Pt(CSSNumber)
A length in points. 1pt = 1/72nd of 1in.
Pc(CSSNumber)
A length in picas. 1pc = 1/6th of 1in.
Em(CSSNumber)
A length in the em
unit. An em
is equal to the computed value of the
font-size property of the element on which it is used.
Rem(CSSNumber)
A length in the rem
unit. A rem
is equal to the computed value of the
em
unit on the root element.
Ex(CSSNumber)
A length in ex
unit. An ex
is equal to the x-height of the font.
Rex(CSSNumber)
A length in the rex
unit. A rex
is equal to the value of the ex
unit on the root element.
Ch(CSSNumber)
A length in the ch
unit. A ch
is equal to the width of the zero (“0”) character in the current font.
Rch(CSSNumber)
A length in the rch
unit. An rch
is equal to the value of the ch
unit on the root element.
Cap(CSSNumber)
A length in the cap
unit. A cap
is equal to the cap-height of the font.
Rcap(CSSNumber)
A length in the rcap
unit. An rcap
is equal to the value of the cap
unit on the root element.
Ic(CSSNumber)
A length in the ic
unit. An ic
is equal to the width of the “水” (CJK water ideograph) character in the current font.
Ric(CSSNumber)
A length in the ric
unit. An ric
is equal to the value of the ic
unit on the root element.
Lh(CSSNumber)
A length in the lh
unit. An lh
is equal to the computed value of the line-height
property.
Rlh(CSSNumber)
A length in the rlh
unit. An rlh
is equal to the value of the lh
unit on the root element.
Vw(CSSNumber)
A length in the vw
unit. A vw
is equal to 1% of the viewport width.
Lvw(CSSNumber)
A length in the lvw
unit. An lvw
is equal to 1% of the large viewport width.
Svw(CSSNumber)
A length in the svw
unit. An svw
is equal to 1% of the small viewport width.
Dvw(CSSNumber)
A length in the dvw
unit. An dvw
is equal to 1% of the dynamic viewport width.
Cqw(CSSNumber)
A length in the cqw
unit. An cqw
is equal to 1% of the query container width.
Vh(CSSNumber)
A length in the vh
unit. A vh
is equal to 1% of the viewport height.
Lvh(CSSNumber)
A length in the lvh
unit. An lvh
is equal to 1% of the large viewport height.
Svh(CSSNumber)
A length in the svh
unit. An svh
is equal to 1% of the small viewport height.
Dvh(CSSNumber)
A length in the dvh
unit. An dvh
is equal to 1% of the dynamic viewport height.
Cqh(CSSNumber)
A length in the cqh
unit. An cqh
is equal to 1% of the query container height.
Vi(CSSNumber)
A length in the vi
unit. A vi
is equal to 1% of the viewport size
in the box’s inline axis.
Svi(CSSNumber)
A length in the svi
unit. A svi
is equal to 1% of the small viewport size
in the box’s inline axis.
Lvi(CSSNumber)
A length in the lvi
unit. A lvi
is equal to 1% of the large viewport size
in the box’s inline axis.
Dvi(CSSNumber)
A length in the dvi
unit. A dvi
is equal to 1% of the dynamic viewport size
in the box’s inline axis.
Cqi(CSSNumber)
A length in the cqi
unit. An cqi
is equal to 1% of the query container inline size.
Vb(CSSNumber)
A length in the vb
unit. A vb
is equal to 1% of the viewport size
in the box’s block axis.
Svb(CSSNumber)
A length in the svb
unit. A svb
is equal to 1% of the small viewport size
in the box’s block axis.
Lvb(CSSNumber)
A length in the lvb
unit. A lvb
is equal to 1% of the large viewport size
in the box’s block axis.
Dvb(CSSNumber)
A length in the dvb
unit. A dvb
is equal to 1% of the dynamic viewport size
in the box’s block axis.
Cqb(CSSNumber)
A length in the cqb
unit. An cqb
is equal to 1% of the query container block size.
Vmin(CSSNumber)
A length in the vmin
unit. A vmin
is equal to the smaller of vw
and vh
.
Svmin(CSSNumber)
A length in the svmin
unit. An svmin
is equal to the smaller of svw
and svh
.
Lvmin(CSSNumber)
A length in the lvmin
unit. An lvmin
is equal to the smaller of lvw
and lvh
.
Dvmin(CSSNumber)
A length in the dvmin
unit. A dvmin
is equal to the smaller of dvw
and dvh
.
Cqmin(CSSNumber)
A length in the cqmin
unit. An cqmin
is equal to the smaller of cqi
and cqb
.
Vmax(CSSNumber)
A length in the vmax
unit. A vmax
is equal to the larger of vw
and vh
.
Svmax(CSSNumber)
A length in the svmax
unit. An svmax
is equal to the larger of svw
and svh
.
Lvmax(CSSNumber)
A length in the lvmax
unit. An lvmax
is equal to the larger of lvw
and lvh
.
Dvmax(CSSNumber)
A length in the dvmax
unit. An dvmax
is equal to the larger of dvw
and dvh
.
Cqmax(CSSNumber)
A length in the cqmax
unit. An cqmin
is equal to the larger of cqi
and cqb
.
Implementations
sourceimpl LengthValue
impl LengthValue
sourcepub fn to_unit_value(&self) -> (CSSNumber, &str)
pub fn to_unit_value(&self) -> (CSSNumber, &str)
Returns the numeric value and unit string for the length value.
Trait Implementations
sourceimpl Clone for LengthValue
impl Clone for LengthValue
sourcefn clone(&self) -> LengthValue
fn clone(&self) -> LengthValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LengthValue
impl Debug for LengthValue
sourceimpl Map for LengthValue
impl Map for LengthValue
sourceimpl Mul<f32> for LengthValue
impl Mul<f32> for LengthValue
type Output = LengthValue
type Output = LengthValue
The resulting type after applying the *
operator.
sourcefn mul(self, other: CSSNumber) -> LengthValue
fn mul(self, other: CSSNumber) -> LengthValue
Performs the *
operation. Read more
sourceimpl<'i> Parse<'i> for LengthValue
impl<'i> Parse<'i> for LengthValue
sourcefn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value of this type using an existing parser.
sourcefn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value from a string. Read more
sourceimpl PartialEq<LengthValue> for LengthValue
impl PartialEq<LengthValue> for LengthValue
sourcefn eq(&self, other: &LengthValue) -> bool
fn eq(&self, other: &LengthValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LengthValue) -> bool
fn ne(&self, other: &LengthValue) -> bool
This method tests for !=
.
sourceimpl PartialOrd<LengthValue> for LengthValue
impl PartialOrd<LengthValue> for LengthValue
sourcefn partial_cmp(&self, other: &LengthValue) -> Option<Ordering>
fn partial_cmp(&self, other: &LengthValue) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Sign for LengthValue
impl Sign for LengthValue
sourcefn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Returns whether the value is positive.
sourcefn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Returns whether the value is negative.
sourceimpl ToCss for LengthValue
impl ToCss for LengthValue
sourcefn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError> where
W: Write,
fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError> where
W: Write,
Serialize self
in CSS syntax, writing to dest
.
sourcefn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
Serialize self
in CSS syntax and return a string. Read more
sourceimpl TryFrom<Angle> for LengthValue
impl TryFrom<Angle> for LengthValue
sourceimpl TryOp for LengthValue
impl TryOp for LengthValue
sourceimpl Zero for LengthValue
impl Zero for LengthValue
impl StructuralPartialEq for LengthValue
Auto Trait Implementations
impl RefUnwindSafe for LengthValue
impl Send for LengthValue
impl Sync for LengthValue
impl Unpin for LengthValue
impl UnwindSafe for LengthValue
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TrySign for T where
T: Sign,
impl<T> TrySign for T where
T: Sign,
sourcefn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Returns whether the value is positive. If not possible, returns false.
sourcefn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Returns whether the value is negative. If not possible, returns false.