pub struct Length { /* private fields */ }Expand description
Length measurement with units.
Represents a measurement value used for dimensions, positions, etc. Office formats primarily use EMUs (English Metric Units).
§Examples
use litchi::common::Length;
// Create from EMUs
let length = Length::from_emus(914400); // 1 inch
// Convert to different units
let inches = length.inches();
let cm = length.cm();Implementations§
Source§impl Length
impl Length
Sourcepub const fn from_emus(emus: i64) -> Self
pub const fn from_emus(emus: i64) -> Self
Create a length from EMUs (English Metric Units).
EMUs are the native unit used in Office Open XML formats.
- 1 inch = 914,400 EMUs
- 1 cm = 360,000 EMUs
§Examples
use litchi::common::Length;
let length = Length::from_emus(914400); // 1 inchSourcepub fn from_inches(inches: f64) -> Self
pub fn from_inches(inches: f64) -> Self
Create a length from inches.
§Examples
use litchi::common::Length;
let length = Length::from_inches(1.0);Trait Implementations§
impl Copy for Length
impl StructuralPartialEq for Length
Auto Trait Implementations§
impl Freeze for Length
impl RefUnwindSafe for Length
impl Send for Length
impl Sync for Length
impl Unpin for Length
impl UnwindSafe for Length
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