pub enum Unit {
Px,
Pt,
Pct,
Deg,
Unknown(String),
}Expand description
A unit of measurement used in .zen documents.
Variants§
Px
Document pixel units — (px).
Pt
Point units — (pt).
Pct
Percentage — (pct).
Deg
Degrees — (deg).
Unknown(String)
An unrecognized unit annotation (forward-compat).
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn from_annotation(s: &str) -> Self
pub fn from_annotation(s: &str) -> Self
Parse a unit annotation string (without the enclosing parentheses).
Sourcepub fn as_annotation(&self) -> &str
pub fn as_annotation(&self) -> &str
The canonical annotation string (without parentheses) — the inverse of
Unit::from_annotation.
Trait Implementations§
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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more