Struct jumpy::core::physics::rapier::nalgebra::Quaternion

source ·
#[repr(C)]
pub struct Quaternion<T> { pub coords: Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>, }
Expand description

A quaternion. See the type alias UnitQuaternion = Unit<Quaternion> for a quaternion that may be used as a rotation.

Fields§

§coords: Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>

This quaternion as a 4D vector of coordinates in the [ x, y, z, w ] storage order.

Implementations§

source§

impl<T> Quaternion<T>

source

pub fn into_owned(self) -> Quaternion<T>

👎Deprecated: This method is a no-op and will be removed in a future release.

Moves this unit quaternion into one that owns its data.

source

pub fn clone_owned(&self) -> Quaternion<T>

👎Deprecated: This method is a no-op and will be removed in a future release.

Clones this unit quaternion into one that owns its data.

source

pub fn normalize(&self) -> Quaternion<T>

Normalizes this quaternion.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let q_normalized = q.normalize();
relative_eq!(q_normalized.norm(), 1.0);
source

pub fn imag(&self) -> Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The imaginary part of this quaternion.

source

pub fn conjugate(&self) -> Quaternion<T>

The conjugate of this quaternion.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let conj = q.conjugate();
assert!(conj.i == -2.0 && conj.j == -3.0 && conj.k == -4.0 && conj.w == 1.0);
source

pub fn lerp(&self, other: &Quaternion<T>, t: T) -> Quaternion<T>

Linear interpolation between two quaternion.

Computes self * (1 - t) + other * t.

§Example
let q1 = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let q2 = Quaternion::new(10.0, 20.0, 30.0, 40.0);

assert_eq!(q1.lerp(&q2, 0.1), Quaternion::new(1.9, 3.8, 5.7, 7.6));
source

pub fn vector( &self, ) -> Matrix<T, Const<3>, Const<1>, ViewStorage<'_, T, Const<3>, Const<1>, <<DefaultAllocator as Allocator<T, Const<4>>>::Buffer as RawStorage<T, Const<4>>>::RStride, <<DefaultAllocator as Allocator<T, Const<4>>>::Buffer as RawStorage<T, Const<4>>>::CStride>>

The vector part (i, j, k) of this quaternion.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_eq!(q.vector()[0], 2.0);
assert_eq!(q.vector()[1], 3.0);
assert_eq!(q.vector()[2], 4.0);
source

pub fn scalar(&self) -> T

The scalar part w of this quaternion.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_eq!(q.scalar(), 1.0);
source

pub fn as_vector(&self) -> &Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>

Reinterprets this quaternion as a 4D vector.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
// Recall that the quaternion is stored internally as (i, j, k, w)
// while the crate::new constructor takes the arguments as (w, i, j, k).
assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0));
source

pub fn norm(&self) -> T

The norm of this quaternion.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_relative_eq!(q.norm(), 5.47722557, epsilon = 1.0e-6);
source

pub fn magnitude(&self) -> T

A synonym for the norm of this quaternion.

Aka the length. This is the same as .norm()

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_relative_eq!(q.magnitude(), 5.47722557, epsilon = 1.0e-6);
source

pub fn norm_squared(&self) -> T

The squared norm of this quaternion.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_eq!(q.magnitude_squared(), 30.0);
source

pub fn magnitude_squared(&self) -> T

A synonym for the squared norm of this quaternion.

Aka the squared length. This is the same as .norm_squared()

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_eq!(q.magnitude_squared(), 30.0);
source

pub fn dot(&self, rhs: &Quaternion<T>) -> T

The dot product of two quaternions.

§Example
let q1 = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let q2 = Quaternion::new(5.0, 6.0, 7.0, 8.0);
assert_eq!(q1.dot(&q2), 70.0);
source§

impl<T> Quaternion<T>

source

pub fn try_inverse(&self) -> Option<Quaternion<T>>
where T: RealField,

Inverts this quaternion if it is not zero.

This method also does not works with SIMD components (see simd_try_inverse instead).

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let inv_q = q.try_inverse();

assert!(inv_q.is_some());
assert_relative_eq!(inv_q.unwrap() * q, Quaternion::identity());

//Non-invertible case
let q = Quaternion::new(0.0, 0.0, 0.0, 0.0);
let inv_q = q.try_inverse();

assert!(inv_q.is_none());
source

pub fn simd_try_inverse(&self) -> SimdOption<Quaternion<T>>

Attempt to inverse this quaternion.

This method also works with SIMD components.

source

pub fn inner(&self, other: &Quaternion<T>) -> Quaternion<T>

Calculates the inner product (also known as the dot product). See “Foundations of Game Engine Development, Volume 1: Mathematics” by Lengyel Formula 4.89.

§Example
let a = Quaternion::new(0.0, 2.0, 3.0, 4.0);
let b = Quaternion::new(0.0, 5.0, 2.0, 1.0);
let expected = Quaternion::new(-20.0, 0.0, 0.0, 0.0);
let result = a.inner(&b);
assert_relative_eq!(expected, result, epsilon = 1.0e-5);
source

pub fn outer(&self, other: &Quaternion<T>) -> Quaternion<T>

Calculates the outer product (also known as the wedge product). See “Foundations of Game Engine Development, Volume 1: Mathematics” by Lengyel Formula 4.89.

§Example
let a = Quaternion::new(0.0, 2.0, 3.0, 4.0);
let b = Quaternion::new(0.0, 5.0, 2.0, 1.0);
let expected = Quaternion::new(0.0, -5.0, 18.0, -11.0);
let result = a.outer(&b);
assert_relative_eq!(expected, result, epsilon = 1.0e-5);
source

pub fn project(&self, other: &Quaternion<T>) -> Option<Quaternion<T>>
where T: RealField,

Calculates the projection of self onto other (also known as the parallel). See “Foundations of Game Engine Development, Volume 1: Mathematics” by Lengyel Formula 4.94.

§Example
let a = Quaternion::new(0.0, 2.0, 3.0, 4.0);
let b = Quaternion::new(0.0, 5.0, 2.0, 1.0);
let expected = Quaternion::new(0.0, 3.333333333333333, 1.3333333333333333, 0.6666666666666666);
let result = a.project(&b).unwrap();
assert_relative_eq!(expected, result, epsilon = 1.0e-5);
source

pub fn reject(&self, other: &Quaternion<T>) -> Option<Quaternion<T>>
where T: RealField,

Calculates the rejection of self from other (also known as the perpendicular). See “Foundations of Game Engine Development, Volume 1: Mathematics” by Lengyel Formula 4.94.

§Example
let a = Quaternion::new(0.0, 2.0, 3.0, 4.0);
let b = Quaternion::new(0.0, 5.0, 2.0, 1.0);
let expected = Quaternion::new(0.0, -1.3333333333333333, 1.6666666666666665, 3.3333333333333335);
let result = a.reject(&b).unwrap();
assert_relative_eq!(expected, result, epsilon = 1.0e-5);
source

pub fn polar_decomposition( &self, ) -> (T, T, Option<Unit<Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>>>)
where T: RealField,

The polar decomposition of this quaternion.

Returns, from left to right: the quaternion norm, the half rotation angle, the rotation axis. If the rotation angle is zero, the rotation axis is set to None.

§Example
let q = Quaternion::new(0.0, 5.0, 0.0, 0.0);
let (norm, half_ang, axis) = q.polar_decomposition();
assert_eq!(norm, 5.0);
assert_eq!(half_ang, f32::consts::FRAC_PI_2);
assert_eq!(axis, Some(Vector3::x_axis()));
source

pub fn ln(&self) -> Quaternion<T>

Compute the natural logarithm of a quaternion.

§Example
let q = Quaternion::new(2.0, 5.0, 0.0, 0.0);
assert_relative_eq!(q.ln(), Quaternion::new(1.683647, 1.190289, 0.0, 0.0), epsilon = 1.0e-6)
source

pub fn exp(&self) -> Quaternion<T>

Compute the exponential of a quaternion.

§Example
let q = Quaternion::new(1.683647, 1.190289, 0.0, 0.0);
assert_relative_eq!(q.exp(), Quaternion::new(2.0, 5.0, 0.0, 0.0), epsilon = 1.0e-5)
source

pub fn exp_eps(&self, eps: T) -> Quaternion<T>

Compute the exponential of a quaternion. Returns the identity if the vector part of this quaternion has a norm smaller than eps.

§Example
let q = Quaternion::new(1.683647, 1.190289, 0.0, 0.0);
assert_relative_eq!(q.exp_eps(1.0e-6), Quaternion::new(2.0, 5.0, 0.0, 0.0), epsilon = 1.0e-5);

// Singular case.
let q = Quaternion::new(0.0000001, 0.0, 0.0, 0.0);
assert_eq!(q.exp_eps(1.0e-6), Quaternion::identity());
source

pub fn powf(&self, n: T) -> Quaternion<T>

Raise the quaternion to a given floating power.

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert_relative_eq!(q.powf(1.5), Quaternion::new( -6.2576659, 4.1549037, 6.2323556, 8.3098075), epsilon = 1.0e-6);
source

pub fn as_vector_mut( &mut self, ) -> &mut Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>

Transforms this quaternion into its 4D vector form (Vector part, Scalar part).

§Example
let mut q = Quaternion::identity();
*q.as_vector_mut() = Vector4::new(1.0, 2.0, 3.0, 4.0);
assert!(q.i == 1.0 && q.j == 2.0 && q.k == 3.0 && q.w == 4.0);
source

pub fn vector_mut( &mut self, ) -> Matrix<T, Const<3>, Const<1>, ViewStorageMut<'_, T, Const<3>, Const<1>, <<DefaultAllocator as Allocator<T, Const<4>>>::Buffer as RawStorage<T, Const<4>>>::RStride, <<DefaultAllocator as Allocator<T, Const<4>>>::Buffer as RawStorage<T, Const<4>>>::CStride>>

The mutable vector part (i, j, k) of this quaternion.

§Example
let mut q = Quaternion::identity();
{
    let mut v = q.vector_mut();
    v[0] = 2.0;
    v[1] = 3.0;
    v[2] = 4.0;
}
assert!(q.i == 2.0 && q.j == 3.0 && q.k == 4.0 && q.w == 1.0);
source

pub fn conjugate_mut(&mut self)

Replaces this quaternion by its conjugate.

§Example
let mut q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
q.conjugate_mut();
assert!(q.i == -2.0 && q.j == -3.0 && q.k == -4.0 && q.w == 1.0);
source

pub fn try_inverse_mut(&mut self) -> <T as SimdValue>::SimdBool

Inverts this quaternion in-place if it is not zero.

§Example
let mut q = Quaternion::new(1.0f32, 2.0, 3.0, 4.0);

assert!(q.try_inverse_mut());
assert_relative_eq!(q * Quaternion::new(1.0, 2.0, 3.0, 4.0), Quaternion::identity());

//Non-invertible case
let mut q = Quaternion::new(0.0f32, 0.0, 0.0, 0.0);
assert!(!q.try_inverse_mut());
source

pub fn normalize_mut(&mut self) -> T

Normalizes this quaternion.

§Example
let mut q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
q.normalize_mut();
assert_relative_eq!(q.norm(), 1.0);
source

pub fn squared(&self) -> Quaternion<T>

Calculates square of a quaternion.

source

pub fn half(&self) -> Quaternion<T>

Divides quaternion into two.

source

pub fn sqrt(&self) -> Quaternion<T>

Calculates square root.

source

pub fn is_pure(&self) -> bool

Check if the quaternion is pure.

A quaternion is pure if it has no real part (self.w == 0.0).

source

pub fn pure(&self) -> Quaternion<T>

Convert quaternion to pure quaternion.

source

pub fn left_div(&self, other: &Quaternion<T>) -> Option<Quaternion<T>>
where T: RealField,

Left quaternionic division.

Calculates B-1 * A where A = self, B = other.

source

pub fn right_div(&self, other: &Quaternion<T>) -> Option<Quaternion<T>>
where T: RealField,

Right quaternionic division.

Calculates A * B-1 where A = self, B = other.

§Example
let a = Quaternion::new(0.0, 1.0, 2.0, 3.0);
let b = Quaternion::new(0.0, 5.0, 2.0, 1.0);
let result = a.right_div(&b).unwrap();
let expected = Quaternion::new(0.4, 0.13333333333333336, -0.4666666666666667, 0.26666666666666666);
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn cos(&self) -> Quaternion<T>

Calculates the quaternionic cosinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(58.93364616794395, -34.086183690465596, -51.1292755356984, -68.17236738093119);
let result = input.cos();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn acos(&self) -> Quaternion<T>

Calculates the quaternionic arccosinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let result = input.cos().acos();
assert_relative_eq!(input, result, epsilon = 1.0e-7);
source

pub fn sin(&self) -> Quaternion<T>

Calculates the quaternionic sinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(91.78371578403467, 21.886486853029176, 32.82973027954377, 43.77297370605835);
let result = input.sin();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn asin(&self) -> Quaternion<T>

Calculates the quaternionic arcsinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let result = input.sin().asin();
assert_relative_eq!(input, result, epsilon = 1.0e-7);
source

pub fn tan(&self) -> Quaternion<T>
where T: RealField,

Calculates the quaternionic tangent.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(0.00003821631725009489, 0.3713971716439371, 0.5570957574659058, 0.7427943432878743);
let result = input.tan();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn atan(&self) -> Quaternion<T>
where T: RealField,

Calculates the quaternionic arctangent.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let result = input.tan().atan();
assert_relative_eq!(input, result, epsilon = 1.0e-7);
source

pub fn sinh(&self) -> Quaternion<T>

Calculates the hyperbolic quaternionic sinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(0.7323376060463428, -0.4482074499805421, -0.6723111749708133, -0.8964148999610843);
let result = input.sinh();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn asinh(&self) -> Quaternion<T>

Calculates the hyperbolic quaternionic arcsinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(2.385889902585242, 0.514052600662788, 0.7710789009941821, 1.028105201325576);
let result = input.asinh();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn cosh(&self) -> Quaternion<T>

Calculates the hyperbolic quaternionic cosinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(0.9615851176369566, -0.3413521745610167, -0.5120282618415251, -0.6827043491220334);
let result = input.cosh();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn acosh(&self) -> Quaternion<T>

Calculates the hyperbolic quaternionic arccosinus.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(2.4014472020074007, 0.5162761016176176, 0.7744141524264264, 1.0325522032352352);
let result = input.acosh();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn tanh(&self) -> Quaternion<T>
where T: RealField,

Calculates the hyperbolic quaternionic tangent.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(1.0248695360556623, -0.10229568178876419, -0.1534435226831464, -0.20459136357752844);
let result = input.tanh();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source

pub fn atanh(&self) -> Quaternion<T>

Calculates the hyperbolic quaternionic arctangent.

§Example
let input = Quaternion::new(1.0, 2.0, 3.0, 4.0);
let expected = Quaternion::new(0.03230293287000163, 0.5173453683196951, 0.7760180524795426, 1.0346907366393903);
let result = input.atanh();
assert_relative_eq!(expected, result, epsilon = 1.0e-7);
source§

impl<T> Quaternion<T>

source

pub const fn from_vector( vector: Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>, ) -> Quaternion<T>

Creates a quaternion from a 4D vector. The quaternion scalar part corresponds to the w vector component.

source

pub const fn new(w: T, i: T, j: T, k: T) -> Quaternion<T>

Creates a new quaternion from its individual components. Note that the arguments order does not follow the storage order.

The storage order is [ i, j, k, w ] while the arguments for this functions are in the order (w, i, j, k).

§Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
assert!(q.i == 2.0 && q.j == 3.0 && q.k == 4.0 && q.w == 1.0);
assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0));
source

pub fn cast<To>(self) -> Quaternion<To>
where To: Scalar + SupersetOf<T>, T: Scalar,

Cast the components of self to another type.

§Example
let q = Quaternion::new(1.0f64, 2.0, 3.0, 4.0);
let q2 = q.cast::<f32>();
assert_eq!(q2, Quaternion::new(1.0f32, 2.0, 3.0, 4.0));
source§

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

source

pub fn from_imag( vector: Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>, ) -> Quaternion<T>

Constructs a pure quaternion.

source

pub fn from_parts<SB>( scalar: T, vector: Matrix<T, Const<3>, Const<1>, SB>, ) -> Quaternion<T>
where SB: Storage<T, Const<3>>,

Creates a new quaternion from its scalar and vector parts. Note that the arguments order does not follow the storage order.

The storage order is [ vector, scalar ].

§Example
let w = 1.0;
let ijk = Vector3::new(2.0, 3.0, 4.0);
let q = Quaternion::from_parts(w, ijk);
assert!(q.i == 2.0 && q.j == 3.0 && q.k == 4.0 && q.w == 1.0);
assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0));
source

pub fn from_real(r: T) -> Quaternion<T>

Constructs a real quaternion.

source

pub fn identity() -> Quaternion<T>

The quaternion multiplicative identity.

§Example
let q = Quaternion::identity();
let q2 = Quaternion::new(1.0, 2.0, 3.0, 4.0);

assert_eq!(q * q2, q2);
assert_eq!(q2 * q, q2);
source§

impl<T> Quaternion<T>

source

pub fn from_polar_decomposition<SB>( scale: T, theta: T, axis: Unit<Matrix<T, Const<3>, Const<1>, SB>>, ) -> Quaternion<T>
where SB: Storage<T, Const<3>>,

Creates a new quaternion from its polar decomposition.

Note that axis is assumed to be a unit vector.

Trait Implementations§

source§

impl<T> AbsDiffEq for Quaternion<T>
where T: RealField<Epsilon = T> + AbsDiffEq,

§

type Epsilon = T

Used for specifying relative comparisons.
source§

fn default_epsilon() -> <Quaternion<T> as AbsDiffEq>::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn abs_diff_eq( &self, other: &Quaternion<T>, epsilon: <Quaternion<T> as AbsDiffEq>::Epsilon, ) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of [AbsDiffEq::abs_diff_eq].
source§

impl<'a, 'b, T> Add<&'b Quaternion<T>> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

fn add( self, rhs: &'b Quaternion<T>, ) -> <&'a Quaternion<T> as Add<&'b Quaternion<T>>>::Output

Performs the + operation. Read more
source§

impl<'b, T> Add<&'b Quaternion<T>> for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

fn add( self, rhs: &'b Quaternion<T>, ) -> <Quaternion<T> as Add<&'b Quaternion<T>>>::Output

Performs the + operation. Read more
source§

impl<'a, T> Add<Quaternion<T>> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

fn add( self, rhs: Quaternion<T>, ) -> <&'a Quaternion<T> as Add<Quaternion<T>>>::Output

Performs the + operation. Read more
source§

impl<T> Add for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<'b, T> AddAssign<&'b Quaternion<T>> for Quaternion<T>

source§

fn add_assign(&mut self, rhs: &'b Quaternion<T>)

Performs the += operation. Read more
source§

impl<T> AddAssign for Quaternion<T>

source§

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

Performs the += operation. Read more
source§

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

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> Debug for Quaternion<T>
where T: Debug,

source§

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

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

impl<T> Default for Quaternion<T>
where T: Scalar + Zero,

source§

fn default() -> Quaternion<T>

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

impl<T> Deref for Quaternion<T>
where T: Scalar + SimdValue,

§

type Target = IJKW<T>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Quaternion<T> as Deref>::Target

Dereferences the value.
source§

impl<T> DerefMut for Quaternion<T>
where T: Scalar + SimdValue,

source§

fn deref_mut(&mut self) -> &mut <Quaternion<T> as Deref>::Target

Mutably dereferences the value.
source§

impl<T> Display for Quaternion<T>
where T: RealField + Display,

source§

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

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

impl<'a, T> Div<T> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the / operator.
source§

fn div(self, n: T) -> <&'a Quaternion<T> as Div<T>>::Output

Performs the / operation. Read more
source§

impl<T> Div<T> for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the / operator.
source§

fn div(self, n: T) -> <Quaternion<T> as Div<T>>::Output

Performs the / operation. Read more
source§

impl<T> DivAssign<T> for Quaternion<T>

source§

fn div_assign(&mut self, n: T)

Performs the /= operation. Read more
source§

impl<T> From<[Quaternion<<T as SimdValue>::Element>; 16]> for Quaternion<T>
where T: Scalar + PrimitiveSimdValue + From<[<T as SimdValue>::Element; 16]>, <T as SimdValue>::Element: Scalar + Copy,

source§

fn from(arr: [Quaternion<<T as SimdValue>::Element>; 16]) -> Quaternion<T>

Converts to this type from the input type.
source§

impl<T> From<[Quaternion<<T as SimdValue>::Element>; 2]> for Quaternion<T>
where T: Scalar + PrimitiveSimdValue + From<[<T as SimdValue>::Element; 2]>, <T as SimdValue>::Element: Scalar + Copy,

source§

fn from(arr: [Quaternion<<T as SimdValue>::Element>; 2]) -> Quaternion<T>

Converts to this type from the input type.
source§

impl<T> From<[Quaternion<<T as SimdValue>::Element>; 4]> for Quaternion<T>
where T: Scalar + PrimitiveSimdValue + From<[<T as SimdValue>::Element; 4]>, <T as SimdValue>::Element: Scalar + Copy,

source§

fn from(arr: [Quaternion<<T as SimdValue>::Element>; 4]) -> Quaternion<T>

Converts to this type from the input type.
source§

impl<T> From<[Quaternion<<T as SimdValue>::Element>; 8]> for Quaternion<T>
where T: Scalar + PrimitiveSimdValue + From<[<T as SimdValue>::Element; 8]>, <T as SimdValue>::Element: Scalar + Copy,

source§

fn from(arr: [Quaternion<<T as SimdValue>::Element>; 8]) -> Quaternion<T>

Converts to this type from the input type.
source§

impl<T> From<[T; 4]> for Quaternion<T>
where T: Scalar,

source§

fn from(coords: [T; 4]) -> Quaternion<T>

Converts to this type from the input type.
source§

impl From<DQuat> for Quaternion<f64>

source§

fn from(e: DQuat) -> Quaternion<f64>

Converts to this type from the input type.
source§

impl<T> From<Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>> for Quaternion<T>
where T: Scalar,

source§

fn from( coords: Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>, ) -> Quaternion<T>

Converts to this type from the input type.
source§

impl From<Quat> for Quaternion<f32>

source§

fn from(e: Quat) -> Quaternion<f32>

Converts to this type from the input type.
source§

impl From<Quaternion<f32>> for Quat

source§

fn from(e: Quaternion<f32>) -> Quat

Converts to this type from the input type.
source§

impl From<Quaternion<f64>> for DQuat

source§

fn from(e: Quaternion<f64>) -> DQuat

Converts to this type from the input type.
source§

impl<T> Hash for Quaternion<T>
where T: Scalar + Hash,

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<T> Index<usize> for Quaternion<T>
where T: Scalar,

§

type Output = T

The returned type after indexing.
source§

fn index(&self, i: usize) -> &<Quaternion<T> as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T> IndexMut<usize> for Quaternion<T>
where T: Scalar,

source§

fn index_mut(&mut self, i: usize) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, 'b, T> Mul<&'b Quaternion<T>> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

fn mul( self, rhs: &'b Quaternion<T>, ) -> <&'a Quaternion<T> as Mul<&'b Quaternion<T>>>::Output

Performs the * operation. Read more
source§

impl<'b, T> Mul<&'b Quaternion<T>> for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

fn mul( self, rhs: &'b Quaternion<T>, ) -> <Quaternion<T> as Mul<&'b Quaternion<T>>>::Output

Performs the * operation. Read more
source§

impl<'a, T> Mul<Quaternion<T>> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

fn mul( self, rhs: Quaternion<T>, ) -> <&'a Quaternion<T> as Mul<Quaternion<T>>>::Output

Performs the * operation. Read more
source§

impl<'a, T> Mul<T> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

fn mul(self, n: T) -> <&'a Quaternion<T> as Mul<T>>::Output

Performs the * operation. Read more
source§

impl<T> Mul<T> for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

fn mul(self, n: T) -> <Quaternion<T> as Mul<T>>::Output

Performs the * operation. Read more
source§

impl<T> Mul for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<'b, T> MulAssign<&'b Quaternion<T>> for Quaternion<T>

source§

fn mul_assign(&mut self, rhs: &'b Quaternion<T>)

Performs the *= operation. Read more
source§

impl<T> MulAssign<T> for Quaternion<T>

source§

fn mul_assign(&mut self, n: T)

Performs the *= operation. Read more
source§

impl<T> MulAssign for Quaternion<T>

source§

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

Performs the *= operation. Read more
source§

impl<'a, T> Neg for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> <&'a Quaternion<T> as Neg>::Output

Performs the unary - operation. Read more
source§

impl<T> Neg for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> <Quaternion<T> as Neg>::Output

Performs the unary - operation. Read more
source§

impl<T> Normed for Quaternion<T>
where T: SimdRealField,

§

type Norm = <T as SimdComplexField>::SimdRealField

The type of the norm.
source§

fn norm(&self) -> <T as SimdComplexField>::SimdRealField

Computes the norm.
source§

fn norm_squared(&self) -> <T as SimdComplexField>::SimdRealField

Computes the squared norm.
source§

fn scale_mut(&mut self, n: <Quaternion<T> as Normed>::Norm)

Multiply self by n.
source§

fn unscale_mut(&mut self, n: <Quaternion<T> as Normed>::Norm)

Divides self by n.
source§

impl<T> One for Quaternion<T>

source§

fn one() -> Quaternion<T>

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 Self: PartialEq,

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

impl<T> PartialEq for Quaternion<T>
where T: Scalar,

source§

fn eq(&self, right: &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> RelativeEq for Quaternion<T>
where T: RealField<Epsilon = T> + RelativeEq,

source§

fn default_max_relative() -> <Quaternion<T> as AbsDiffEq>::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn relative_eq( &self, other: &Quaternion<T>, epsilon: <Quaternion<T> as AbsDiffEq>::Epsilon, max_relative: <Quaternion<T> as AbsDiffEq>::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of [RelativeEq::relative_eq].
source§

impl<T> SimdValue for Quaternion<T>
where T: Scalar + SimdValue, <T as SimdValue>::Element: Scalar,

§

type Element = Quaternion<<T as SimdValue>::Element>

The type of the elements of each lane of this SIMD value.
§

type SimdBool = <T as SimdValue>::SimdBool

Type of the result of comparing two SIMD values like self.
source§

fn lanes() -> usize

The number of lanes of this SIMD value.
source§

fn splat(val: <Quaternion<T> as SimdValue>::Element) -> Quaternion<T>

Initializes an SIMD value with each lanes set to val.
source§

fn extract(&self, i: usize) -> <Quaternion<T> as SimdValue>::Element

Extracts the i-th lane of self. Read more
source§

unsafe fn extract_unchecked( &self, i: usize, ) -> <Quaternion<T> as SimdValue>::Element

Extracts the i-th lane of self without bound-checking.
source§

fn replace(&mut self, i: usize, val: <Quaternion<T> as SimdValue>::Element)

Replaces the i-th lane of self by val. Read more
source§

unsafe fn replace_unchecked( &mut self, i: usize, val: <Quaternion<T> as SimdValue>::Element, )

Replaces the i-th lane of self by val without bound-checking.
source§

fn select( self, cond: <Quaternion<T> as SimdValue>::SimdBool, other: Quaternion<T>, ) -> Quaternion<T>

Merges self and other depending on the lanes of cond. Read more
§

fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
where Self: Clone,

Applies a function to each lane of self. Read more
§

fn zip_map_lanes( self, b: Self, f: impl Fn(Self::Element, Self::Element) -> Self::Element, ) -> Self
where Self: Clone,

Applies a function to each lane of self paired with the corresponding lane of b. Read more
source§

impl<'a, 'b, T> Sub<&'b Quaternion<T>> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

fn sub( self, rhs: &'b Quaternion<T>, ) -> <&'a Quaternion<T> as Sub<&'b Quaternion<T>>>::Output

Performs the - operation. Read more
source§

impl<'b, T> Sub<&'b Quaternion<T>> for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

fn sub( self, rhs: &'b Quaternion<T>, ) -> <Quaternion<T> as Sub<&'b Quaternion<T>>>::Output

Performs the - operation. Read more
source§

impl<'a, T> Sub<Quaternion<T>> for &'a Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

fn sub( self, rhs: Quaternion<T>, ) -> <&'a Quaternion<T> as Sub<Quaternion<T>>>::Output

Performs the - operation. Read more
source§

impl<T> Sub for Quaternion<T>

§

type Output = Quaternion<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<'b, T> SubAssign<&'b Quaternion<T>> for Quaternion<T>

source§

fn sub_assign(&mut self, rhs: &'b Quaternion<T>)

Performs the -= operation. Read more
source§

impl<T> SubAssign for Quaternion<T>

source§

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

Performs the -= operation. Read more
source§

impl<T1, T2> SubsetOf<Quaternion<T2>> for Quaternion<T1>
where T1: Scalar, T2: Scalar + SupersetOf<T1>,

source§

fn to_superset(&self) -> Quaternion<T2>

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

fn is_in_subset(q: &Quaternion<T2>) -> bool

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

fn from_superset_unchecked(q: &Quaternion<T2>) -> Quaternion<T1>

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

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> UlpsEq for Quaternion<T>
where T: RealField<Epsilon = T> + UlpsEq,

source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

fn ulps_eq( &self, other: &Quaternion<T>, epsilon: <Quaternion<T> as AbsDiffEq>::Epsilon, max_ulps: u32, ) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
§

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of [UlpsEq::ulps_eq].
source§

impl<T> Zero for Quaternion<T>

source§

fn zero() -> Quaternion<T>

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 for Quaternion<T>
where T: Copy,

source§

impl<T> Eq for Quaternion<T>
where T: Scalar + Eq,

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U

Return the T [ShaderType] for self. When used in [AsBindGroup] derives, it is safe to assume that all images in self exist.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

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

§

impl<T> DynEq for T
where T: Any + Eq,

§

fn as_any(&self) -> &(dyn Any + 'static)

Casts the type to dyn Any.
§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
§

impl<T> DynHash for T
where T: DynEq + Hash,

§

fn as_dyn_eq(&self) -> &(dyn DynEq + 'static)

Casts the type to dyn Any.
§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feeds this value into the given Hasher.
§

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

§

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

Checks if this value is equivalent to the given key. Read more
§

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

§

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

Compare self to key and return true if they are equal.
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.
§

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

§

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

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using data from the given [World]
§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &World) -> T

Creates Self using data from the given World.
§

impl<T> Instrument for T

§

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

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

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

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> One for T
where T: One,

§

fn one() -> T

§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

unsafe fn raw_clone(src: *const c_void, dst: *mut c_void)

Write the default value of the type to the pointer. Read more
§

fn raw_clone_cb() -> Unsafe<&'static (dyn Fn(*const c_void, *mut c_void) + Send + Sync)>

Get a callback suitable for [SchemaData].
§

impl<T> RawDefault for T
where T: Default,

§

unsafe fn raw_default(dst: *mut c_void)

Write the default value of the type to the pointer. Read more
§

fn raw_default_cb() -> Unsafe<&'static (dyn Fn(*mut c_void) + Send + Sync)>

Get a callback suitable for [SchemaData].
§

impl<T> RawDrop for T

§

unsafe fn raw_drop(ptr: *mut c_void)

Write the default value of the type to the pointer. Read more
§

fn raw_drop_cb() -> Unsafe<&'static (dyn Fn(*mut c_void) + Send + Sync)>

Get a callback suitable for [SchemaData].
§

impl<T> RawEq for T
where T: Eq,

§

unsafe fn raw_eq(a: *const c_void, b: *const c_void) -> bool

Get the hash of the type. Read more
§

fn raw_eq_cb() -> Unsafe<&'static (dyn Fn(*const c_void, *const c_void) -> bool + Send + Sync)>

Get a callback suitable for [SchemaData].
§

impl<T> RawHash for T
where T: Hash,

§

unsafe fn raw_hash(ptr: *const c_void) -> u64

Get the hash of the type. Read more
§

fn raw_hash_cb() -> Unsafe<&'static (dyn Fn(*const c_void) -> u64 + Send + Sync)>

Get a callback suitable for [SchemaData].
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<'gc, T> Singleton<'gc> for T
where T: Default,

§

fn create(_: Context<'gc>) -> T

§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

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

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

§

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

§

fn to_smolstr(&self) -> SmolStr

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
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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> TypeData for T
where T: 'static + Send + Sync + Clone,

§

fn clone_type_data(&self) -> Box<dyn TypeData>

§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

§

fn zero() -> T

§

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

§

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

§

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

§

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

§

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

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

source§

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

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,