Skip to main content

LengthExt

Trait LengthExt 

Source
pub trait LengthExt {
    // Required method
    fn to_pixels(
        &self,
        base_size: AbsoluteLength,
        rem_size: Pixels,
    ) -> Option<Pixels>;
}
Expand description

A trait to extend the Length enum with utility methods.

Required Methods§

Source

fn to_pixels( &self, base_size: AbsoluteLength, rem_size: Pixels, ) -> Option<Pixels>

Converts the Length to Pixels based on a given base_size and rem_size.

If the Length is Length::Auto, it returns None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl LengthExt for Length

Source§

fn to_pixels( &self, base_size: AbsoluteLength, rem_size: Pixels, ) -> Option<Pixels>

Implementors§