Struct num_quaternion::Quaternion

source ·
pub struct Quaternion<T> {
    pub w: T,
    pub x: T,
    pub y: T,
    pub z: T,
}
Expand description

Quaternion type.

We follow the naming conventions from Wikipedia for quaternions.

Fields§

§w: T

Real part of the quaternion.

§x: T

The coefficient of $i$.

§y: T

The coefficient of $j$.

§z: T

The coefficient of $k$.

Implementations§

source§

impl<T> Quaternion<T>

source

pub const fn new(w: T, x: T, y: T, z: T) -> Self

Create a new quaternion $a + bi + cj + dk$.

source§

impl<T> Quaternion<T>
where T: ConstZero,

source

pub const ZERO: Self = _

A constant zero Quaternion.

source§

impl<T> Quaternion<T>
where T: ConstZero + ConstOne,

source

pub const ONE: Self = _

A constant Quaternion of value $1$.

See also Quaternion::one().

source

pub const I: Self = _

A constant Quaternion of value $i$.

See also Quaternion::i().

source

pub const J: Self = _

A constant Quaternion of value $j$.

See also Quaternion::j().

source

pub const K: Self = _

A constant Quaternion of value $k$.

See also Quaternion::k().

source§

impl<T> Quaternion<T>
where T: Zero + One,

source

pub fn i() -> Self

Returns the imaginary unit $i$.

See also Quaternion::I.

source

pub fn j() -> Self

Returns the imaginary unit $j$.

See also Quaternion::J.

source

pub fn k() -> Self

Returns the imaginary unit $k$.

See also Quaternion::K.

source§

impl<T> Quaternion<T>
where T: Float,

source

pub fn nan() -> Self

Returns a quaternion filled with NAN values.

source§

impl<T> Quaternion<T>
where T: Clone + Mul<T, Output = T> + Add<T, Output = T>,

source

pub fn norm_sqr(&self) -> T

Returns the square of the norm.

The result is $w^2 + x^2 + y^2 + z^2$ with some rounding errors. The rounding error is at most 2 ulps.

This is guaranteed to be more efficient than norm(). Furthermore, T only needs to support addition and multiplication and therefore, this function works for more types than norm().

source§

impl<T> Quaternion<T>
where T: Clone + Neg<Output = T>,

source

pub fn conj(&self) -> Self

Returns the conjugate quaternion. i.e. the imaginary part is negated.

source§

impl<T> Quaternion<T>
where for<'a> &'a Self: Inv<Output = Quaternion<T>>,

source

pub fn inv(&self) -> Self

Returns the multiplicative inverse 1/self.

source§

impl<T> Quaternion<T>
where T: Float,

source

pub fn norm(self) -> T

Calculates |self|.

The result is $\sqrt{w^2+x^2+y^2+z^2}$ with some possible rounding errors. The rounding error is at most 1.5 ulps.

source

pub fn normalize(self) -> Option<UnitQuaternion<T>>

Normalizes the quaternion to length $1$.

The sign of the real part will be the same as the sign of the input. If the input quaternion

  • is zero, or
  • has infinite length, or
  • has a NaN value, then None will be returned.
source§

impl<T> Quaternion<T>
where T: Num + Clone,

source

pub fn powu(&self, n: u32) -> Self

Raises self to an unsigned integer power n, i. e. $q^n$.

source§

impl<T> Quaternion<T>
where T: Clone + Num + Neg<Output = T>,

source

pub fn powi(&self, n: i32) -> Self

Raises self to a signed integer power n, i. e. $q^n$

For $n=0$ the result is exactly $1$.

Trait Implementations§

source§

impl<T> Add<Quaternion<T>> for UnitQuaternion<T>
where Quaternion<T>: Add<Output = Quaternion<T>>,

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<i128>> for i128

§

type Output = Quaternion<i128>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<i16>> for i16

§

type Output = Quaternion<i16>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<i32>> for i32

§

type Output = Quaternion<i32>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<i64>> for i64

§

type Output = Quaternion<i64>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<i8>> for i8

§

type Output = Quaternion<i8>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<isize>> for isize

§

type Output = Quaternion<isize>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<u128>> for u128

§

type Output = Quaternion<u128>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<u16>> for u16

§

type Output = Quaternion<u16>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<u32>> for u32

§

type Output = Quaternion<u32>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<u64>> for u64

§

type Output = Quaternion<u64>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<u8>> for u8

§

type Output = Quaternion<u8>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<Quaternion<usize>> for usize

§

type Output = Quaternion<usize>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<T> Add<T> for Quaternion<T>
where T: Add<T, Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<T> Add<UnitQuaternion<T>> for Quaternion<T>
where T: Add<T, Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<T> Add for Quaternion<T>
where T: Add<T, Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<T, S> AddAssign<S> for Quaternion<T>
where Self: Add<S, Output = Self> + Clone,

source§

fn add_assign(&mut self, other: S)

Performs the += operation. Read more
source§

impl<T> Borrow<Quaternion<T>> for UnitQuaternion<T>

source§

fn borrow(&self) -> &Quaternion<T>

Immutably borrows from an owned value. Read more
source§

impl<T: Clone> Clone for Quaternion<T>

source§

fn clone(&self) -> Quaternion<T>

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> ConstOne for Quaternion<T>
where T: ConstZero + ConstOne + Num + Clone,

source§

const ONE: Self = Self::ONE

The multiplicative identity element of Self, 1.
source§

impl<T> ConstZero for Quaternion<T>
where T: ConstZero,

source§

const ZERO: Self = Self::ZERO

The additive identity element of Self, 0.
source§

impl<T: Debug> Debug for Quaternion<T>

source§

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

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

impl<T: Default> Default for Quaternion<T>

source§

fn default() -> Quaternion<T>

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

impl<T> Div<Quaternion<T>> for UnitQuaternion<T>
where Quaternion<T>: Div<Output = Quaternion<T>>,

§

type Output = Quaternion<T>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<T> Div<T> for Quaternion<T>
where T: Div<T, Output = T> + Clone,

§

type Output = Quaternion<T>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<T> Div<UnitQuaternion<T>> for Quaternion<T>
where Quaternion<T>: Mul<Output = Quaternion<T>>, T: Neg<Output = T> + Clone,

§

type Output = Quaternion<T>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<T> Div for Quaternion<T>
where T: Num + Clone + Neg<Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<T, S> DivAssign<S> for Quaternion<T>
where Self: Div<S, Output = Self> + Clone,

source§

fn div_assign(&mut self, other: S)

Performs the /= operation. Read more
source§

impl<'a, T> From<&'a T> for Quaternion<T>
where T: Clone + Zero,

source§

fn from(a: &T) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a UnitQuaternion<T>> for &'a Quaternion<T>

source§

fn from(q: &'a UnitQuaternion<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<T> for Quaternion<T>
where T: Zero,

source§

fn from(a: T) -> Self

Converts to this type from the input type.
source§

impl<T> From<UnitQuaternion<T>> for Quaternion<T>

source§

fn from(q: UnitQuaternion<T>) -> Self

Converts to this type from the input type.
source§

impl<T: Hash> Hash for Quaternion<T>

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<T> Inv for &Quaternion<T>
where T: Clone + Neg<Output = T> + Num,

§

type Output = Quaternion<T>

The result after applying the operator.
source§

fn inv(self) -> Self::Output

Returns the multiplicative inverse of self. Read more
source§

impl<T> Inv for Quaternion<T>
where for<'a> &'a Self: Inv<Output = Quaternion<T>>,

§

type Output = Quaternion<T>

The result after applying the operator.
source§

fn inv(self) -> Self::Output

Returns the multiplicative inverse of self. Read more
source§

impl<T> Mul<Quaternion<T>> for UnitQuaternion<T>
where Quaternion<T>: Mul<Output = Quaternion<T>>,

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<i128>> for i128

§

type Output = Quaternion<i128>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<i16>> for i16

§

type Output = Quaternion<i16>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<i32>> for i32

§

type Output = Quaternion<i32>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<i64>> for i64

§

type Output = Quaternion<i64>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<i8>> for i8

§

type Output = Quaternion<i8>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<isize>> for isize

§

type Output = Quaternion<isize>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<u128>> for u128

§

type Output = Quaternion<u128>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<u16>> for u16

§

type Output = Quaternion<u16>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<u32>> for u32

§

type Output = Quaternion<u32>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<u64>> for u64

§

type Output = Quaternion<u64>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<u8>> for u8

§

type Output = Quaternion<u8>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Quaternion<usize>> for usize

§

type Output = Quaternion<usize>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<T> Mul<T> for Quaternion<T>
where T: Mul<T, Output = T> + Clone,

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<T> Mul<UnitQuaternion<T>> for Quaternion<T>
where Quaternion<T>: Mul<Output = Quaternion<T>>,

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<T> Mul for Quaternion<T>
where T: Add<T, Output = T> + Sub<T, Output = T> + Mul<T, Output = T> + Clone,

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<T, S> MulAssign<S> for Quaternion<T>
where Self: Mul<S, Output = Self> + Clone,

source§

fn mul_assign(&mut self, other: S)

Performs the *= operation. Read more
source§

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

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<T> One for Quaternion<T>
where T: Num + Clone,

source§

fn one() -> Self

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

fn is_one(&self) -> bool

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

fn set_one(&mut self)

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

impl<T: PartialEq> PartialEq for Quaternion<T>

source§

fn eq(&self, other: &Quaternion<T>) -> 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> Sub<Quaternion<T>> for UnitQuaternion<T>
where Quaternion<T>: Sub<Output = Quaternion<T>>,

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<i128>> for i128

§

type Output = Quaternion<i128>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<i16>> for i16

§

type Output = Quaternion<i16>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<i32>> for i32

§

type Output = Quaternion<i32>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<i64>> for i64

§

type Output = Quaternion<i64>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<i8>> for i8

§

type Output = Quaternion<i8>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<isize>> for isize

§

type Output = Quaternion<isize>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<u128>> for u128

§

type Output = Quaternion<u128>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<u16>> for u16

§

type Output = Quaternion<u16>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<u32>> for u32

§

type Output = Quaternion<u32>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<u64>> for u64

§

type Output = Quaternion<u64>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<u8>> for u8

§

type Output = Quaternion<u8>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<Quaternion<usize>> for usize

§

type Output = Quaternion<usize>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<T> Sub<T> for Quaternion<T>
where T: Sub<T, Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<T> Sub<UnitQuaternion<T>> for Quaternion<T>
where T: Sub<T, Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<T> Sub for Quaternion<T>
where T: Sub<T, Output = T>,

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<T, S> SubAssign<S> for Quaternion<T>
where Self: Sub<S, Output = Self> + Clone,

source§

fn sub_assign(&mut self, other: S)

Performs the -= operation. Read more
source§

impl<T> Zero for Quaternion<T>
where T: Zero,

source§

fn zero() -> Self

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

fn is_zero(&self) -> bool

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

fn set_zero(&mut self)

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

impl<T: Copy> Copy for Quaternion<T>

source§

impl<T: Eq> Eq for Quaternion<T>

source§

impl<T> StructuralPartialEq for Quaternion<T>

Auto Trait Implementations§

§

impl<T> Freeze for Quaternion<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Quaternion<T>
where T: RefUnwindSafe,

§

impl<T> Send for Quaternion<T>
where T: Send,

§

impl<T> Sync for Quaternion<T>
where T: Sync,

§

impl<T> Unpin for Quaternion<T>
where T: Unpin,

§

impl<T> UnwindSafe for Quaternion<T>
where 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> 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.