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 IDENTITY: Self = _
pub const IDENTITY: Self = _
An angular inertia tensor with a principal angular inertia of 1.0
along the diagonal.
sourcepub fn new(principal_angular_inertia: Vec3) -> Self
pub fn new(principal_angular_inertia: Vec3) -> Self
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<Self, AngularInertiaTensorError>
pub fn try_new( principal_angular_inertia: Vec3, ) -> Result<Self, 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,
) -> Self
pub fn new_with_local_frame( principal_angular_inertia: Vec3, orientation: Quat, ) -> Self
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<Self, AngularInertiaTensorError>
pub fn try_new_with_local_frame( principal_angular_inertia: Vec3, orientation: Quat, ) -> Result<Self, 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 fn from_mat3(mat: Mat3) -> Self
pub fn from_mat3(mat: Mat3) -> Self
Creates a new AngularInertiaTensor
from the given angular inertia tensor.
The tensor should be symmetric and positive-semidefinite, but this is not checked.
sourcepub fn as_mat3_mut(&mut self) -> &mut Mat3
pub fn as_mat3_mut(&mut self) -> &mut Mat3
sourcepub fn value_mut(&mut self) -> &mut Mat3
pub fn value_mut(&mut self) -> &mut Mat3
Returns a mutable reference to the Mat3
stored in self
.
Note that this allows making changes that could make the angular inertia tensor invalid (non-symmetric or non-positive-semidefinite).
Equivalent to as_mat3_mut
.
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.
Methods from Deref<Target = Mat3>§
pub const ZERO: Mat3 = _
pub const IDENTITY: Mat3 = _
pub const NAN: Mat3 = _
sourcepub fn to_cols_array(&self) -> [f32; 9]
pub fn to_cols_array(&self) -> [f32; 9]
Creates a [f32; 9]
array storing data in column major order.
If you require data in row major order transpose
the matrix first.
sourcepub fn to_cols_array_2d(&self) -> [[f32; 3]; 3]
pub fn to_cols_array_2d(&self) -> [[f32; 3]; 3]
Creates a [[f32; 3]; 3]
3D array storing data in column major order.
If you require data in row major order transpose
the matrix first.
sourcepub fn to_euler(&self, order: EulerRot) -> (f32, f32, f32)
pub fn to_euler(&self, order: EulerRot) -> (f32, f32, f32)
Extract Euler angles with the given Euler rotation order.
Note if the input matrix contains scales, shears, or other non-rotation transformations then the resulting Euler angles will be ill-defined.
§Panics
Will panic if any input matrix column is not normalized when glam_assert
is enabled.
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
, 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) -> Mat3
pub fn inverse(&self) -> Mat3
Returns the inverse of self
.
If the matrix is not invertible the returned matrix will be invalid.
§Panics
Will panic if the determinant of self
is zero when glam_assert
is enabled.
sourcepub fn transform_point2(&self, rhs: Vec2) -> Vec2
pub fn transform_point2(&self, rhs: Vec2) -> Vec2
Transforms the given 2D vector as a point.
This is the equivalent of multiplying rhs
as a 3D vector where z
is 1
.
This method assumes that self
contains a valid affine transform.
§Panics
Will panic if the 2nd row of self
is not (0, 0, 1)
when glam_assert
is enabled.
sourcepub fn transform_vector2(&self, rhs: Vec2) -> Vec2
pub fn transform_vector2(&self, rhs: Vec2) -> Vec2
Rotates the given 2D vector.
This is the equivalent of multiplying rhs
as a 3D vector where z
is 0
.
This method assumes that self
contains a valid affine transform.
§Panics
Will panic if the 2nd row of self
is not (0, 0, 1)
when glam_assert
is enabled.
sourcepub fn mul_scalar(&self, rhs: f32) -> Mat3
pub fn mul_scalar(&self, rhs: f32) -> Mat3
Multiplies a 3x3 matrix by a scalar.
sourcepub fn div_scalar(&self, rhs: f32) -> Mat3
pub fn div_scalar(&self, rhs: f32) -> Mat3
Divides a 3x3 matrix by a scalar.
sourcepub fn abs_diff_eq(&self, rhs: Mat3, max_abs_diff: f32) -> bool
pub fn abs_diff_eq(&self, rhs: Mat3, max_abs_diff: f32) -> bool
Returns true if the absolute difference of all elements between self
and rhs
is less than or equal to max_abs_diff
.
This can be used to compare if two matrices contain similar elements. It works best
when comparing with a known value. The max_abs_diff
that should be used used
depends on the values being compared against.
For more see comparing floating point numbers.
pub fn as_dmat3(&self) -> DMat3
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) -> Self
fn add(self, rhs: AngularInertiaTensor) -> Self
+
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§impl Div<f32> for AngularInertiaTensor
impl Div<f32> for AngularInertiaTensor
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) -> Self
fn from(angular_inertia: AngularInertiaTensor) -> Self
source§impl From<Mat3> for AngularInertiaTensor
impl From<Mat3> for AngularInertiaTensor
source§impl FromReflect for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl FromReflect for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
source§fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
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 AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl GetTypeRegistration for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
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 AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl PartialReflect for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
source§fn clone_value(&self) -> Box<dyn PartialReflect>
fn clone_value(&self) -> Box<dyn PartialReflect>
Reflect
trait object. Read moresource§fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
fn try_apply(&mut self, value: &dyn PartialReflect) -> 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<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
source§fn try_into_reflect(
self: Box<Self>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
source§fn try_as_reflect(&self) -> Option<&dyn Reflect>
fn try_as_reflect(&self) -> Option<&dyn Reflect>
source§fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
source§fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
source§fn as_partial_reflect(&self) -> &dyn PartialReflect
fn as_partial_reflect(&self) -> &dyn PartialReflect
source§fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
source§fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
source§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
source§impl Reflect for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Reflect for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any
. Read moresource§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
source§impl TryFrom<Vec3> for AngularInertiaTensor
impl TryFrom<Vec3> for AngularInertiaTensor
source§impl TupleStruct for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl TupleStruct for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
source§fn field(&self, index: usize) -> Option<&dyn PartialReflect>
fn field(&self, index: usize) -> Option<&dyn PartialReflect>
index
as a
&dyn Reflect
.source§fn field_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
fn field_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
index
as a &mut dyn Reflect
.source§fn iter_fields(&self) -> TupleStructFieldIter<'_>
fn iter_fields(&self) -> TupleStructFieldIter<'_>
source§fn clone_dynamic(&self) -> DynamicTupleStruct
fn clone_dynamic(&self) -> DynamicTupleStruct
DynamicTupleStruct
.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 AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Typed for AngularInertiaTensorwhere
AngularInertiaTensor: Any + Send + Sync,
Mat3: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
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> 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
. Box<dyn Any>
can
then be further downcast
into Box<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>
. Rc<Any>
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> 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> 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> 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 more