CubeSurfacePoint

Enum CubeSurfacePoint 

Source
#[repr(u8)]
pub enum CubeSurfacePoint {
Show 48 variants PosOnePosTwoPosThree = 0, PosOnePosTwoNegThree = 1, PosOneNegTwoPosThree = 2, PosOneNegTwoNegThree = 3, NegOnePosTwoPosThree = 4, NegOnePosTwoNegThree = 5, NegOneNegTwoPosThree = 6, NegOneNegTwoNegThree = 7, PosThreePosTwoPosOne = 8, PosThreePosTwoNegOne = 9, PosThreeNegTwoPosOne = 10, PosThreeNegTwoNegOne = 11, NegThreePosTwoPosOne = 12, NegThreePosTwoNegOne = 13, NegThreeNegTwoPosOne = 14, NegThreeNegTwoNegOne = 15, PosOnePosThreePosTwo = 16, PosOnePosThreeNegTwo = 17, PosOneNegThreePosTwo = 18, PosOneNegThreeNegTwo = 19, NegOnePosThreePosTwo = 20, NegOnePosThreeNegTwo = 21, NegOneNegThreePosTwo = 22, NegOneNegThreeNegTwo = 23, PosThreePosOnePosTwo = 24, PosThreePosOneNegTwo = 25, PosThreeNegOnePosTwo = 26, PosThreeNegOneNegTwo = 27, NegThreePosOnePosTwo = 28, NegThreePosOneNegTwo = 29, NegThreeNegOnePosTwo = 30, NegThreeNegOneNegTwo = 31, PosTwoPosOnePosThree = 32, PosTwoPosOneNegThree = 33, PosTwoNegOnePosThree = 34, PosTwoNegOneNegThree = 35, NegTwoPosOnePosThree = 36, NegTwoPosOneNegThree = 37, NegTwoNegOnePosThree = 38, NegTwoNegOneNegThree = 39, PosTwoPosThreePosOne = 40, PosTwoPosThreeNegOne = 41, PosTwoNegThreePosOne = 42, PosTwoNegThreeNegOne = 43, NegTwoPosThreePosOne = 44, NegTwoPosThreeNegOne = 45, NegTwoNegThreePosOne = 46, NegTwoNegThreeNegOne = 47,
}
Expand description

Encodes the 48 possible points in space whose coördinates, in ascending order of absolute value, are equal to [1, 2, 3].

Uses 6 bits, and is therefore represented as a u8.

§Usage

let test = PosOnePosTwoPosThree;
assert_eq!(test as u8, 0);

§Representation

The bits of each encoding correspond one-by-one to the Elementary Reflections that have to happen to the Reference Point in order to produce the result we want. The documentation for the Rotation data-type contains more details.

§Geometric Groups

A very important property is that those points can be divided into two geometric categories, depending on whether the amount of ones in their binary representation is odd or even. In each group, each CubeSurfacePoint can be made to coincide with any other point using just one rotation. For it to coincide with a point from the other group, however, it’d also require a reflection, or what’s called an “improper rotation” or “rotoreflection”. The ReferenceGroupPoint and OppositeGroupPoint data-types separate the two, and respectively correspond to the ProperRotation and ImproperRotation transformation data-types.

Below please find each possible point, along with the transformation to which it corresponds. The signs for the rotations have been chosen in accordance with the nalgebra crate.

Variants§

§

PosOnePosTwoPosThree = 0

The point [1, 2, 3]. Also the Point of Reference. Divided by itself, it yields –unsurprisingly enough– the identity operation.

§

PosOnePosTwoNegThree = 1

The point [1, 2, -3]. Divided by the Reference Point, it yields a reflection through the z = 0 plane. Its arithmetic representation is equal to 20, thus it is the zeroth Elementary Reflection.

§

PosOneNegTwoPosThree = 2

The point [1, -2, 3]. Divided by the Reference Point, it yields a reflection through the y = 0 plane. Its arithmetic representation is equal to 21, thus it is the first Elementary Reflection.

§

PosOneNegTwoNegThree = 3

The point [1, -2, -3]. Divided by the Reference Point, it yields a rotation of 180° around the x axis.

§

NegOnePosTwoPosThree = 4

The point [-1, 2, 3]. Divided by the Reference Point, it yields a reflection through the x = 0 plane. Its arithmetic representation is equal to 22, thus it is the second Elementary Reflection.

§

NegOnePosTwoNegThree = 5

The point [-1, 2, -3]. Divided by the Reference Point, it yields a rotation of 180° around the y axis.

§

NegOneNegTwoPosThree = 6

The point [-1, -2, 3]. Divided by the Reference Point, it yields a rotation of 180° around the z axis.

§

NegOneNegTwoNegThree = 7

The point [-1, -2, -3]. Divided by the Reference Point, it yields a complete central inversion, ie a negation of all coördinates.

§

PosThreePosTwoPosOne = 8

The point [3, 2, 1]. Divided by the Reference Point, it yields a reflection through the x = z plane. Its arithmetic representation is equal to 23, thus it is the third Elementary Reflection.

§

PosThreePosTwoNegOne = 9

The point [3, 2, -1]. Divided by the Reference Point, it yields a rotation of 90° around the y axis.

§

PosThreeNegTwoPosOne = 10

The point [3, -2, 1]. Divided by the Reference Point, it yields a rotation of 180° around the y = 0, z = x axis.

§

PosThreeNegTwoNegOne = 11

The point [3, -2, -1]. Divided by the Reference Point, it yields a rotoreflection of 90° with respect to the y axis.

§

NegThreePosTwoPosOne = 12

The point [-3, 2, 1]. Divided by the Reference Point, it yields a rotation of -90° around the y axis.

§

NegThreePosTwoNegOne = 13

The point [-3, 2, -1]. Divided by the Reference Point, it yields a reflection through the z = -x plane.

§

NegThreeNegTwoPosOne = 14

The point [-3, -2, 1]. Divided by the Reference Point, it yields a rotoreflection of -90° with respect to the y axis.

§

NegThreeNegTwoNegOne = 15

The point [-3, -2, -1]. Divided by the Reference Point, it yields a rotation of 180° around the y = 0, z = -x axis.

§

PosOnePosThreePosTwo = 16

The point [1, 3, 2]. Divided by the Reference Point, it yields a reflection through the z = y plane. Its arithmetic representation is equal to 24, thus it is the fourth Elementary Reflection.

§

PosOnePosThreeNegTwo = 17

The point [1, 3, -2]. Divided by the Reference Point, it yields a rotation of -90° around the x axis.

§

PosOneNegThreePosTwo = 18

The point [1, -3, 2]. Divided by the Reference Point, it yields a rotation of 90° around the x axis.

§

PosOneNegThreeNegTwo = 19

The point [1, -3, -2]. Divided by the Reference Point, it yields a reflection through the y = -z plane.

§

NegOnePosThreePosTwo = 20

The point [-1, 3, 2]. Divided by the Reference Point, it yields a rotation of 180° around the x = 0, y = z axis.

§

NegOnePosThreeNegTwo = 21

The point [-1, 3, -2]. Divided by the Reference Point, it yields a rotoreflection of -90° with respect to the x = y = z axis.

§

NegOneNegThreePosTwo = 22

The point [-1, -3, 2]. Divided by the Reference Point, it yields a rotoreflection of 90° with respect to the x axis.

§

NegOneNegThreeNegTwo = 23

The point [-1, -3, -2]. Divided by the Reference Point, it yields a rotation of 180° around the x = 0, y = -z axis.

§

PosThreePosOnePosTwo = 24

The point [3, 1, 2]. Divided by the Reference Point, it yields a rotation of 120° around the x = y = z axis.

§

PosThreePosOneNegTwo = 25

The point [3, 1, -2]. Divided by the Reference Point, it yields a rotoreflection of -60° with respect to the x = -y = -z axis.

§

PosThreeNegOnePosTwo = 26

The point [3, -1, 2]. Divided by the Reference Point, it yields a rotoreflection of 60° with respect to the x = y = -z axis.

§

PosThreeNegOneNegTwo = 27

The point [3, -1, -2]. Divided by the Reference Point, it yields a rotation of -120° around the x = -y = z axis.

§

NegThreePosOnePosTwo = 28

The point [-3, 1, 2]. Divided by the Reference Point, it yields a rotoreflection of 60° with respect to the x = -y = z axis.

§

NegThreePosOneNegTwo = 29

The point [-3, 1, -2]. Divided by the Reference Point, it yields a rotation of -120° around the x = y = -z axis.

§

NegThreeNegOnePosTwo = 30

The point [-3, -1, 2]. Divided by the Reference Point, it yields a rotation of 120° around the x = -y = -z axis.

§

NegThreeNegOneNegTwo = 31

The point [-3, -1, -2]. Divided by the Reference Point, it yields a rotoreflection of -60° with respect to the x = y = z axis.

§

PosTwoPosOnePosThree = 32

The point [2, 1, 3]. Divided by the Reference Point, it yields a reflection through the y = x plane. Its arithmetic representation is equal to 25, thus it is the fifth and final Elementary Reflection.

§

PosTwoPosOneNegThree = 33

The point [2, 1, -3]. Divided by the Reference Point, it yields a rotation of 180° around the z = 0, x = y axis.

§

PosTwoNegOnePosThree = 34

The point [2, -1, 3]. Divided by the Reference Point, it yields a rotation of -90° around the z axis.

§

PosTwoNegOneNegThree = 35

The point [2, -1, -3]. Divided by the Reference Point, it yields a reflection through the x = -y plane.

§

NegTwoPosOnePosThree = 36

The point [-2, 1, 3]. Divided by the Reference Point, it yields a rotation of 90° around the z axis.

§

NegTwoPosOneNegThree = 37

The point [-2, 1, -3]. Divided by the Reference Point, it yields a rotoreflection of 90° with respect to the z axis.

§

NegTwoNegOnePosThree = 38

The point [-2, -1, 3]. Divided by the Reference Point, it yields a rotoreflection of -90° with respect to the z axis.

§

NegTwoNegOneNegThree = 39

The point [-2, -1, -3]. Divided by the Reference Point, it yields a rotation of 180° around the z = 0, x = -y axis.

§

PosTwoPosThreePosOne = 40

The point [2, 3, 1]. Divided by the Reference Point, it yields a rotation of -120° around the x = y = z axis.

§

PosTwoPosThreeNegOne = 41

The point [2, 3, -1]. Divided by the Reference Point, it yields a rotoreflection of -60° with respect to the x = -y = z axis.

§

PosTwoNegThreePosOne = 42

The point [2, -3, 1]. Divided by the Reference Point, it yields a rotoreflection of 60° with respect to the x = -y = -z axis.

§

PosTwoNegThreeNegOne = 43

The point [2, -3, -1]. Divided by the Reference Point, it yields a rotation of 120° around the x = y = -z axis.

§

NegTwoPosThreePosOne = 44

The point [-2, 3, 1]. Divided by the Reference Point, it yields a rotoreflection of -60° with respect to the x = y = -z axis.

§

NegTwoPosThreeNegOne = 45

The point [-2, 3, -1]. Divided by the Reference Point, it yields a rotation of -120° around the x = -y = -z axis.

§

NegTwoNegThreePosOne = 46

The point [-2, -3, 1]. Divided by the Reference Point, it yields a rotation of 120° around the x = -y = z axis.

§

NegTwoNegThreeNegOne = 47

The point [-2, -3, -1]. Divided by the Reference Point, it yields a rotoreflection of 60° with respect to the x = y = z axis.

Implementations§

Source§

impl CubeSurfacePoint

Source

pub const REFERENCE_POINT: Self

The point chosen as a Reference Point, according to which all rotations are judged.

Its binary representation is 0 by definition.

The point [1, 2, 3] has been chosen as the Reference Point for this crate, corresponding to CubeSurfacePoint::PosOnePosTwoPosThree.

Source

pub const fn odd_ones(self) -> bool

Counts how many ones there are in the binary representation of a certain CubeSurfacePoint, so it can be judged in which geometric group it belongs.

assert_eq!(PosTwoNegThreeNegOne.odd_ones(), false);
Source

pub const fn even_ones(self) -> bool

Equal to the negation of CubeSurfacePoint::odd_ones by definition.

Source

pub const fn determine_group( self: CubeSurfacePoint, ) -> Result<ReferenceGroupPoint, OppositeGroupPoint>

Discriminates a given CubeSurfacePoint depending on the geometric group to which it belongs. If it belongs to the Reference Rotation Group, it returns an Ok<ReferenceGroupPoint>, else it returns an Err<OppositeGroupPoint>.

Source

pub const fn determine_antigroup( self: CubeSurfacePoint, ) -> Result<OppositeGroupPoint, ReferenceGroupPoint>

The same as CubeSurfacePoint::determine_group(), but returns an Ok value for OppositeGroupPoints and an Err value otherwise.

Source

pub const fn opposite(self) -> Self

Returns the point in the corresponding position of the opposite side of the cube.

Basically, finds which coördinate has an absolute value of 3 and multiplies it by -1.

assert_eq!(PosOnePosTwoPosThree.opposite(), PosOnePosTwoNegThree);
Source

pub const fn beside(self) -> Self

Returns the other point found in the same edge of the same face of the cube.

Basically, finds which coördinate has an absolute value of 1 and multiplies it by -1.

assert_eq!(PosOnePosTwoPosThree.beside(), NegOnePosTwoPosThree);
Source

pub const fn opposite_then_beside(self) -> Self

Functionally identical to self.opposite().beside(), or (equivalently) self.beside().opposite(). Implemented separately for optimisation purposes, as

  1. It was useful for our purposes,
  2. It maintains the geometric group of its input, and
  3. It is way simpler to implement than either function separately.

Corresponds to a rotation of 180° as seen from the face to which the point is closest without being on.

assert_eq!(PosOnePosTwoPosThree.opposite_then_beside(), NegOnePosTwoNegThree);
Source

pub const fn beside_then_opposite(self) -> Self

Source

pub const fn flip_sign_of_1(self) -> Self

Different name for CubeSurfacePoint::beside.

Source

pub const fn flip_sign_of_2(self) -> Self

No idea if this if going to be useful, but it’s so easy to implement that we might as well do so for completeness.

Source

pub const fn flip_sign_of_3(self) -> Self

Different name for the CubeSurfacePoint::opposite function.

Source

pub const fn flip_1_and_3(self) -> Self

Different name for CubeSurfacePoint::opposite_then_beside.

Corresponds to a rotation of 180° as seen from the face to which the point is closest without being on.

Source

pub const fn flip_2_and_3(self) -> Self

A rotation of 180° as seen from a face which the point is neither on nor close to.

Source

pub const fn flip_1_and_2(self) -> Self

A rotation of 180° as seen from the face on which the point is located.

Source

pub const fn try_from_u8(x: u8) -> Option<Self>

A helper const function for turning u8s into CubeSurfacePoints.

Source

pub const fn mul(self, rot: Rotation) -> Self

Because Mul is not const.

Source

pub const fn div(self, divisor: Self) -> Rotation

Because Div is not const.

Source

pub const fn one_right_angle<const CLOCKWISE: bool>(self) -> Self

Returns the CubeSurfacePoint which is positioned 90° from self –clockwise or anti-clockwise depending on the const parametre of the same name– as viewed from the edge on which both are located.

Source

pub const fn one_right_angle_cw(self) -> Self

Returns the CubeSurfacePoint which is positioned 90° clockwise from self, as viewed from the edge on which both are located.

assert_eq!(random_point.direction(),
        random_point.one_right_angle_cw().direction())
Source

pub const fn one_right_angle_acw(self) -> Self

Returns the CubeSurfacePoint which is positioned 90° anti-clockwise from self, as viewed from the edge on which both are located.

assert_eq!(random_point.direction(),
        random_point.one_right_angle_acw().direction())
Source

pub const fn n_right_angles<const CLOCKWISE: bool>(self, angle: u8) -> Self

Returns the CubeSurfacePoint which is positioned (90 * n)° from self –clockwise or anti-clockwise depending on the const parametre of the same name–, as viewed from the edge on which both are located.

Source

pub const fn n_right_angles_cw(self, angle: u8) -> CubeSurfacePoint

Returns the CubeSurfacePoint which is positioned (90 * n)° clockwise from self, as viewed from the edge on which both are located.

let surface_point = PosOnePosTwoPosThree;
let rotated_1 = surface_point
        .one_right_angle_cw()
        .one_right_angle_cw();
let rotated_2 = surface_point
        .n_right_angles_cw(2);
assert_eq!(rotated_1, rotated_2);
Source

pub const fn n_right_angles_acw(self, angle: u8) -> CubeSurfacePoint

Returns the CubeSurfacePoint which is positioned (90 * n)° anti-clockwise from self, as viewed from the edge on which both are located.

let surface_point = PosOnePosTwoPosThree;
let rotated_1 = surface_point
        .one_right_angle_cw()
        .one_right_angle_cw()
        .one_right_angle_cw();
let rotated_2 = surface_point
        .n_right_angles_acw(1);
assert_eq!(rotated_1, rotated_2);
Source

pub const fn direction(self) -> Direction

Returns the spatial direction towards which self is oriented.

Essentially finds which coördinate has an absolute value of 3, and judges by that.

assert_eq!(PosOnePosTwoPosThree.direction(), Up);
assert_eq!(PosOnePosTwoNegThree.direction(), Down);
assert_eq!(PosOnePosThreePosTwo.direction(), Front);
assert_eq!(PosOneNegThreePosTwo.direction(), Back);
assert_eq!(PosThreePosTwoPosOne.direction(), Right);
assert_eq!(NegThreePosTwoPosOne.direction(), Left);

Trait Implementations§

Source§

impl Clone for CubeSurfacePoint

Source§

fn clone(&self) -> CubeSurfacePoint

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 CubeSurfacePoint

Source§

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

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

impl Div for CubeSurfacePoint

Extracts the rotation that must occur so that the divisor point ends up coinciding with self, ie the dividend.

Source§

type Output = Rotation

A rotation, either proper or improper.

Source§

fn div(self, divisor: Self) -> Self::Output

The operation occurs by finding the reciprocal of the divisor, and rotating it as described by self.

Source§

impl<const BIG_LUTS: bool> From<CubeSurfacePoint<BIG_LUTS>> for CubeSurfacePoint

Source§

fn from(x: CubeSurfacePoint<BIG_LUTS>) -> Self

Converts to this type from the input type.
Source§

impl<const BIG_LUTS: bool> From<CubeSurfacePoint> for CubeSurfacePoint<BIG_LUTS>

Source§

fn from(x: CratePt) -> Self

Converts to this type from the input type.
Source§

impl From<CubeSurfacePoint> for Rotation

Source§

fn from(corresponding_point: CubeSurfacePoint) -> Self

Converts to this type from the input type.
Source§

impl From<OppositeGroupPoint> for CratePt

Discards any knowledge of Geometric Group, producing a general crate::CubeSurfacePoint.

Source§

fn from(x: OppositeGroupPoint) -> CratePt

Converts to this type from the input type.
Source§

impl From<OppositeGroupPoint> for CubeSurfacePoint

Discards any knowledge of Geometric Group, producing a general CubeSurfacePoint.

Source§

fn from(x: OppositeGroupPoint) -> Self

Converts to this type from the input type.
Source§

impl From<ReferenceGroupPoint> for CratePt

Discards any knowledge of Geometric Group, producing a general crate::CubeSurfacePoint.

Source§

fn from(x: ReferenceGroupPoint) -> CratePt

Converts to this type from the input type.
Source§

impl From<ReferenceGroupPoint> for CubeSurfacePoint

Discards any knowledge of Geometric Group, producing a general CubeSurfacePoint.

Source§

fn from(x: ReferenceGroupPoint) -> Self

Converts to this type from the input type.
Source§

impl From<Rotation> for CubeSurfacePoint

Source§

fn from(x: Rotation) -> Self

Converts to this type from the input type.
Source§

impl Mul<CubeSurfacePoint> for Rotation

Rotates a given CubeSurfacePoint according to self.

Source§

type Output = CubeSurfacePoint

Output same as input.

Source§

fn mul(self, cub_sur_pt: CubeSurfacePoint) -> Self::Output

The operation is performed by examining self’s bits one by one, and performing on the other surface_point the corresponding elementary reflections.

Source§

impl Mul<ImproperRotation> for CubeSurfacePoint

Rotates a copy of self in a way that switches its Geometric Group.

Source§

type Output = CubeSurfacePoint

Although the Geometric Group does change, CubeSurfacePoint does not change its data-type depending on Geometric Group. Thus the data-type remains the same.

Source§

fn mul(self, rotation: ImproperRotation) -> Self

Performs the * operation. Read more
Source§

impl Mul<ProperRotation> for CubeSurfacePoint

Rotates a copy of self in a way that maintains its Geometric Group.

Source§

type Output = CubeSurfacePoint

The Geometric Group doesn’t change. Even if it did, this data-type is group-agnostic.

Source§

fn mul(self, rotation: ProperRotation) -> Self

Performs the * operation. Read more
Source§

impl Mul<Rotation> for CubeSurfacePoint

Rotates a copy of self per some Rotation.

Source§

type Output = CubeSurfacePoint

Output same as input.

Source§

fn mul(self, rot: Rotation) -> Self::Output

The operation is performed by examining the bits of the Rotation one-by-one, then performing the corresponding elementary reflections on self.

Source§

impl MulAssign<ImproperRotation> for CubeSurfacePoint

Rotates self in a way that switches its Geometric Group.

Source§

fn mul_assign(&mut self, x: ImproperRotation)

The data-type remains the same, despite the Geometric Group changing. Thus, the result can be directly assigned.

Source§

impl MulAssign<ProperRotation> for CubeSurfacePoint

Rotates self in a way that maintains its Geometric Group.

Source§

fn mul_assign(&mut self, x: ProperRotation)

Neither the Geometric Group nor the data-type change, so the result can be directly assigned.

Source§

impl MulAssign<Rotation> for CubeSurfacePoint

Rotates self per some Rotation.

Source§

fn mul_assign(&mut self, rot: Rotation)

The data-type doesn’t change, so the result can be directly assigned.

Source§

impl OctahedrallySymmetricPoint for CubeSurfacePoint

Source§

type OtherGroup = CubeSurfacePoint

The geometric group mirror to the one to which self belongs.
Source§

fn beside(self) -> Self::OtherGroup

Returns the other point found in the same edge of the same face of the cube.
Source§

fn opposite(self) -> Self::OtherGroup

Returns the point in the corresponding position of the opposite face of the cube.
Source§

fn opposite_then_beside(self) -> Self

Functionally identical to self.opposite().beside(). Also available with the words swapped, as the order doesn’t matter. Read more
Source§

fn one_right_angle_cw(self) -> Self

Returns the point which is positioned 90° clockwise from self, as viewed from the face on which both are located.
Source§

fn one_right_angle_acw(self) -> Self

Returns the point which is positioned 90° anti-clockwise from self, as viewed from the face on which both are located.
Source§

fn flip_sign_of_2(self) -> Self::OtherGroup

Flips the sign of the coördinate whose absolute value is 2.
Source§

fn flip_2_and_3(self) -> Self

Flips the sign of the coördinates whose absolute values are 2 and 3. Read more
Source§

fn direction(self) -> Direction

Returns the spatial direction towards which self is oriented.
Source§

fn n_right_angles_cw(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° clockwise from self, as viewed from the face on which both are located.
Source§

fn n_right_angles_acw(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° anti-clockwise from self, as viewed from the face on which both are located.
Source§

fn odd_ones(self) -> bool

Counts how many ones there are in the binary representation of a certain point, so it can be judged in which geometric group it belongs.
Source§

fn even_ones(self) -> bool

Equal to the negation of Self::odd_ones by definition.
Source§

fn n_right_angles<const CLOCKWISE: bool>(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° from self, as viewed from the face on which both are located.
Source§

fn beside_then_opposite(self) -> Self

Source§

fn flip_1_and_3(self) -> Self

Source§

fn flip_sign_of_1(self) -> Self::OtherGroup

Different name for CubeSurfacePoint::beside
Source§

fn flip_sign_of_3(self) -> Self::OtherGroup

Different name for CubeSurfacePoint::opposite
Source§

fn flip_1_and_2(self) -> Self

Flips the sign of the coördinates whose absolute values are 1 and 2. Read more
Source§

impl Ord for CubeSurfacePoint

Source§

fn cmp(&self, other: &CubeSurfacePoint) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for CubeSurfacePoint

Source§

fn eq(&self, other: &CubeSurfacePoint) -> 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 PartialOrd for CubeSurfacePoint

Source§

fn partial_cmp(&self, other: &CubeSurfacePoint) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<CubeSurfacePoint> for OppositeGroupPoint

Source§

type Error = ReferenceGroupPoint

If a certain CubeSurfacePoint does not belong to the OppositeGroupPoints, it must by necessity belong to the ReferenceGroupPoints.

Source§

fn try_from(x: CratePt) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<CubeSurfacePoint> for OppositeGroupPoint

Source§

type Error = ReferenceGroupPoint

If a certain CubeSurfacePoint does not belong to the OppositeGroupPoints, it must by necessity belong to the ReferenceGroupPoints.

Source§

fn try_from(x: CubeSurfacePoint) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<CubeSurfacePoint> for ReferenceGroupPoint

Source§

type Error = OppositeGroupPoint

If a certain CubeSurfacePoint does not belong to the ReferenceGroupPoints, it must by necessity belong to the OppositeGroupPoints.

Source§

fn try_from(x: CratePt) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<CubeSurfacePoint> for ReferenceGroupPoint

Source§

type Error = OppositeGroupPoint

If a certain CubeSurfacePoint does not belong to the ReferenceGroupPoints, it must by necessity belong to the OppositeGroupPoints.

Source§

fn try_from(x: CubeSurfacePoint) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u8> for CubeSurfacePoint

Converts an u8 to a CubeSurfacePoint, if it is within limits.

If it is not, the u8 is returned as-is.

Source§

type Error = u8

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

fn try_from(input: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for CubeSurfacePoint

Source§

impl Eq for CubeSurfacePoint

Source§

impl StructuralPartialEq for CubeSurfacePoint

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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