Skip to main content

LengthExt

Trait LengthExt 

Source
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§

Source

fn px(self) -> Length

<self>px.

Source

fn rpx(self) -> Length

<self>rpx.

Source

fn ppx(self) -> Length

<self>ppx.

Source

fn em(self) -> Length

<self>em.

Source

fn rem(self) -> Length

<self>rem.

Source

fn vh(self) -> Length

<self>vh.

Source

fn vw(self) -> Length

<self>vw.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: IntoF32> LengthExt for T