Skip to main content

Rems

Struct Rems 

Source
#[repr(transparent)]
pub struct Rems(pub f32);
Expand description

A length in rems: multiples of a root font size (16 points in style strings, REM_SIZE).

Tuple Fields§

§0: f32

Implementations§

Source§

impl Rems

Source

pub const ZERO: Rems

Zero.

Source

pub const fn as_f32(self) -> f32

The value as a bare f32, for a platform API or an encoder.

Source

pub fn abs(self) -> Rems

The absolute value.

Source

pub fn min(self, other: Rems) -> Rems

The smaller of two values.

Source

pub fn max(self, other: Rems) -> Rems

The larger of two values.

Source

pub fn clamp(self, min: Rems, max: Rems) -> Rems

The value within min..=max.

Source

pub fn floor(self) -> Rems

Rounded down.

Source

pub fn round(self) -> Rems

Rounded to the nearest whole value.

Source

pub fn ceil(self) -> Rems

Rounded up.

Source

pub fn is_finite(self) -> bool

Whether the value is neither infinite nor NaN.

Source

pub fn is_nan(self) -> bool

Whether the value is NaN.

Source§

impl Rems

Source

pub fn to_points(self, rem_size: Points) -> Points

In points, with a rem of rem_size.

Trait Implementations§

Source§

impl Add for Rems

Source§

type Output = Rems

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Rems) -> Rems

Performs the + operation. Read more
Source§

impl AddAssign for Rems

Source§

fn add_assign(&mut self, rhs: Rems)

Performs the += operation. Read more
Source§

impl Clone for Rems

Source§

fn clone(&self) -> Rems

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Rems

Source§

impl Debug for Rems

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Rems

Source§

fn default() -> Rems

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Rems

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Rems, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Rems

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Div for Rems

The ratio of two values.

Source§

type Output = f32

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Rems) -> f32

Performs the / operation. Read more
Source§

impl Div<f32> for Rems

Source§

type Output = Rems

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Rems

Performs the / operation. Read more
Source§

impl DivAssign<f32> for Rems

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl Eq for Rems

Source§

impl From<Rems> for AbsoluteLength

Source§

fn from(r: Rems) -> AbsoluteLength

Converts to this type from the input type.
Source§

impl From<Rems> for DefiniteLength

Source§

fn from(r: Rems) -> DefiniteLength

Converts to this type from the input type.
Source§

impl From<Rems> for Length

Source§

fn from(r: Rems) -> Length

Converts to this type from the input type.
Source§

impl From<f32> for Rems

Source§

fn from(v: f32) -> Rems

Converts to this type from the input type.
Source§

impl Half for Rems

Source§

fn half(&self) -> Rems

Half the value.
Source§

impl Hash for Rems

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoReactive<AbsoluteLength> for Rems

Source§

impl IntoReactive<DefiniteLength> for Rems

Source§

impl IntoReactive<Length> for Rems

Source§

impl IntoReactive<LineHeight> for Rems

Source§

impl IsZero for Rems

Source§

fn is_zero(&self) -> bool

Whether the value is zero.
Source§

impl Mul<f32> for Rems

Source§

type Output = Rems

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Rems

Performs the * operation. Read more
Source§

impl MulAssign<f32> for Rems

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl Neg for Rems

Source§

type Output = Rems

The resulting type after applying the - operator.
Source§

fn neg(self) -> Rems

Performs the unary - operation. Read more
Source§

impl PartialEq for Rems

Source§

fn eq(&self, other: &Rems) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Rems

Source§

fn partial_cmp(&self, other: &Rems) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Rems

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Rems

Source§

impl Sub for Rems

Source§

type Output = Rems

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Rems) -> Rems

Performs the - operation. Read more
Source§

impl SubAssign for Rems

Source§

fn sub_assign(&mut self, rhs: Rems)

Performs the -= operation. Read more
Source§

impl Sum for Rems

Source§

fn sum<I>(iter: I) -> Rems
where I: Iterator<Item = Rems>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<'a> Sum<&'a Rems> for Rems

Source§

fn sum<I>(iter: I) -> Rems
where I: Iterator<Item = &'a Rems>,

Takes an iterator and generates Self from the elements by “summing up” the items.

Auto Trait Implementations§

§

impl Forget for Rems

§

impl Freeze for Rems

§

impl Move for Rems

§

impl RefUnwindSafe for Rems

§

impl Send for Rems

§

impl Sync for Rems

§

impl Unpin for Rems

§

impl UnsafeUnpin for Rems

§

impl UnwindSafe for Rems

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
where T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + AddAssign<Rhs> + SubAssign<Rhs>,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<E> IntoThrown for E
where E: Display,

Source§

fn into_thrown(self) -> Thrown

The exception.
Source§

impl<T> ParallelSend for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, Rhs, Output> ScalarMul<Rhs, Output> for T
where T: Mul<Rhs, Output = Output> + MulAssign<Rhs>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more