pub enum Unit {
Show 37 variants
Px,
Mm,
In,
Cm,
Q,
Pt,
Pc,
Em,
Rem,
Lh,
Ex,
Ch,
Cap,
Ic,
Rlh,
Vw,
Vh,
Vmin,
Vmax,
Vi,
Vb,
Deg,
Grad,
Rad,
Turn,
S,
Ms,
Hz,
Khz,
Dpi,
Dpcm,
Dppx,
Fr,
Percent,
Unknown(InternedString),
None,
Complex(Arc<ComplexUnit>),
}Variants§
Px
Pixels
Mm
Millimeters
In
Inches
Cm
Centimeters
Q
Quarter-millimeters
Pt
Points
Pc
Picas
Em
Font size of the parent element
Rem
Font size of the root element
Lh
Line height of the element
Ex
x-height of the element’s font
Ch
The advance measure (width) of the glyph “0” of the element’s font
Cap
Represents the “cap height” (nominal height of capital letters) of the element’s font
Ic
Equal to the used advance measure of the “水” (CJK water ideograph, U+6C34) glyph found in the font used to render it
Rlh
Equal to the computed value of the line-height property on the root element (typically <html>), converted to an absolute length
Vw
1% of the viewport’s width
Vh
1% of the viewport’s height
Vmin
1% of the viewport’s smaller dimension
Vmax
1% of the viewport’s larger dimension
Vi
Equal to 1% of the size of the initial containing block, in the direction of the root element’s inline axis
Vb
Equal to 1% of the size of the initial containing block, in the direction of the root element’s block axis
Deg
Represents an angle in degrees. One full circle is 360deg
Grad
Represents an angle in gradians. One full circle is 400grad
Rad
Represents an angle in radians. One full circle is 2π radians which approximates to 6.283rad
Turn
Represents an angle in a number of turns. One full circle is 1turn
S
Represents a time in seconds
Ms
Represents a time in milliseconds
Hz
Represents a frequency in hertz
Khz
Represents a frequency in kilohertz
Dpi
Represents the number of dots per inch
Dpcm
Represents the number of dots per centimeter
Dppx
Represents the number of dots per px unit
Fr
Represents a fraction of the available space in the grid container
Percent
Unknown(InternedString)
Unknown unit
None
Unspecified unit
Complex(Arc<ComplexUnit>)
Trait Implementations§
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.