#[repr(C)]pub struct Scale<T, const D: usize> {
pub vector: Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>,
}Expand description
A scale which supports non-uniform scaling.
Fields§
§vector: Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>The scale coordinates, i.e., how much is multiplied to a point’s coordinates when it is scaled.
Implementations§
Source§impl<T, const D: usize> Scale<T, D>where
T: Scalar,
impl<T, const D: usize> Scale<T, D>where
T: Scalar,
Sourcepub fn try_inverse(&self) -> Option<Scale<T, D>>
pub fn try_inverse(&self) -> Option<Scale<T, D>>
Inverts self.
§Example
let t = Scale3::new(1.0, 2.0, 3.0);
assert_eq!(t * t.try_inverse().unwrap(), Scale3::identity());
assert_eq!(t.try_inverse().unwrap() * t, Scale3::identity());
// Work in all dimensions.
let t = Scale2::new(1.0, 2.0);
assert_eq!(t * t.try_inverse().unwrap(), Scale2::identity());
assert_eq!(t.try_inverse().unwrap() * t, Scale2::identity());
// Returns None if any coordinate is 0.
let t = Scale2::new(0.0, 2.0);
assert_eq!(t.try_inverse(), None);Sourcepub unsafe fn inverse_unchecked(&self) -> Scale<T, D>where
T: ClosedDivAssign + One,
pub unsafe fn inverse_unchecked(&self) -> Scale<T, D>where
T: ClosedDivAssign + One,
Inverts self.
§Example
unsafe {
let t = Scale3::new(1.0, 2.0, 3.0);
assert_eq!(t * t.inverse_unchecked(), Scale3::identity());
assert_eq!(t.inverse_unchecked() * t, Scale3::identity());
// Work in all dimensions.
let t = Scale2::new(1.0, 2.0);
assert_eq!(t * t.inverse_unchecked(), Scale2::identity());
assert_eq!(t.inverse_unchecked() * t, Scale2::identity());
}§Safety
Should only be used if all scaling is known to be non-zero.
Sourcepub fn pseudo_inverse(&self) -> Scale<T, D>
pub fn pseudo_inverse(&self) -> Scale<T, D>
Inverts self.
§Example
let t = Scale3::new(1.0, 2.0, 3.0);
assert_eq!(t * t.pseudo_inverse(), Scale3::identity());
assert_eq!(t.pseudo_inverse() * t, Scale3::identity());
// Work in all dimensions.
let t = Scale2::new(1.0, 2.0);
assert_eq!(t * t.pseudo_inverse(), Scale2::identity());
assert_eq!(t.pseudo_inverse() * t, Scale2::identity());
// Inverts only non-zero coordinates.
let t = Scale2::new(0.0, 2.0);
assert_eq!(t * t.pseudo_inverse(), Scale2::new(0.0, 1.0));
assert_eq!(t.pseudo_inverse() * t, Scale2::new(0.0, 1.0));Sourcepub fn to_homogeneous(
&self,
) -> Matrix<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T>>where
T: Zero + One + Clone,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output>,
pub fn to_homogeneous(
&self,
) -> Matrix<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T>>where
T: Zero + One + Clone,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output>,
Converts this Scale into its equivalent homogeneous transformation matrix.
§Example
let t = Scale3::new(10.0, 20.0, 30.0);
let expected = Matrix4::new(10.0, 0.0, 0.0, 0.0,
0.0, 20.0, 0.0, 0.0,
0.0, 0.0, 30.0, 0.0,
0.0, 0.0, 0.0, 1.0);
assert_eq!(t.to_homogeneous(), expected);
let t = Scale2::new(10.0, 20.0);
let expected = Matrix3::new(10.0, 0.0, 0.0,
0.0, 20.0, 0.0,
0.0, 0.0, 1.0);
assert_eq!(t.to_homogeneous(), expected);Sourcepub fn try_inverse_mut(&mut self) -> bool
pub fn try_inverse_mut(&mut self) -> bool
Inverts self in-place.
§Example
let t = Scale3::new(1.0, 2.0, 3.0);
let mut inv_t = Scale3::new(1.0, 2.0, 3.0);
assert!(inv_t.try_inverse_mut());
assert_eq!(t * inv_t, Scale3::identity());
assert_eq!(inv_t * t, Scale3::identity());
// Work in all dimensions.
let t = Scale2::new(1.0, 2.0);
let mut inv_t = Scale2::new(1.0, 2.0);
assert!(inv_t.try_inverse_mut());
assert_eq!(t * inv_t, Scale2::identity());
assert_eq!(inv_t * t, Scale2::identity());
// Does not perform any operation if a coordinate is 0.
let mut t = Scale2::new(0.0, 2.0);
assert!(!t.try_inverse_mut());Source§impl<T, const D: usize> Scale<T, D>where
T: Scalar + ClosedMulAssign,
impl<T, const D: usize> Scale<T, D>where
T: Scalar + ClosedMulAssign,
Sourcepub fn transform_point(&self, pt: &OPoint<T, Const<D>>) -> OPoint<T, Const<D>>
pub fn transform_point(&self, pt: &OPoint<T, Const<D>>) -> OPoint<T, Const<D>>
Translate the given point.
This is the same as the multiplication self * pt.
§Example
let t = Scale3::new(1.0, 2.0, 3.0);
let transformed_point = t.transform_point(&Point3::new(4.0, 5.0, 6.0));
assert_eq!(transformed_point, Point3::new(4.0, 10.0, 18.0));Source§impl<T, const D: usize> Scale<T, D>
impl<T, const D: usize> Scale<T, D>
Sourcepub fn try_inverse_transform_point(
&self,
pt: &OPoint<T, Const<D>>,
) -> Option<OPoint<T, Const<D>>>
pub fn try_inverse_transform_point( &self, pt: &OPoint<T, Const<D>>, ) -> Option<OPoint<T, Const<D>>>
Translate the given point by the inverse of this Scale.
§Example
let t = Scale3::new(1.0, 2.0, 3.0);
let transformed_point = t.try_inverse_transform_point(&Point3::new(4.0, 6.0, 6.0)).unwrap();
assert_eq!(transformed_point, Point3::new(4.0, 3.0, 2.0));
// Returns None if the inverse doesn't exist.
let t = Scale3::new(1.0, 0.0, 3.0);
let transformed_point = t.try_inverse_transform_point(&Point3::new(4.0, 6.0, 6.0));
assert_eq!(transformed_point, None);Source§impl<T, const D: usize> Scale<T, D>where
T: Scalar,
impl<T, const D: usize> Scale<T, D>where
T: Scalar,
Source§impl<T> Scale<T, 6>
impl<T> Scale<T, 6>
Sourcepub const fn new(x: T, y: T, z: T, w: T, a: T, b: T) -> Scale<T, 6>
pub const fn new(x: T, y: T, z: T, w: T, a: T, b: T) -> Scale<T, 6>
Initializes this Scale from its components.
§Example
let t = Scale6::new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
assert!(t.vector.x == 1.0 && t.vector.y == 2.0 && t.vector.z == 3.0 && t.vector.w == 4.0 && t.vector.a == 5.0 && t.vector.b == 6.0);Trait Implementations§
Source§impl<T, const D: usize> AbsDiffEq for Scale<T, D>
impl<T, const D: usize> AbsDiffEq for Scale<T, D>
Source§fn default_epsilon() -> <Scale<T, D> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Scale<T, D> as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(
&self,
other: &Scale<T, D>,
epsilon: <Scale<T, D> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Scale<T, D>, epsilon: <Scale<T, D> as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl<'a, T, const D: usize> Deserialize<'a> for Scale<T, D>
Available on crate feature serde-serialize-no-std only.
impl<'a, T, const D: usize> Deserialize<'a> for Scale<T, D>
Available on crate feature
serde-serialize-no-std only.Source§fn deserialize<Des>(
deserializer: Des,
) -> Result<Scale<T, D>, <Des as Deserializer<'a>>::Error>where
Des: Deserializer<'a>,
fn deserialize<Des>(
deserializer: Des,
) -> Result<Scale<T, D>, <Des as Deserializer<'a>>::Error>where
Des: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, const D: usize> From<Matrix<T, Const<D>, Const<1>, <DefaultAllocator as Allocator<Const<D>>>::Buffer<T>>> for Scale<T, D>where
T: Scalar,
impl<T, const D: usize> From<Matrix<T, Const<D>, Const<1>, <DefaultAllocator as Allocator<Const<D>>>::Buffer<T>>> for Scale<T, D>where
T: Scalar,
Source§impl<T, const D: usize> From<Scale<T, D>> for Matrix<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T>>where
T: Scalar + Zero + One,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<Const<D>>,
impl<T, const D: usize> From<Scale<T, D>> for Matrix<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T>>where
T: Scalar + Zero + One,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<Const<D>>,
Source§fn from(
t: Scale<T, D>,
) -> Matrix<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T>>
fn from( t: Scale<T, D>, ) -> Matrix<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T>>
Converts to this type from the input type.
Source§impl<'a, 'b, T, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, 'b, T, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'b, T, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'b, T, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'a, 'b, T, const D: usize> Mul<&'b OPoint<T, Const<D>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, 'b, T, const D: usize> Mul<&'b OPoint<T, Const<D>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'b, T, const D: usize> Mul<&'b OPoint<T, Const<D>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'b, T, const D: usize> Mul<&'b OPoint<T, Const<D>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'a, 'b, T, const D: usize> Mul<&'b Scale<T, D>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, 'b, T, const D: usize> Mul<&'b Scale<T, D>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'b, T, const D: usize> Mul<&'b Scale<T, D>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'b, T, const D: usize> Mul<&'b Scale<T, D>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'a, T, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, T, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<T, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<T, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'a, T, const D: usize> Mul<OPoint<T, Const<D>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, T, const D: usize> Mul<OPoint<T, Const<D>>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<T, const D: usize> Mul<OPoint<T, Const<D>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<T, const D: usize> Mul<OPoint<T, Const<D>>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'a, T, const D: usize> Mul<Scale<T, D>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, T, const D: usize> Mul<Scale<T, D>> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'a, T, const D: usize> Mul<T> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<'a, T, const D: usize> Mul<T> for &'a Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<T, const D: usize> Mul<T> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<T, const D: usize> Mul<T> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<T, const D: usize> Mul for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
impl<T, const D: usize> Mul for Scale<T, D>where
T: Scalar + ClosedMulAssign,
ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<Const<1>, Const<1>, Representative = Const<1>>,
Source§impl<'b, T, const D: usize> MulAssign<&'b Scale<T, D>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
impl<'b, T, const D: usize> MulAssign<&'b Scale<T, D>> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
Source§fn mul_assign(&mut self, right: &'b Scale<T, D>)
fn mul_assign(&mut self, right: &'b Scale<T, D>)
Performs the
*= operation. Read moreSource§impl<T, const D: usize> MulAssign<T> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
impl<T, const D: usize> MulAssign<T> for Scale<T, D>where
T: Scalar + ClosedMulAssign,
Source§fn mul_assign(&mut self, right: T)
fn mul_assign(&mut self, right: T)
Performs the
*= operation. Read moreSource§impl<T, const D: usize> MulAssign for Scale<T, D>where
T: Scalar + ClosedMulAssign,
impl<T, const D: usize> MulAssign for Scale<T, D>where
T: Scalar + ClosedMulAssign,
Source§fn mul_assign(&mut self, right: Scale<T, D>)
fn mul_assign(&mut self, right: Scale<T, D>)
Performs the
*= operation. Read moreSource§impl<T, const D: usize> RelativeEq for Scale<T, D>
impl<T, const D: usize> RelativeEq for Scale<T, D>
Source§fn default_max_relative() -> <Scale<T, D> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Scale<T, D> as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Scale<T, D>,
epsilon: <Scale<T, D> as AbsDiffEq>::Epsilon,
max_relative: <Scale<T, D> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Scale<T, D>, epsilon: <Scale<T, D> as AbsDiffEq>::Epsilon, max_relative: <Scale<T, D> as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl<T, const D: usize> Serialize for Scale<T, D>
Available on crate feature serde-serialize-no-std only.
impl<T, const D: usize> Serialize for Scale<T, D>
Available on crate feature
serde-serialize-no-std only.Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<T, const D: usize> SimdValue for Scale<T, D>
impl<T, const D: usize> SimdValue for Scale<T, D>
Source§type Element = Scale<<T as SimdValue>::Element, D>
type Element = Scale<<T as SimdValue>::Element, D>
The type of the elements of each lane of this SIMD value.
Source§type SimdBool = <T as SimdValue>::SimdBool
type SimdBool = <T as SimdValue>::SimdBool
Type of the result of comparing two SIMD values like
self.Source§fn splat(val: <Scale<T, D> as SimdValue>::Element) -> Scale<T, D>
fn splat(val: <Scale<T, D> as SimdValue>::Element) -> Scale<T, D>
Initializes an SIMD value with each lanes set to
val.Source§fn extract(&self, i: usize) -> <Scale<T, D> as SimdValue>::Element
fn extract(&self, i: usize) -> <Scale<T, D> as SimdValue>::Element
Extracts the i-th lane of
self. Read moreSource§unsafe fn extract_unchecked(
&self,
i: usize,
) -> <Scale<T, D> as SimdValue>::Element
unsafe fn extract_unchecked( &self, i: usize, ) -> <Scale<T, D> as SimdValue>::Element
Extracts the i-th lane of
self without bound-checking. Read moreSource§unsafe fn replace_unchecked(
&mut self,
i: usize,
val: <Scale<T, D> as SimdValue>::Element,
)
unsafe fn replace_unchecked( &mut self, i: usize, val: <Scale<T, D> as SimdValue>::Element, )
Source§fn select(
self,
cond: <Scale<T, D> as SimdValue>::SimdBool,
other: Scale<T, D>,
) -> Scale<T, D>
fn select( self, cond: <Scale<T, D> as SimdValue>::SimdBool, other: Scale<T, D>, ) -> Scale<T, D>
Source§impl<T1, T2, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Scale<T1, D>where
T1: RealField,
T2: RealField + SupersetOf<T1>,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output>,
impl<T1, T2, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Scale<T1, D>where
T1: RealField,
T2: RealField + SupersetOf<T1>,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output>,
Source§fn to_superset(
&self,
) -> Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>
fn to_superset( &self, ) -> Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>
The inclusion map: converts
self to the equivalent element of its superset.Source§fn is_in_subset(
m: &Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>,
) -> bool
fn is_in_subset( m: &Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>, ) -> bool
Checks if
element is actually part of the subset Self (and can be converted to it).Source§fn from_superset_unchecked(
m: &Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>,
) -> Scale<T1, D>
fn from_superset_unchecked( m: &Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>, ) -> Scale<T1, D>
Use with care! Same as
self.to_superset but without any property checks. Always succeeds.Source§impl<T1, T2, const D: usize> SubsetOf<Scale<T2, D>> for Scale<T1, D>
impl<T1, T2, const D: usize> SubsetOf<Scale<T2, D>> for Scale<T1, D>
Source§fn to_superset(&self) -> Scale<T2, D>
fn to_superset(&self) -> Scale<T2, D>
The inclusion map: converts
self to the equivalent element of its superset.Source§fn is_in_subset(rot: &Scale<T2, D>) -> bool
fn is_in_subset(rot: &Scale<T2, D>) -> bool
Checks if
element is actually part of the subset Self (and can be converted to it).Source§fn from_superset_unchecked(rot: &Scale<T2, D>) -> Scale<T1, D>
fn from_superset_unchecked(rot: &Scale<T2, D>) -> Scale<T1, D>
Use with care! Same as
self.to_superset but without any property checks. Always succeeds.Source§impl<T1, T2, C, const D: usize> SubsetOf<Transform<T2, C, D>> for Scale<T1, D>where
T1: RealField,
T2: RealField + SupersetOf<T1>,
C: SuperTCategoryOf<TAffine>,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output>,
impl<T1, T2, C, const D: usize> SubsetOf<Transform<T2, C, D>> for Scale<T1, D>where
T1: RealField,
T2: RealField + SupersetOf<T1>,
C: SuperTCategoryOf<TAffine>,
Const<D>: DimNameAdd<Const<1>>,
DefaultAllocator: Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output> + Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output>,
Source§fn to_superset(&self) -> Transform<T2, C, D>
fn to_superset(&self) -> Transform<T2, C, D>
The inclusion map: converts
self to the equivalent element of its superset.Source§fn is_in_subset(t: &Transform<T2, C, D>) -> bool
fn is_in_subset(t: &Transform<T2, C, D>) -> bool
Checks if
element is actually part of the subset Self (and can be converted to it).Source§fn from_superset_unchecked(t: &Transform<T2, C, D>) -> Scale<T1, D>
fn from_superset_unchecked(t: &Transform<T2, C, D>) -> Scale<T1, D>
Use with care! Same as
self.to_superset but without any property checks. Always succeeds.Source§impl<T, const D: usize> UlpsEq for Scale<T, D>
impl<T, const D: usize> UlpsEq for Scale<T, D>
Source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
impl<T, const D: usize> Copy for Scale<T, D>where
T: Copy,
impl<T, const D: usize> Eq for Scale<T, D>
Auto Trait Implementations§
impl<T, const D: usize> Freeze for Scale<T, D>where
T: Freeze,
impl<T, const D: usize> RefUnwindSafe for Scale<T, D>where
T: RefUnwindSafe,
impl<T, const D: usize> Send for Scale<T, D>where
T: Send,
impl<T, const D: usize> Sync for Scale<T, D>where
T: Sync,
impl<T, const D: usize> Unpin for Scale<T, D>where
T: Unpin,
impl<T, const D: usize> UnwindSafe for Scale<T, D>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<N, R, C, S> ArgminDot<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R, C, S> ArgminDot<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
Source§impl<N, R, C, S> ArgminMul<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R, C, S> ArgminMul<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, T> CoordTranslate for Twhere
C: CoordTranslate,
T: Deref<Target = C>,
impl<C, T> CoordTranslate for Twhere
C: CoordTranslate,
T: Deref<Target = C>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
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> 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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Converts a reference to an FFI-safe type
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Converts an FFI-safe type to a reference
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
Gets a reference to a field, determined by
offset. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
Gets a muatble reference to a field, determined by
offset. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
Gets a const pointer to a field,
the field is determined by
offset. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
Gets a mutable pointer to a field, determined by
offset. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
Replaces a field (determined by
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
Replaces a field (determined by
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
👎Deprecated since 0.9.0: Renamed to
random to avoid conflict with the new gen keyword in Rust 2024.Alias for
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
👎Deprecated since 0.9.0: Renamed to
random_rangeAlias for
Rng::random_range.Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Emulates the pipeline operator, allowing method syntax in more places. Read more
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
The same as
piped except that the function takes &Self
Useful for functions that take &Self instead of Self. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
The same as
piped, except that the function takes &mut Self.
Useful for functions that take &mut Self instead of Self.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Mutates self using a closure taking self by mutable reference,
passing it along the method chain. Read more
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Observes the value of self, passing it along unmodified.
Useful in long method chains. Read more
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
Performs a reference to reference conversion with
AsRef,
using the turbofish .as_ref_::<_>() syntax. Read moreSource§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<This> TransmuteElement for Thiswhere
This: ?Sized,
impl<This> TransmuteElement for Thiswhere
This: ?Sized,
Source§unsafe fn transmute_element<T>(self) -> Self::TransmutedPtrwhere
Self: CanTransmuteElement<T>,
unsafe fn transmute_element<T>(self) -> Self::TransmutedPtrwhere
Self: CanTransmuteElement<T>,
Transmutes the element type of this pointer.. Read more
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
Convert an
RngCore to a RngReadAdapter.Source§impl<T> TypeIdentity for Twhere
T: ?Sized,
impl<T> TypeIdentity for Twhere
T: ?Sized,
Source§fn as_type_mut(&mut self) -> &mut Self::Type
fn as_type_mut(&mut self) -> &mut Self::Type
Converts a mutable reference back to the original type.
Source§fn into_type_box(self: Box<Self>) -> Box<Self::Type>
fn into_type_box(self: Box<Self>) -> Box<Self::Type>
Converts a box back to the original type.
Source§fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
Converts an Arc back to the original type. Read more
Source§fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
Converts an Rc back to the original type. Read more
Source§fn from_type_ref(this: &Self::Type) -> &Self
fn from_type_ref(this: &Self::Type) -> &Self
Converts a reference back to the original type.
Source§fn from_type_mut(this: &mut Self::Type) -> &mut Self
fn from_type_mut(this: &mut Self::Type) -> &mut Self
Converts a mutable reference back to the original type.
Source§fn from_type_box(this: Box<Self::Type>) -> Box<Self>
fn from_type_box(this: Box<Self::Type>) -> Box<Self>
Converts a box back to the original type.