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
impl AngularInertiaTensor
Sourcepub const ZERO: AngularInertiaTensor
pub const ZERO: AngularInertiaTensor
Zero angular inertia.
Sourcepub const IDENTITY: AngularInertiaTensor
pub const IDENTITY: AngularInertiaTensor
An angular inertia tensor with a principal angular inertia of 1.0
along the diagonal.
Sourcepub const INFINITY: AngularInertiaTensor
pub const INFINITY: AngularInertiaTensor
Infinite angular inertia.
Sourcepub fn new(principal_angular_inertia: Vec3) -> AngularInertiaTensor
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.
Sourcepub fn try_new(
principal_angular_inertia: Vec3,
) -> Result<AngularInertiaTensor, AngularInertiaTensorError>
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.
Sourcepub fn new_with_local_frame(
principal_angular_inertia: Vec3,
orientation: Quat,
) -> AngularInertiaTensor
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.
Sourcepub fn try_new_with_local_frame(
principal_angular_inertia: Vec3,
orientation: Quat,
) -> Result<AngularInertiaTensor, AngularInertiaTensorError>
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.
Sourcepub const fn from_symmetric_mat3(mat: SymmetricMat3) -> AngularInertiaTensor
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.
Sourcepub fn try_from_mat3(
mat: Mat3,
) -> Result<AngularInertiaTensor, MatConversionError>
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.
Sourcepub const fn from_mat3_unchecked(mat: Mat3) -> AngularInertiaTensor
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.
Sourcepub fn as_symmetric_mat3(&self) -> SymmetricMat3
pub fn as_symmetric_mat3(&self) -> SymmetricMat3
Returns the angular inertia tensor as a SymmetricMat3
.
Equivalent to value
.
Sourcepub fn as_symmetric_mat3_mut(&mut self) -> &mut SymmetricMat3
pub fn as_symmetric_mat3_mut(&mut self) -> &mut SymmetricMat3
Returns a mutable reference to the SymmetricMat3
stored in self
.
Equivalent to value_mut
.
Sourcepub fn value(self) -> SymmetricMat3
pub fn value(self) -> SymmetricMat3
Returns the angular inertia tensor as a SymmetricMat3
.
Equivalent to as_symmetric_mat3
.
Sourcepub fn value_mut(&mut self) -> &mut SymmetricMat3
pub fn value_mut(&mut self) -> &mut SymmetricMat3
Returns a mutable reference to the SymmetricMat3
stored in self
.
Equivalent to as_symmetric_mat3_mut
.
Sourcepub fn inverse(self) -> AngularInertiaTensor
pub fn inverse(self) -> AngularInertiaTensor
Returns the inverse of the angular inertia tensor.
Sourcepub fn set(&mut self, angular_inertia: impl Into<AngularInertiaTensor>)
pub fn set(&mut self, angular_inertia: impl Into<AngularInertiaTensor>)
Sets the angular inertia tensor to the given value.
Sourcepub fn principal_angular_inertia_with_local_frame(&self) -> (Vec3, Quat)
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.
Sourcepub fn rotated(self, rotation: Quat) -> AngularInertiaTensor
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.
Sourcepub fn shifted(self, mass: f32, offset: Vec3) -> AngularInertiaTensor
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>§
pub const ZERO: SymmetricMat3
pub const IDENTITY: SymmetricMat3
pub const NAN: SymmetricMat3
Sourcepub fn to_cols_array(&self) -> [f32; 9]
pub fn to_cols_array(&self) -> [f32; 9]
Creates an array storing data in column major order.
Sourcepub fn to_cols_array_2d(&self) -> [[f32; 3]; 3]
pub fn to_cols_array_2d(&self) -> [[f32; 3]; 3]
Creates a 2D array storing data in column major order.
Sourcepub fn is_finite(&self) -> bool
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
.
Sourcepub fn determinant(&self) -> f32
pub fn determinant(&self) -> f32
Returns the determinant of self
.
Sourcepub fn inverse(&self) -> SymmetricMat3
pub fn inverse(&self) -> SymmetricMat3
Returns the inverse of self
.
If the matrix is not invertible the returned matrix will be invalid.
Sourcepub fn inverse_or_zero(&self) -> SymmetricMat3
pub fn inverse_or_zero(&self) -> SymmetricMat3
Returns the inverse of self
, or a zero matrix if the matrix is not invertible.
Sourcepub fn abs(&self) -> SymmetricMat3
pub fn abs(&self) -> SymmetricMat3
Takes the absolute value of each element in self
.
Sourcepub fn skew(&self, vec: Vec3) -> SymmetricMat3
pub fn skew(&self, vec: Vec3) -> SymmetricMat3
Computes skew_symmetric(vec) * self * skew_symmetric(vec).transpose()
for a symmetric matrix self
.
Sourcepub fn ldlt_solve(&self, rhs: Vec3) -> Vec3
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.
Sourcepub fn mul_symmetric_mat3(&self, rhs: &SymmetricMat3) -> Mat3
pub fn mul_symmetric_mat3(&self, rhs: &SymmetricMat3) -> Mat3
Multiplies two symmetric 3x3 matrices.
Sourcepub fn add_symmetric_mat3(&self, rhs: &SymmetricMat3) -> SymmetricMat3
pub fn add_symmetric_mat3(&self, rhs: &SymmetricMat3) -> SymmetricMat3
Adds two symmetric 3x3 matrices.
Sourcepub fn sub_symmetric_mat3(&self, rhs: &SymmetricMat3) -> SymmetricMat3
pub fn sub_symmetric_mat3(&self, rhs: &SymmetricMat3) -> SymmetricMat3
Subtracts two symmetric 3x3 matrices.
Sourcepub fn mul_scalar(&self, rhs: f32) -> SymmetricMat3
pub fn mul_scalar(&self, rhs: f32) -> SymmetricMat3
Multiplies a 3x3 matrix by a scalar.
Sourcepub fn div_scalar(&self, rhs: f32) -> SymmetricMat3
pub fn div_scalar(&self, rhs: f32) -> SymmetricMat3
Divides a 3x3 matrix by a scalar.
Sourcepub fn as_symmetric_dmat3(&self) -> SymmetricDMat3
pub fn as_symmetric_dmat3(&self) -> SymmetricDMat3
Returns the double precision version of self
.
Trait Implementations§
Source§impl Add for AngularInertiaTensor
impl Add for AngularInertiaTensor
Source§type Output = AngularInertiaTensor
type Output = AngularInertiaTensor
+
operator.Source§fn add(self, rhs: AngularInertiaTensor) -> AngularInertiaTensor
fn add(self, rhs: AngularInertiaTensor) -> AngularInertiaTensor
+
operation. Read moreSource§impl AddAssign for AngularInertiaTensor
impl AddAssign for AngularInertiaTensor
Source§fn add_assign(&mut self, rhs: AngularInertiaTensor)
fn add_assign(&mut self, rhs: AngularInertiaTensor)
+=
operation. Read moreSource§impl Clone for AngularInertiaTensor
impl Clone for AngularInertiaTensor
Source§fn clone(&self) -> AngularInertiaTensor
fn clone(&self) -> AngularInertiaTensor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AngularInertiaTensor
impl Debug for AngularInertiaTensor
Source§impl Default for AngularInertiaTensor
impl Default for AngularInertiaTensor
Source§fn default() -> AngularInertiaTensor
fn default() -> AngularInertiaTensor
Source§impl Deref for AngularInertiaTensor
impl Deref for AngularInertiaTensor
Source§type Target = SymmetricMat3
type Target = SymmetricMat3
Source§impl Div<f32> for AngularInertiaTensor
impl Div<f32> for AngularInertiaTensor
Source§type Output = AngularInertiaTensor
type Output = AngularInertiaTensor
/
operator.Source§impl DivAssign<f32> for AngularInertiaTensor
impl DivAssign<f32> for AngularInertiaTensor
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/=
operation. Read moreSource§impl From<AngularInertiaTensor> for Mat3
impl From<AngularInertiaTensor> for Mat3
Source§fn from(angular_inertia: AngularInertiaTensor) -> Mat3
fn from(angular_inertia: AngularInertiaTensor) -> Mat3
Source§impl From<AngularInertiaTensor> for SymmetricMat3
impl From<AngularInertiaTensor> for SymmetricMat3
Source§fn from(angular_inertia: AngularInertiaTensor) -> SymmetricMat3
fn from(angular_inertia: AngularInertiaTensor) -> SymmetricMat3
Source§impl From<SymmetricMat3> for AngularInertiaTensor
impl From<SymmetricMat3> for AngularInertiaTensor
Source§fn from(angular_inertia: SymmetricMat3) -> AngularInertiaTensor
fn from(angular_inertia: SymmetricMat3) -> AngularInertiaTensor
Source§impl FromReflect for AngularInertiaTensor
impl FromReflect for AngularInertiaTensor
Source§fn from_reflect(
reflect: &(dyn PartialReflect + 'static),
) -> Option<AngularInertiaTensor>
fn from_reflect( reflect: &(dyn PartialReflect + 'static), ) -> Option<AngularInertiaTensor>
Self
from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self
using,
constructing the value using from_reflect
if that fails. Read moreSource§impl GetTypeRegistration for AngularInertiaTensor
impl GetTypeRegistration for AngularInertiaTensor
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration
for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl Mul<AngularInertiaTensor> for Quat
impl Mul<AngularInertiaTensor> for Quat
Source§type Output = AngularInertiaTensor
type Output = AngularInertiaTensor
*
operator.Source§fn mul(self, angular_inertia: AngularInertiaTensor) -> AngularInertiaTensor
fn mul(self, angular_inertia: AngularInertiaTensor) -> AngularInertiaTensor
*
operation. Read moreSource§impl Mul<AngularInertiaTensor> for f32
impl Mul<AngularInertiaTensor> for f32
Source§type Output = AngularInertiaTensor
type Output = AngularInertiaTensor
*
operator.Source§fn mul(self, rhs: AngularInertiaTensor) -> AngularInertiaTensor
fn mul(self, rhs: AngularInertiaTensor) -> AngularInertiaTensor
*
operation. Read moreSource§impl Mul<Vec3> for AngularInertiaTensor
impl Mul<Vec3> for AngularInertiaTensor
Source§impl MulAssign<f32> for AngularInertiaTensor
impl MulAssign<f32> for AngularInertiaTensor
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*=
operation. Read moreSource§impl PartialEq for AngularInertiaTensor
impl PartialEq for AngularInertiaTensor
Source§impl PartialReflect for AngularInertiaTensor
impl PartialReflect for AngularInertiaTensor
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn try_apply(
&mut self,
value: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<AngularInertiaTensor>) -> ReflectOwned
fn reflect_owned(self: Box<AngularInertiaTensor>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<AngularInertiaTensor>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<AngularInertiaTensor>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
Source§fn into_partial_reflect(
self: Box<AngularInertiaTensor>,
) -> Box<dyn PartialReflect>
fn into_partial_reflect( self: Box<AngularInertiaTensor>, ) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Source§fn reflect_partial_eq(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Self
using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn to_dynamic(&self) -> Box<dyn PartialReflect>
fn to_dynamic(&self) -> Box<dyn PartialReflect>
Source§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
PartialReflect
, combines reflect_clone
and
take
in a useful fashion, automatically constructing an appropriate
ReflectCloneError
if the downcast fails. Read moreSource§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Reflect for AngularInertiaTensor
impl Reflect for AngularInertiaTensor
Source§fn into_any(self: Box<AngularInertiaTensor>) -> Box<dyn Any>
fn into_any(self: Box<AngularInertiaTensor>) -> Box<dyn Any>
Box<dyn Any>
. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any
. Read moreSource§fn into_reflect(self: Box<AngularInertiaTensor>) -> Box<dyn Reflect>
fn into_reflect(self: Box<AngularInertiaTensor>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
Source§impl TryFrom<Mat3> for AngularInertiaTensor
impl TryFrom<Mat3> for AngularInertiaTensor
Source§type Error = MatConversionError
type Error = MatConversionError
Source§fn try_from(
angular_inertia: Mat3,
) -> Result<AngularInertiaTensor, <AngularInertiaTensor as TryFrom<Mat3>>::Error>
fn try_from( angular_inertia: Mat3, ) -> Result<AngularInertiaTensor, <AngularInertiaTensor as TryFrom<Mat3>>::Error>
Source§impl TryFrom<Vec3> for AngularInertiaTensor
impl TryFrom<Vec3> for AngularInertiaTensor
Source§type Error = AngularInertiaTensorError
type Error = AngularInertiaTensorError
Source§fn try_from(
principal_angular_inertia: Vec3,
) -> Result<AngularInertiaTensor, <AngularInertiaTensor as TryFrom<Vec3>>::Error>
fn try_from( principal_angular_inertia: Vec3, ) -> Result<AngularInertiaTensor, <AngularInertiaTensor as TryFrom<Vec3>>::Error>
Source§impl TupleStruct for AngularInertiaTensor
impl TupleStruct for AngularInertiaTensor
Source§fn field(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
fn field(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
index
as a
&dyn Reflect
.Source§fn field_mut(
&mut self,
index: usize,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>
index
as a &mut dyn Reflect
.Source§fn iter_fields(&self) -> TupleStructFieldIter<'_>
fn iter_fields(&self) -> TupleStructFieldIter<'_>
Source§fn to_dynamic_tuple_struct(&self) -> DynamicTupleStruct
fn to_dynamic_tuple_struct(&self) -> DynamicTupleStruct
DynamicTupleStruct
from this tuple struct.Source§fn get_represented_tuple_struct_info(&self) -> Option<&'static TupleStructInfo>
fn get_represented_tuple_struct_info(&self) -> Option<&'static TupleStructInfo>
None
if TypeInfo
is not available.Source§impl TypePath for AngularInertiaTensor
impl TypePath for AngularInertiaTensor
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl Typed for AngularInertiaTensor
impl Typed for AngularInertiaTensor
impl Copy for AngularInertiaTensor
impl StructuralPartialEq for AngularInertiaTensor
Auto Trait Implementations§
impl Freeze for AngularInertiaTensor
impl RefUnwindSafe for AngularInertiaTensor
impl Send for AngularInertiaTensor
impl Sync for AngularInertiaTensor
impl Unpin for AngularInertiaTensor
impl UnwindSafe for AngularInertiaTensor
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path
.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident
.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name
.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info
.Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§impl<S> GetTupleStructField for Swhere
S: TupleStruct,
impl<S> GetTupleStructField for Swhere
S: TupleStruct,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.