Struct AngularInertiaTensor

Source
pub struct AngularInertiaTensor(/* private fields */);
Expand description

The 3x3 angular inertia tensor of a 3D object, representing resistance to angular acceleration.

The inertia tensor is a symmetric, positive-semidefinite matrix that describes the moment of inertia for rotations about the X, Y, and Z axes. By diagonalizing this matrix, it is possible to extract the principal axes of inertia (a Vec3) and a local inertial frame (a Quat) that defines the XYZ axes. This diagonalization can be performed using the principal_angular_inertia_with_local_frame method.

The diagonalized representation is more compact and often easier to work with, but the full tensor can be more efficient for computations using the angular inertia.

Implementations§

Source§

impl AngularInertiaTensor

Source

pub const ZERO: AngularInertiaTensor

Zero angular inertia.

Source

pub const IDENTITY: AngularInertiaTensor

An angular inertia tensor with a principal angular inertia of 1.0 along the diagonal.

Source

pub const INFINITY: AngularInertiaTensor

Infinite angular inertia.

Source

pub fn new(principal_angular_inertia: Vec3) -> AngularInertiaTensor

Creates a new AngularInertiaTensor from the given principal angular inertia.

The principal angular inertia represents the torque needed for a desired angular acceleration about the local coordinate axes. To specify the orientation of the local inertial frame, consider using new_with_local_frame.

§Panics

Panics if any component of the principal angular inertia is negative or NaN when debug_assertions are enabled.

Source

pub fn try_new( principal_angular_inertia: Vec3, ) -> Result<AngularInertiaTensor, AngularInertiaTensorError>

Tries to create a new AngularInertiaTensor from the given principal angular inertia.

The principal angular inertia represents the torque needed for a desired angular acceleration about the local coordinate axes. To specify the orientation of the local inertial frame, consider using try_new_with_local_frame.

§Errors

Returns Err(AngularInertiaTensorError) if any component of the principal angular inertia is negative or NaN.

Source

pub fn new_with_local_frame( principal_angular_inertia: Vec3, orientation: Quat, ) -> AngularInertiaTensor

Creates a new AngularInertiaTensor from the given principal angular inertia and the orientation of the local inertial frame.

The principal angular inertia represents the torque needed for a desired angular acceleration about the local coordinate axes defined by the given orientation.

§Panics

Panics if any component of the principal angular inertia is negative or NaN when debug_assertions are enabled.

Source

pub fn try_new_with_local_frame( principal_angular_inertia: Vec3, orientation: Quat, ) -> Result<AngularInertiaTensor, AngularInertiaTensorError>

Tries to create a new AngularInertiaTensor from the given principal angular inertia and the orientation of the local inertial frame.

The principal angular inertia represents the torque needed for a desired angular acceleration about the local coordinate axes defined by the given orientation.

§Errors

Returns Err(AngularInertiaTensorError) if any component of the principal angular inertia is negative or NaN.

Source

pub const fn from_symmetric_mat3(mat: SymmetricMat3) -> AngularInertiaTensor

Creates a new AngularInertiaTensor from the given angular inertia tensor represented as a SymmetricMat3.

The tensor should be positive-semidefinite, but this is not checked.

Source

pub fn try_from_mat3( mat: Mat3, ) -> Result<AngularInertiaTensor, MatConversionError>

Tries to create a new AngularInertiaTensor from the given angular inertia tensor represented as a Mat3.

The tensor should be positive-semidefinite, but this is not checked.

§Errors

Returns a MatConversionError if the given matrix is not symmetric.

Source

pub const fn from_mat3_unchecked(mat: Mat3) -> AngularInertiaTensor

Creates a new AngularInertiaTensor from the given angular inertia [tensor] represented as a Mat3.

Only the lower left triangle of the matrix is used. No check is performed to ensure that the given matrix is truly symmetric or positive-semidefinite.

Source

pub fn as_symmetric_mat3(&self) -> SymmetricMat3

Returns the angular inertia tensor as a SymmetricMat3.

Equivalent to value.

Source

pub fn as_symmetric_mat3_mut(&mut self) -> &mut SymmetricMat3

Returns a mutable reference to the SymmetricMat3 stored in self.

Equivalent to value_mut.

Source

pub fn value(self) -> SymmetricMat3

Returns the angular inertia tensor as a SymmetricMat3.

Equivalent to as_symmetric_mat3.

Source

pub fn value_mut(&mut self) -> &mut SymmetricMat3

Returns a mutable reference to the SymmetricMat3 stored in self.

Equivalent to as_symmetric_mat3_mut.

Source

pub fn to_mat3(&self) -> Mat3

Returns the angular inertia tensor as a Mat3.

Source

pub fn inverse(self) -> AngularInertiaTensor

Returns the inverse of the angular inertia tensor.

Source

pub fn set(&mut self, angular_inertia: impl Into<AngularInertiaTensor>)

Sets the angular inertia tensor to the given value.

Source

pub fn principal_angular_inertia_with_local_frame(&self) -> (Vec3, Quat)

Computes the principal angular inertia and local inertial frame by diagonalizing the 3x3 tensor matrix.

The principal angular inertia represents the torque needed for a desired angular acceleration about the local coordinate axes defined by the local inertial frame.

Source

pub fn rotated(self, rotation: Quat) -> AngularInertiaTensor

Computes the angular inertia tensor with the given rotation.

This can be used to transform local angular inertia to world space.

Source

pub fn shifted(self, mass: f32, offset: Vec3) -> AngularInertiaTensor

Computes the angular inertia tensor shifted by the given offset, taking into account the given mass.

Methods from Deref<Target = SymmetricMat3>§

Source

pub fn mul_vec3a(&self, rhs: Vec3A) -> Vec3A

Transforms a Vec3A.

Source

pub const ZERO: SymmetricMat3

Source

pub const IDENTITY: SymmetricMat3

Source

pub const NAN: SymmetricMat3

Source

pub fn to_cols_array(&self) -> [f32; 9]

Creates an array storing data in column major order.

Source

pub fn to_cols_array_2d(&self) -> [[f32; 3]; 3]

Creates a 2D array storing data in column major order.

Source

pub fn to_mat3(&self) -> Mat3

Creates a 3x3 matrix from the symmetric 3x3 matrix in self.

Source

pub fn col(&self, index: usize) -> Vec3

Returns the matrix column for the given index.

§Panics

Panics if index is greater than 2.

Source

pub fn row(&self, index: usize) -> Vec3

Returns the matrix row for the given index.

§Panics

Panics if index is greater than 2.

Source

pub fn diagonal(&self) -> Vec3

Returns the diagonal of the matrix.

Source

pub fn is_finite(&self) -> bool

Returns true if, and only if, all elements are finite. If any element is either NaN or positive or negative infinity, this will return false.

Source

pub fn is_nan(&self) -> bool

Returns true if any elements are NaN.

Source

pub fn determinant(&self) -> f32

Returns the determinant of self.

Source

pub fn inverse(&self) -> SymmetricMat3

Returns the inverse of self.

If the matrix is not invertible the returned matrix will be invalid.

Source

pub fn inverse_or_zero(&self) -> SymmetricMat3

Returns the inverse of self, or a zero matrix if the matrix is not invertible.

Source

pub fn abs(&self) -> SymmetricMat3

Takes the absolute value of each element in self.

Source

pub fn skew(&self, vec: Vec3) -> SymmetricMat3

Computes skew_symmetric(vec) * self * skew_symmetric(vec).transpose() for a symmetric matrix self.

Source

pub fn mul_vec3(&self, rhs: Vec3) -> Vec3

Transforms a 3D vector.

Source

pub fn ldlt_solve(&self, rhs: Vec3) -> Vec3

Solves self * x = rhs for x using the LDLT decomposition.

self must be a positive semidefinite matrix.

Source

pub fn mul_mat3(&self, rhs: &Mat3) -> Mat3

Multiplies two 3x3 matrices.

Source

pub fn mul_mat32(&self, rhs: &Mat32) -> Mat32

Multiplies self by a 3x2 matrix, self * rhs.

Source

pub fn add_mat3(&self, rhs: &Mat3) -> Mat3

Adds two 3x3 matrices.

Source

pub fn sub_mat3(&self, rhs: &Mat3) -> Mat3

Subtracts two 3x3 matrices.

Source

pub fn mul_symmetric_mat3(&self, rhs: &SymmetricMat3) -> Mat3

Multiplies two symmetric 3x3 matrices.

Source

pub fn add_symmetric_mat3(&self, rhs: &SymmetricMat3) -> SymmetricMat3

Adds two symmetric 3x3 matrices.

Source

pub fn sub_symmetric_mat3(&self, rhs: &SymmetricMat3) -> SymmetricMat3

Subtracts two symmetric 3x3 matrices.

Source

pub fn mul_scalar(&self, rhs: f32) -> SymmetricMat3

Multiplies a 3x3 matrix by a scalar.

Source

pub fn div_scalar(&self, rhs: f32) -> SymmetricMat3

Divides a 3x3 matrix by a scalar.

Source

pub fn as_symmetric_dmat3(&self) -> SymmetricDMat3

Returns the double precision version of self.

Trait Implementations§

Source§

impl Add for AngularInertiaTensor

Source§

type Output = AngularInertiaTensor

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign for AngularInertiaTensor

Source§

fn add_assign(&mut self, rhs: AngularInertiaTensor)

Performs the += operation. Read more
Source§

impl Clone for AngularInertiaTensor

Source§

fn clone(&self) -> AngularInertiaTensor

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AngularInertiaTensor

Source§

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

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

impl Default for AngularInertiaTensor

Source§

fn default() -> AngularInertiaTensor

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

impl Deref for AngularInertiaTensor

Source§

type Target = SymmetricMat3

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Div<f32> for AngularInertiaTensor

Source§

type Output = AngularInertiaTensor

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl DivAssign<f32> for AngularInertiaTensor

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl From<AngularInertiaTensor> for Mat3

Source§

fn from(angular_inertia: AngularInertiaTensor) -> Mat3

Converts to this type from the input type.
Source§

impl From<AngularInertiaTensor> for SymmetricMat3

Source§

fn from(angular_inertia: AngularInertiaTensor) -> SymmetricMat3

Converts to this type from the input type.
Source§

impl From<SymmetricMat3> for AngularInertiaTensor

Source§

fn from(angular_inertia: SymmetricMat3) -> AngularInertiaTensor

Converts to this type from the input type.
Source§

impl FromReflect for AngularInertiaTensor

Source§

fn from_reflect( reflect: &(dyn PartialReflect + 'static), ) -> Option<AngularInertiaTensor>

Constructs a concrete instance of Self from a reflected value.
Source§

fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Source§

impl GetTypeRegistration for AngularInertiaTensor

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl Mul<AngularInertiaTensor> for Quat

Source§

type Output = AngularInertiaTensor

The resulting type after applying the * operator.
Source§

fn mul(self, angular_inertia: AngularInertiaTensor) -> AngularInertiaTensor

Performs the * operation. Read more
Source§

impl Mul<AngularInertiaTensor> for f32

Source§

type Output = AngularInertiaTensor

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: AngularInertiaTensor) -> AngularInertiaTensor

Performs the * operation. Read more
Source§

impl Mul<Vec3> for AngularInertiaTensor

Source§

type Output = Vec3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec3) -> Vec3

Performs the * operation. Read more
Source§

impl MulAssign<f32> for AngularInertiaTensor

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl PartialEq for AngularInertiaTensor

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialReflect for AngularInertiaTensor

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<AngularInertiaTensor>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<AngularInertiaTensor>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect( self: Box<AngularInertiaTensor>, ) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

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

Debug formatter for the value. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
Source§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
Source§

fn to_dynamic(&self) -> Box<dyn PartialReflect>

Converts this reflected value into its dynamic representation based on its kind. Read more
Source§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing PartialReflect, combines reflect_clone and take in a useful fashion, automatically constructing an appropriate ReflectCloneError if the downcast fails. Read more
Source§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
Source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl Reflect for AngularInertiaTensor

Source§

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

Returns the value as a Box<dyn Any>. Read more
Source§

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

Returns the value as a &dyn Any. Read more
Source§

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

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<AngularInertiaTensor>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &(dyn Reflect + 'static)

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl TryFrom<Mat3> for AngularInertiaTensor

Source§

type Error = MatConversionError

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

fn try_from( angular_inertia: Mat3, ) -> Result<AngularInertiaTensor, <AngularInertiaTensor as TryFrom<Mat3>>::Error>

Performs the conversion.
Source§

impl TryFrom<Vec3> for AngularInertiaTensor

Source§

type Error = AngularInertiaTensorError

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

fn try_from( principal_angular_inertia: Vec3, ) -> Result<AngularInertiaTensor, <AngularInertiaTensor as TryFrom<Vec3>>::Error>

Performs the conversion.
Source§

impl TupleStruct for AngularInertiaTensor

Source§

fn field(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>

Returns a reference to the value of the field with index index as a &dyn Reflect.
Source§

fn field_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>

Returns a mutable reference to the value of the field with index index as a &mut dyn Reflect.
Source§

fn field_len(&self) -> usize

Returns the number of fields in the tuple struct.
Source§

fn iter_fields(&self) -> TupleStructFieldIter<'_>

Returns an iterator over the values of the tuple struct’s fields.
Source§

fn to_dynamic_tuple_struct(&self) -> DynamicTupleStruct

Creates a new DynamicTupleStruct from this tuple struct.
Source§

fn get_represented_tuple_struct_info(&self) -> Option<&'static TupleStructInfo>

Will return None if TypeInfo is not available.
Source§

impl TypePath for AngularInertiaTensor

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl Typed for AngularInertiaTensor

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
Source§

impl Copy for AngularInertiaTensor

Source§

impl StructuralPartialEq for AngularInertiaTensor

Auto Trait Implementations§

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, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

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

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
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: Clone,

Source§

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

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

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

Source§

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

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

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

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

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

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

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

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

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

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

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

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

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynamicTypePath for T
where T: TypePath,

Source§

impl<T> DynamicTyped for T
where T: Typed,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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

Creates Self using default().

Source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

Source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Source§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
Source§

impl<S> GetTupleStructField for S
where S: TupleStruct,

Source§

fn get_field<T>(&self, index: usize) -> Option<&T>
where T: Reflect,

Returns a reference to the value of the field with index index, downcast to T.
Source§

fn get_field_mut<T>(&mut self, index: usize) -> Option<&mut T>
where T: Reflect,

Returns a mutable reference to the value of the field with index index, downcast to T.
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

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,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

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

Creates a type-erased clone of this value.
Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

Source§

impl<T, Right> ClosedAddAssign<Right> for T
where T: ClosedAdd<Right> + AddAssign<Right>,

Source§

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

Source§

impl<T, Right> ClosedDivAssign<Right> for T
where T: ClosedDiv<Right> + DivAssign<Right>,

Source§

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

Source§

impl<T> Reflectable for T

Source§

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

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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