[][src]Struct azul_webrender_api::units::Au

pub struct Au(pub i32);

An App Unit, the fundamental unit of length in Servo. Usually 1/60th of a pixel (see AU_PER_PX)

Please ensure that the values are between MIN_AU and MAX_AU. It is safe to construct invalid Au values, but it may lead to panics and overflows.

Implementations

impl Au[src]

pub fn new(value: i32) -> Au[src]

FIXME(pcwalton): Workaround for lack of cross crate inlining of newtype structs!

pub fn scale_by(self, factor: f32) -> Au[src]

pub fn scale_by_trunc(self, factor: f32) -> Au[src]

Scale, but truncate (useful for viewport-relative units)

pub fn from_f64_au(float: f64) -> Au[src]

pub fn from_px(px: i32) -> Au[src]

pub fn to_px(self) -> i32[src]

Rounds this app unit down to the pixel towards zero and returns it.

pub fn ceil_to_px(self) -> i32[src]

Ceil this app unit to the appropriate pixel boundary and return it.

pub fn to_nearest_px(self) -> i32[src]

pub fn to_nearest_pixel(self, pixels_per_px: f32) -> f32[src]

pub fn to_f32_px(self) -> f32[src]

pub fn to_f64_px(self) -> f64[src]

pub fn from_f32_px(px: f32) -> Au[src]

pub fn from_f64_px(px: f64) -> Au[src]

pub fn abs(self) -> Au[src]

Trait Implementations

impl Add<Au> for Au[src]

type Output = Au

The resulting type after applying the + operator.

impl AddAssign<Au> for Au[src]

impl Clone for Au[src]

impl Copy for Au[src]

impl Debug for Au[src]

impl Default for Au[src]

impl<'de> Deserialize<'de> for Au[src]

impl Div<Au> for Au[src]

type Output = i32

The resulting type after applying the / operator.

impl Div<i32> for Au[src]

type Output = Au

The resulting type after applying the / operator.

impl DivAssign<i32> for Au[src]

impl Eq for Au[src]

impl Hash for Au[src]

impl MallocSizeOf for Au[src]

impl Mul<i32> for Au[src]

type Output = Au

The resulting type after applying the * operator.

impl MulAssign<i32> for Au[src]

impl Neg for Au[src]

type Output = Au

The resulting type after applying the - operator.

impl Ord for Au[src]

impl PartialEq<Au> for Au[src]

impl PartialOrd<Au> for Au[src]

impl Rem<Au> for Au[src]

type Output = Au

The resulting type after applying the % operator.

impl Rem<i32> for Au[src]

type Output = Au

The resulting type after applying the % operator.

impl Serialize for Au[src]

impl StructuralEq for Au[src]

impl StructuralPartialEq for Au[src]

impl Sub<Au> for Au[src]

type Output = Au

The resulting type after applying the - operator.

impl SubAssign<Au> for Au[src]

impl Zero for Au[src]

Auto Trait Implementations

impl RefUnwindSafe for Au

impl Send for Au

impl Sync for Au

impl Unpin for Au

impl UnwindSafe for Au

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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, 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.

impl<T> Zero for T where
    T: Zero
[src]