Struct qunit::Value

source ·
#[repr(transparent)]
pub struct Value<T: ComplexField, Q: Quantities> { pub value: T, /* private fields */ }

Fields§

§value: T

Implementations§

source§

impl<T: RealField + Copy, Q: Quantities> Value<T, Q>

source

pub fn atan2(self, x: Self) -> Ratio<T>

Available on crate feature math and (crate features libm or std) only.
source§

impl<T: RealField + Copy, Q: Quantities> Value<T, Q>

source

pub fn sqrt(self) -> Value<T, SqrtQuantities<Q>>

Available on crate feature math and (crate features libm or std) only.
source§

impl<T: ComplexField> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn sin(self) -> Self

Available on crate feature math and (crate features libm or std) only.
source

pub fn cos(self) -> Self

Available on crate feature math and (crate features libm or std) only.
source

pub fn tan(self) -> Self

Available on crate feature math and (crate features libm or std) only.
source

pub fn asin(self) -> Self

Available on crate feature math and (crate features libm or std) only.
source

pub fn acos(self) -> Self

Available on crate feature math and (crate features libm or std) only.
source

pub fn atan(self) -> Self

Available on crate feature math and (crate features libm or std) only.
source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_percent: Self = _

source

pub const UNIT_ratio: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_percent(self) -> T

source

pub fn as_percent(self) -> T

source

pub fn to_ratio(self) -> T

source

pub fn as_ratio(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_percent_vec(self) -> T

source

pub fn to_ratio_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_rad: Self = _

source

pub const UNIT_deg: Self = _

source

pub const UNIT_cdeg: Self = _

source

pub const UNIT_rev: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_rad(self) -> T

source

pub fn as_rad(self) -> T

source

pub fn to_deg(self) -> T

source

pub fn as_deg(self) -> T

source

pub fn to_cdeg(self) -> T

source

pub fn as_cdeg(self) -> T

source

pub fn to_rev(self) -> T

source

pub fn as_rev(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_rad_vec(self) -> T

source

pub fn to_deg_vec(self) -> T

source

pub fn to_cdeg_vec(self) -> T

source

pub fn to_rev_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_s: Self = _

source

pub const UNIT_ms: Self = _

source

pub const UNIT_us: Self = _

source

pub const UNIT_ns: Self = _

source

pub const UNIT_min: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_s(self) -> T

source

pub fn as_s(self) -> T

source

pub fn to_ms(self) -> T

source

pub fn as_ms(self) -> T

source

pub fn to_us(self) -> T

source

pub fn as_us(self) -> T

source

pub fn to_ns(self) -> T

source

pub fn as_ns(self) -> T

source

pub fn to_min(self) -> T

source

pub fn as_min(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_s_vec(self) -> T

source

pub fn to_ms_vec(self) -> T

source

pub fn to_us_vec(self) -> T

source

pub fn to_ns_vec(self) -> T

source

pub fn to_min_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_m: Self = _

source

pub const UNIT_cm: Self = _

source

pub const UNIT_mm: Self = _

source

pub const UNIT_um: Self = _

source

pub const UNIT_in_: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_m(self) -> T

source

pub fn as_m(self) -> T

source

pub fn to_cm(self) -> T

source

pub fn as_cm(self) -> T

source

pub fn to_mm(self) -> T

source

pub fn as_mm(self) -> T

source

pub fn to_um(self) -> T

source

pub fn as_um(self) -> T

source

pub fn to_in_(self) -> T

source

pub fn as_in_(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_m_vec(self) -> T

source

pub fn to_cm_vec(self) -> T

source

pub fn to_mm_vec(self) -> T

source

pub fn to_um_vec(self) -> T

source

pub fn to_in__vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_kg: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_kg(self) -> T

source

pub fn as_kg(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_kg_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_A: Self = _

source

pub const UNIT_mA: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_A(self) -> T

source

pub fn as_A(self) -> T

source

pub fn to_mA(self) -> T

source

pub fn as_mA(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_A_vec(self) -> T

source

pub fn to_mA_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_K: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_K(self) -> T

source

pub fn as_K(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_K_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_m2: Self = _

source

pub const UNIT_in2: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_m2(self) -> T

source

pub fn as_m2(self) -> T

source

pub fn to_in2(self) -> T

source

pub fn as_in2(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_m2_vec(self) -> T

source

pub fn to_in2_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_V: Self = _

source

pub const UNIT_mV: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_V(self) -> T

source

pub fn as_V(self) -> T

source

pub fn to_mV(self) -> T

source

pub fn as_mV(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_V_vec(self) -> T

source

pub fn to_mV_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_radps: Self = _

source

pub const UNIT_degps: Self = _

source

pub const UNIT_cdegps: Self = _

source

pub const UNIT_revps: Self = _

source

pub const UNIT_rpm: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_radps(self) -> T

source

pub fn as_radps(self) -> T

source

pub fn to_degps(self) -> T

source

pub fn as_degps(self) -> T

source

pub fn to_cdegps(self) -> T

source

pub fn as_cdegps(self) -> T

source

pub fn to_revps(self) -> T

source

pub fn as_revps(self) -> T

source

pub fn to_rpm(self) -> T

source

pub fn as_rpm(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_radps_vec(self) -> T

source

pub fn to_degps_vec(self) -> T

source

pub fn to_cdegps_vec(self) -> T

source

pub fn to_revps_vec(self) -> T

source

pub fn to_rpm_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_mps: Self = _

source

pub const UNIT_in_ps: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_mps(self) -> T

source

pub fn as_mps(self) -> T

source

pub fn to_in_ps(self) -> T

source

pub fn as_in_ps(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_mps_vec(self) -> T

source

pub fn to_in_ps_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_W: Self = _

source

pub const UNIT_mW: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_W(self) -> T

source

pub fn as_W(self) -> T

source

pub fn to_mW(self) -> T

source

pub fn as_mW(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_W_vec(self) -> T

source

pub fn to_mW_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_Nm: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_Nm(self) -> T

source

pub fn as_Nm(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_Nm_vec(self) -> T

source§

impl Value<f32, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub const UNIT_mpss: Self = _

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_mpss(self) -> T

source

pub fn as_mpss(self) -> T

source§

impl<T: ComplexField + Copy + SupersetOf<DefaultField>> Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>

source

pub fn to_mpss_vec(self) -> T

source§

impl<T: ComplexField, Q: Quantities> Value<T, Q>

source

pub const fn as_equiv<Q2: Quantities>(&self) -> Value<T, Q2>
where T: Copy,

Converts one Value to a different Value in the same SI unit space The compiler cannot always infer that they are the same

source

pub fn convert<U: ComplexField + SupersetOf<T>>(self) -> Value<U, Q>

source

pub const fn new_si(contents: T) -> Self
where T: Copy,

source

pub const fn into_si(self) -> T
where T: Copy,

source

pub fn abs(self) -> Self
where T: Signed + RealField,

source§

impl<T: ComplexField + Copy + From<f64>, Q: Quantities> Value<T, Q>

Impl ZERO for Value

source

pub const ZERO: Self = _

Trait Implementations§

source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> Add<Value<T, Q2>> for Value<T, Q1>

§

type Output = Value<T, Q1>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Value<T, Q2>) -> Self::Output

Performs the + operation. Read more
source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> AddAssign<Value<T, Q2>> for Value<T, Q1>

source§

fn add_assign(&mut self, rhs: Value<T, Q2>)

Performs the += operation. Read more
source§

impl<T: ComplexField, Q: Quantities> Clone for Value<T, Q>

source§

fn clone(&self) -> Self

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<T: ComplexField + Copy, Q: Quantities> Debug for Value<T, Q>

source§

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

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

impl<T: ComplexField + Default + Copy, Q: Quantities> Default for Value<T, Q>

source§

fn default() -> Self

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

impl<'de, T: ComplexField + Deserialize<'de> + Default + Copy, Q: Quantities> Deserialize<'de> for Value<T, Q>

Available on crate feature serde only.
source§

fn deserialize<D>(deserializer: D) -> Result<Value<T, Q>, D::Error>
where D: Deserializer<'de>,

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

impl<T: ComplexField, Q: Quantities> Div<T> for Value<T, Q>

§

type Output = Value<T, Q>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> Div<Value<T, Q2>> for Value<T, Q1>

§

type Output = Value<T, DivQuantities<Q1, Q2>>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Value<T, Q2>) -> Self::Output

Performs the / operation. Read more
source§

impl<T: ComplexField, Q1: Quantities> DivAssign<T> for Value<T, Q1>

source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> DivAssign<Value<T, Q2>> for Value<T, Q1>

source§

fn div_assign(&mut self, rhs: Value<T, Q2>)

Performs the /= operation. Read more
source§

impl<T: ComplexField, Q: Quantities> HasQuantities for Value<T, Q>

source§

const QUANTITIES: &'static SIQuantity = _

source§

impl<T: ComplexField, Q: Quantities> HasUnderlyingType for Value<T, Q>

source§

impl<T: ComplexField, Q: Quantities> Mul<T> for Value<T, Q>

§

type Output = Value<T, Q>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> Mul<Value<T, Q2>> for Value<T, Q1>
where MulQuantities<Q1, Q2>: Quantities,

§

type Output = Value<T, MulQuantities<Q1, Q2>>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Value<T, Q2>) -> Self::Output

Performs the * operation. Read more
source§

impl<T: ComplexField, Q: Quantities> MulAssign<T> for Value<T, Q>

source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> MulAssign<Value<T, Q2>> for Value<T, Q1>

source§

fn mul_assign(&mut self, rhs: Value<T, Q2>)

Performs the *= operation. Read more
source§

impl<T: ComplexField, Q: Quantities> Neg for Value<T, Q>

§

type Output = Value<T, Q>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<T: ComplexField + One, Q: Quantities> One for Value<T, Q>
where Value<T, Q>: Mul<Output = Value<T, Q>>,

source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> bool
where Value<T, Q>: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
source§

impl<T: ComplexField, Q: Quantities> PartialEq for Value<T, Q>

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<T: ComplexField + PartialOrd, Q: Quantities> PartialOrd for Value<T, Q>

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<T: ComplexField + Rem, Q: Quantities> Rem for Value<T, Q>

§

type Output = Value<T, Q>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl<T: ComplexField + Serialize, Q: Quantities> Serialize for Value<T, Q>

Available on crate feature serde only.
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<T: ComplexField, Q1: Quantities, Q2: Quantities> Sub<Value<T, Q2>> for Value<T, Q1>

§

type Output = Value<T, Q1>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Value<T, Q2>) -> Self::Output

Performs the - operation. Read more
source§

impl<T: ComplexField, Q1: Quantities, Q2: Quantities> SubAssign<Value<T, Q2>> for Value<T, Q1>

source§

fn sub_assign(&mut self, rhs: Value<T, Q2>)

Performs the -= operation. Read more
source§

impl<T, U: ComplexField, Q1: Quantities, Q2: Quantities> SubsetOf<Value<U, Q2>> for Value<T, Q1>
where T: SubsetOf<U> + ComplexField,

source§

fn to_superset(&self) -> Value<U, Q2>

The inclusion map: converts self to the equivalent element of its superset.
source§

fn from_superset_unchecked(element: &Value<U, Q2>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
source§

fn is_in_subset(element: &Value<U, Q2>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

impl<T: ComplexField + Default + Copy, Q: Quantities> Sum for Value<T, Q>

source§

fn sum<I>(iter: I) -> Self
where I: Iterator<Item = Value<T, Q>>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<T: ComplexField + SupersetOf<DefaultField> + Copy> TryFrom<Value<T, UniformQuantities<$crate::macros::make_quantity_mod! { $crate $($content)* }>>> for Duration
where f64: SupersetOf<T>,

§

type Error = TryFromFloatSecsError

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

fn try_from(value: Time<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T: ComplexField, Q: Quantities> ValueType for Value<T, Q>

§

type Q = Q

source§

impl<T: ComplexField + Zero, Q: Quantities> Zero for Value<T, Q>
where Value<T, Q>: Add<Output = Value<T, Q>>,

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

fn is_zero(&self) -> bool
where Value<T, Q>: PartialEq,

Returns true if self is equal to the additive identity.
source§

impl<T: ComplexField + Copy, Q: Quantities> Copy for Value<T, Q>

Auto Trait Implementations§

§

impl<T, Q> RefUnwindSafe for Value<T, Q>

§

impl<T, Q> Send for Value<T, Q>
where Q: Send,

§

impl<T, Q> Sync for Value<T, Q>
where Q: Sync,

§

impl<T, Q> Unpin for Value<T, Q>
where Q: Unpin, T: Unpin,

§

impl<T, Q> UnwindSafe for Value<T, Q>
where Q: UnwindSafe, T: UnwindSafe,

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
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> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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, 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.
source§

impl<T, Right> ClosedAdd<Right> for T
where T: Add<Right, Output = T> + AddAssign<Right>,

source§

impl<T, Right> ClosedDiv<Right> for T
where T: Div<Right, Output = T> + DivAssign<Right>,

source§

impl<T, Right> ClosedMul<Right> for T
where T: Mul<Right, Output = T> + MulAssign<Right>,

source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

source§

impl<T, Right> ClosedSub<Right> for T
where T: Sub<Right, Output = T> + SubAssign<Right>,

source§

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

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,