pub trait LengthExt: Copy {
// Required methods
fn px(self) -> Length;
fn rpx(self) -> Length;
fn ppx(self) -> Length;
fn em(self) -> Length;
fn rem(self) -> Length;
fn vh(self) -> Length;
fn vw(self) -> Length;
}Expand description
Method-style length constructors for primitive numbers.
Implemented for both f32 and i32. i32 widens silently to
f32, so 8.px() and 8.0.px() are interchangeable.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".