pub trait Length:
Add<Output = Self>
+ Sub<Output = Self>
+ Mul<f64, Output = Self>
+ Sized
+ Copy {
// Required method
fn to_points(&self) -> f64;
// Provided methods
fn to_mm(&self) -> f64 { ... }
fn to_cm(&self) -> f64 { ... }
fn to_inch(&self) -> f64 { ... }
fn as_pt(&self) -> Pt { ... }
fn as_mm(&self) -> Mm { ... }
fn as_cm(&self) -> Cm { ... }
fn as_inch(&self) -> Inch { ... }
}Expand description
Length trait for units.
Required Methods§
Provided Methods§
fn to_mm(&self) -> f64
fn to_cm(&self) -> f64
fn to_inch(&self) -> f64
fn as_pt(&self) -> Pt
fn as_mm(&self) -> Mm
fn as_cm(&self) -> Cm
fn as_inch(&self) -> Inch
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.