pub struct Dimension {
pub value: f64,
pub unit: Unit,
}Expand description
A value that carries a numeric magnitude and a measurement unit.
Fields§
§value: f64The numeric magnitude.
unit: UnitThe unit of the magnitude.
Implementations§
Source§impl Dimension
impl Dimension
Sourcepub fn to_kdl_string(&self) -> String
pub fn to_kdl_string(&self) -> String
Format as canonical KDL value syntax, e.g. (px)640 or (pt)10.5.
An integral, finite magnitude renders without a fractional part. This is the single source of the dimension string used by the formatter and by the CLI’s transaction/inspect output, so all three agree byte-for-byte.
Trait Implementations§
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 UnsafeUnpin 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