[][src]Struct azul_css::PixelValue

pub struct PixelValue {
    pub metric: SizeMetric,
    pub number: FloatValue,
}

FloatValue, but associated with a certain metric (i.e. px, em, etc.)

Fields

metric: SizeMetricnumber: FloatValue

Implementations

impl PixelValue[src]

pub const fn zero() -> Self[src]

pub const fn const_px(value: isize) -> Self[src]

Same as PixelValue::px(), but only accepts whole numbers, since using f32 in const fn is not yet stabilized.

pub const fn const_em(value: isize) -> Self[src]

Same as PixelValue::em(), but only accepts whole numbers, since using f32 in const fn is not yet stabilized.

pub const fn const_pt(value: isize) -> Self[src]

Same as PixelValue::pt(), but only accepts whole numbers, since using f32 in const fn is not yet stabilized.

pub const fn const_percent(value: isize) -> Self[src]

Same as PixelValue::pt(), but only accepts whole numbers, since using f32 in const fn is not yet stabilized.

pub const fn const_from_metric(metric: SizeMetric, value: isize) -> Self[src]

pub fn px(value: f32) -> Self[src]

pub fn em(value: f32) -> Self[src]

pub fn pt(value: f32) -> Self[src]

pub fn percent(value: f32) -> Self[src]

pub fn from_metric(metric: SizeMetric, value: f32) -> Self[src]

pub fn to_pixels(&self, percent_resolve: f32) -> f32[src]

Returns the value of the SizeMetric in pixels

Trait Implementations

impl Clone for PixelValue[src]

impl Copy for PixelValue[src]

impl Debug for PixelValue[src]

impl Default for PixelValue[src]

impl Display for PixelValue[src]

impl Eq for PixelValue[src]

impl FormatAsCssValue for PixelValue[src]

impl Hash for PixelValue[src]

impl Ord for PixelValue[src]

impl PartialEq<PixelValue> for PixelValue[src]

impl PartialOrd<PixelValue> for PixelValue[src]

impl StructuralEq for PixelValue[src]

impl StructuralPartialEq for PixelValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.