Struct zng_unit::Factor

source ·
#[repr(transparent)]
pub struct Factor(pub f32);
Expand description

Normalized multiplication factor.

Values of this type are normalized to generally be in between 0.0 and 1.0 to indicate a fraction of a unit. However, values are not clamped to this range, Factor(2.0) is a valid value and so are negative values.

§Equality

Equality is determined to within 0.00001 epsilon.

Tuple Fields§

§0: f32

Implementations§

source§

impl Factor

source

pub fn clamp_range(self) -> Self

Clamp factor to [0.0..=1.0] range.

source

pub fn max(self, other: impl Into<Factor>) -> Factor

Returns the maximum of two factors.

source

pub fn min(self, other: impl Into<Factor>) -> Factor

Returns the minimum of two factors.

source

pub fn clamp(self, min: impl Into<Factor>, max: impl Into<Factor>) -> Factor

Returns self if min <= self <= max, returns min if self < min or returns max if self > max.

source

pub fn abs(self) -> Factor

Computes the absolute value of self.

source

pub fn flip(self) -> Factor

Flip factor, around 0.5,

Returns 1.0 - self.

source

pub fn pct(self) -> FactorPercent

Factor as percentage.

Trait Implementations§

source§

impl Add for Factor

§

type Output = Factor

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign for Factor

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl Clone for Factor

source§

fn clone(&self) -> Factor

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Factor

source§

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

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

impl<'de> Deserialize<'de> for Factor

source§

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

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

impl Display for Factor

source§

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

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

impl Div<Factor> for Dip

§

type Output = Dip

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> Dip

Performs the / operation. Read more
source§

impl Div<Factor> for Duration

§

type Output = Duration

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> Duration

Performs the / operation. Read more
source§

impl Div<Factor> for FactorPercent

§

type Output = FactorPercent

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> Self

Performs the / operation. Read more
source§

impl Div<Factor> for DipPoint

§

type Output = Point2D<Dip, Dip>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> DipPoint

Performs the / operation. Read more
source§

impl Div<Factor> for PxPoint

§

type Output = Point2D<Px, Px>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> PxPoint

Performs the / operation. Read more
source§

impl Div<Factor> for Point2D<f32, Px>

§

type Output = Point2D<f32, Px>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> Point2D<f32, Px>

Performs the / operation. Read more
source§

impl Div<Factor> for Px

§

type Output = Px

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> Px

Performs the / operation. Read more
source§

impl Div<Factor> for DipRect

§

type Output = Rect<Dip, Dip>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> DipRect

Performs the / operation. Read more
source§

impl Div<Factor> for PxRect

§

type Output = Rect<Px, Px>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> PxRect

Performs the / operation. Read more
source§

impl Div<Factor> for DipSize

§

type Output = Size2D<Dip, Dip>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> DipSize

Performs the / operation. Read more
source§

impl Div<Factor> for PxSize

§

type Output = Size2D<Px, Px>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> PxSize

Performs the / operation. Read more
source§

impl Div<Factor> for Size2D<f32, Px>

§

type Output = Size2D<f32, Px>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> Size2D<f32, Px>

Performs the / operation. Read more
source§

impl Div<Factor> for DipVector

§

type Output = Vector2D<Dip, Dip>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> DipVector

Performs the / operation. Read more
source§

impl Div<Factor> for PxVector

§

type Output = Vector2D<Px, Px>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> PxVector

Performs the / operation. Read more
source§

impl Div<Factor> for f32

§

type Output = f32

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<Factor> for f64

§

type Output = f64

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> f64

Performs the / operation. Read more
source§

impl Div<Factor> for i128

§

type Output = i128

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> i128

Performs the / operation. Read more
source§

impl Div<Factor> for i16

§

type Output = i16

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> i16

Performs the / operation. Read more
source§

impl Div<Factor> for i32

§

type Output = i32

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> i32

Performs the / operation. Read more
source§

impl Div<Factor> for i64

§

type Output = i64

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> i64

Performs the / operation. Read more
source§

impl Div<Factor> for i8

§

type Output = i8

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> i8

Performs the / operation. Read more
source§

impl Div<Factor> for isize

§

type Output = isize

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> isize

Performs the / operation. Read more
source§

impl Div<Factor> for u128

§

type Output = u128

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> u128

Performs the / operation. Read more
source§

impl Div<Factor> for u16

§

type Output = u16

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> u16

Performs the / operation. Read more
source§

impl Div<Factor> for u32

§

type Output = u32

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> u32

Performs the / operation. Read more
source§

impl Div<Factor> for u64

§

type Output = u64

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> u64

Performs the / operation. Read more
source§

impl Div<Factor> for u8

§

type Output = u8

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> u8

Performs the / operation. Read more
source§

impl Div<Factor> for usize

§

type Output = usize

The resulting type after applying the / operator.
source§

fn div(self, rhs: Factor) -> usize

Performs the / operation. Read more
source§

impl Div for Factor

§

type Output = Factor

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign<Factor> for Dip

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for Duration

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for FactorPercent

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for DipPoint

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for PxPoint

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for Point2D<f32, Px>

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for Px

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for DipRect

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for PxRect

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for DipSize

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for PxSize

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for Size2D<f32, Px>

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for DipVector

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for PxVector

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for f32

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for f64

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for i128

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for i16

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for i32

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for i64

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for i8

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for isize

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for u128

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for u16

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for u32

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for u64

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for u8

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign<Factor> for usize

source§

fn div_assign(&mut self, rhs: Factor)

Performs the /= operation. Read more
source§

impl DivAssign for Factor

source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
source§

impl From<Factor> for FactorPercent

source§

fn from(value: Factor) -> Self

Converts to this type from the input type.
source§

impl From<Factor> for RgbaComponent

Color channel value is in the [0..=1] range.

source§

fn from(f: Factor) -> Self

Converts to this type from the input type.
source§

impl From<FactorPercent> for Factor

source§

fn from(value: FactorPercent) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Factor

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Factor

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl Hash for Factor

source§

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

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 Mul<Factor> for Dip

§

type Output = Dip

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> Dip

Performs the * operation. Read more
source§

impl Mul<Factor> for Duration

§

type Output = Duration

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> Duration

Performs the * operation. Read more
source§

impl Mul<Factor> for FactorPercent

§

type Output = FactorPercent

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> Self

Performs the * operation. Read more
source§

impl Mul<Factor> for DipPoint

§

type Output = Point2D<Dip, Dip>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> DipPoint

Performs the * operation. Read more
source§

impl Mul<Factor> for PxPoint

§

type Output = Point2D<Px, Px>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> PxPoint

Performs the * operation. Read more
source§

impl Mul<Factor> for Point2D<f32, Px>

§

type Output = Point2D<f32, Px>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> Point2D<f32, Px>

Performs the * operation. Read more
source§

impl Mul<Factor> for Px

§

type Output = Px

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> Px

Performs the * operation. Read more
source§

impl Mul<Factor> for DipRect

§

type Output = Rect<Dip, Dip>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> DipRect

Performs the * operation. Read more
source§

impl Mul<Factor> for PxRect

§

type Output = Rect<Px, Px>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> PxRect

Performs the * operation. Read more
source§

impl Mul<Factor> for DipSize

§

type Output = Size2D<Dip, Dip>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> DipSize

Performs the * operation. Read more
source§

impl Mul<Factor> for PxSize

§

type Output = Size2D<Px, Px>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> PxSize

Performs the * operation. Read more
source§

impl Mul<Factor> for Size2D<f32, Px>

§

type Output = Size2D<f32, Px>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> Size2D<f32, Px>

Performs the * operation. Read more
source§

impl Mul<Factor> for DipVector

§

type Output = Vector2D<Dip, Dip>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> DipVector

Performs the * operation. Read more
source§

impl Mul<Factor> for PxVector

§

type Output = Vector2D<Px, Px>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> PxVector

Performs the * operation. Read more
source§

impl Mul<Factor> for f32

§

type Output = f32

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Factor> for f64

§

type Output = f64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> f64

Performs the * operation. Read more
source§

impl Mul<Factor> for i128

§

type Output = i128

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> i128

Performs the * operation. Read more
source§

impl Mul<Factor> for i16

§

type Output = i16

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> i16

Performs the * operation. Read more
source§

impl Mul<Factor> for i32

§

type Output = i32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> i32

Performs the * operation. Read more
source§

impl Mul<Factor> for i64

§

type Output = i64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> i64

Performs the * operation. Read more
source§

impl Mul<Factor> for i8

§

type Output = i8

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> i8

Performs the * operation. Read more
source§

impl Mul<Factor> for isize

§

type Output = isize

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> isize

Performs the * operation. Read more
source§

impl Mul<Factor> for u128

§

type Output = u128

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> u128

Performs the * operation. Read more
source§

impl Mul<Factor> for u16

§

type Output = u16

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> u16

Performs the * operation. Read more
source§

impl Mul<Factor> for u32

§

type Output = u32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> u32

Performs the * operation. Read more
source§

impl Mul<Factor> for u64

§

type Output = u64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> u64

Performs the * operation. Read more
source§

impl Mul<Factor> for u8

§

type Output = u8

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> u8

Performs the * operation. Read more
source§

impl Mul<Factor> for usize

§

type Output = usize

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Factor) -> usize

Performs the * operation. Read more
source§

impl Mul for Factor

§

type Output = Factor

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
source§

impl MulAssign<Factor> for Dip

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for Duration

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for FactorPercent

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for DipPoint

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for PxPoint

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for Point2D<f32, Px>

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for Px

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for DipRect

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for PxRect

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for DipSize

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for PxSize

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for Size2D<f32, Px>

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for DipVector

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for PxVector

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for f32

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for f64

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for i128

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for i16

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for i32

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for i64

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for i8

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for isize

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for u128

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for u16

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for u32

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for u64

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for u8

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign<Factor> for usize

source§

fn mul_assign(&mut self, rhs: Factor)

Performs the *= operation. Read more
source§

impl MulAssign for Factor

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl Neg for Factor

§

type Output = Factor

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl PartialEq for Factor

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Factor

source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Factor

source§

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

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

impl Sub for Factor

§

type Output = Factor

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign for Factor

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl Zeroable for Factor

§

fn zeroed() -> Self

source§

impl Copy for Factor

source§

impl Pod for Factor

Auto Trait Implementations§

§

impl Freeze for Factor

§

impl RefUnwindSafe for Factor

§

impl Send for Factor

§

impl Sync for Factor

§

impl Unpin for Factor

§

impl UnwindSafe for Factor

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> 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
§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

§

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§

default 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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<T> AnyBitPattern for T
where T: Pod,

source§

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

§

impl<T> NoUninit for T
where T: Pod,