[−][src]Struct azul_webrender_api::units::Au
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.
fn add(self, other: Au) -> Au
[src]
impl AddAssign<Au> for Au
[src]
fn add_assign(&mut self, other: 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]
fn deserialize<D>(
deserializer: D
) -> Result<Au, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<Au, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Div<Au> for Au
[src]
type Output = i32
The resulting type after applying the /
operator.
fn div(self, other: Au) -> i32
[src]
impl Div<i32> for Au
[src]
type Output = Au
The resulting type after applying the /
operator.
fn div(self, other: i32) -> Au
[src]
impl DivAssign<i32> for Au
[src]
fn div_assign(&mut self, other: i32)
[src]
impl Eq for Au
[src]
impl Hash for Au
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl MallocSizeOf for Au
[src]
fn size_of(&self, &mut MallocSizeOfOps) -> usize
[src]
impl Mul<i32> for Au
[src]
type Output = Au
The resulting type after applying the *
operator.
fn mul(self, other: i32) -> Au
[src]
impl MulAssign<i32> for Au
[src]
fn mul_assign(&mut self, other: i32)
[src]
impl Neg for Au
[src]
impl Ord for Au
[src]
fn cmp(&self, other: &Au) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Au> for Au
[src]
impl PartialOrd<Au> for Au
[src]
fn partial_cmp(&self, other: &Au) -> Option<Ordering>
[src]
fn lt(&self, other: &Au) -> bool
[src]
fn le(&self, other: &Au) -> bool
[src]
fn gt(&self, other: &Au) -> bool
[src]
fn ge(&self, other: &Au) -> bool
[src]
impl Rem<Au> for Au
[src]
type Output = Au
The resulting type after applying the %
operator.
fn rem(self, other: Au) -> Au
[src]
impl Rem<i32> for Au
[src]
type Output = Au
The resulting type after applying the %
operator.
fn rem(self, other: i32) -> Au
[src]
impl Serialize for Au
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
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.
fn sub(self, other: Au) -> Au
[src]
impl SubAssign<Au> for Au
[src]
fn sub_assign(&mut self, other: Au)
[src]
impl Zero for Au
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Zero for T where
T: Zero,
[src]
T: Zero,