pub struct Dimension {
pub value: f32,
pub unit: DimensionUnit,
}Expand description
Represents a LaTeX dimension.
Fields§
§value: f32The value of the dimension.
unit: DimensionUnitThe unit of the dimension.
Implementations§
Trait Implementations§
Source§impl Display for Dimension
Displays a LaTeX dimension into a CSS dimension string.
impl Display for Dimension
Displays a LaTeX dimension into a CSS dimension string.
The conversion is done using the following relations between the TeX and CSS units:
| TeX unit | CSS unit |
|---|---|
| 1 em | 1 em |
| 18 mu | 1 em |
| 1 ex | 1 ex |
| 1 mm | 1 mm |
| 1 cm | 1 cm |
| 1 in | 1 in |
| 1 bp | 1 pt |
| 72.27 pt | 72 pt |
| 72.27 pc | 72 pc |
| 65536 * 72.27 sp | 1 pt |
| 1157 * 72.27 dd | 1238 * 72 pt |
| 1157 * 72.27 cc | 12 * 1238 * 72 pt |
impl Copy for Dimension
impl StructuralPartialEq for Dimension
Auto Trait Implementations§
impl Freeze for Dimension
impl RefUnwindSafe for Dimension
impl Send for Dimension
impl Sync for Dimension
impl Unpin for Dimension
impl UnwindSafe for Dimension
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