Struct Integer3

Source
#[repr(C)]
pub struct Integer3 { pub x: i32, pub y: i32, pub z: i32, }
Expand description

A structure that stores three-dimensional integer data.

Fields§

§x: i32§y: i32§z: i32

Implementations§

Source§

impl Integer3

Source

pub const ZERO: Self

All elements are zero.

Source

pub const ONE: Self

All elements are one.

Source

pub const NEG_ONE: Self

All elements are negative one.

Source

pub const X: Self

positive unit vector on x-axis.

Source

pub const Y: Self

positive unit vector on y-axis.

Source

pub const Z: Self

positive unit vector on z-axis.

Source

pub const NEG_X: Self

negative unit vector on x-axis.

Source

pub const NEG_Y: Self

negative unit vector on y-axis.

Source

pub const NEG_Z: Self

negative unit vector on z-axis.

Source

pub const MIN: Self

All elements are i32::MIN.

Source

pub const MAX: Self

All elements are i32::MAX.

Source§

impl Integer3

Source

pub const fn xx(self) -> Integer2

Source

pub const fn xy(self) -> Integer2

Source

pub const fn xz(self) -> Integer2

Source

pub const fn yx(self) -> Integer2

Source

pub const fn yy(self) -> Integer2

Source

pub const fn yz(self) -> Integer2

Source

pub const fn zx(self) -> Integer2

Source

pub const fn zy(self) -> Integer2

Source

pub const fn zz(self) -> Integer2

Source

pub const fn xxx(self) -> Integer3

Source

pub const fn xxy(self) -> Integer3

Source

pub const fn xxz(self) -> Integer3

Source

pub const fn xyx(self) -> Integer3

Source

pub const fn xyy(self) -> Integer3

Source

pub const fn xyz(self) -> Integer3

Source

pub const fn xzx(self) -> Integer3

Source

pub const fn xzy(self) -> Integer3

Source

pub const fn xzz(self) -> Integer3

Source

pub const fn yxx(self) -> Integer3

Source

pub const fn yxy(self) -> Integer3

Source

pub const fn yxz(self) -> Integer3

Source

pub const fn yyx(self) -> Integer3

Source

pub const fn yyy(self) -> Integer3

Source

pub const fn yyz(self) -> Integer3

Source

pub const fn yzx(self) -> Integer3

Source

pub const fn yzy(self) -> Integer3

Source

pub const fn yzz(self) -> Integer3

Source

pub const fn zxx(self) -> Integer3

Source

pub const fn zxy(self) -> Integer3

Source

pub const fn zxz(self) -> Integer3

Source

pub const fn zyx(self) -> Integer3

Source

pub const fn zyy(self) -> Integer3

Source

pub const fn zyz(self) -> Integer3

Source

pub const fn zzx(self) -> Integer3

Source

pub const fn zzy(self) -> Integer3

Source

pub const fn zzz(self) -> Integer3

Source

pub const fn xxxx(self) -> Integer4

Source

pub const fn xxxy(self) -> Integer4

Source

pub const fn xxxz(self) -> Integer4

Source

pub const fn xxyx(self) -> Integer4

Source

pub const fn xxyy(self) -> Integer4

Source

pub const fn xxyz(self) -> Integer4

Source

pub const fn xxzx(self) -> Integer4

Source

pub const fn xxzy(self) -> Integer4

Source

pub const fn xxzz(self) -> Integer4

Source

pub const fn xyxx(self) -> Integer4

Source

pub const fn xyxy(self) -> Integer4

Source

pub const fn xyxz(self) -> Integer4

Source

pub const fn xyyx(self) -> Integer4

Source

pub const fn xyyy(self) -> Integer4

Source

pub const fn xyyz(self) -> Integer4

Source

pub const fn xyzx(self) -> Integer4

Source

pub const fn xyzy(self) -> Integer4

Source

pub const fn xyzz(self) -> Integer4

Source

pub const fn xzxx(self) -> Integer4

Source

pub const fn xzxy(self) -> Integer4

Source

pub const fn xzxz(self) -> Integer4

Source

pub const fn xzyx(self) -> Integer4

Source

pub const fn xzyy(self) -> Integer4

Source

pub const fn xzyz(self) -> Integer4

Source

pub const fn xzzx(self) -> Integer4

Source

pub const fn xzzy(self) -> Integer4

Source

pub const fn xzzz(self) -> Integer4

Source

pub const fn yxxx(self) -> Integer4

Source

pub const fn yxxy(self) -> Integer4

Source

pub const fn yxxz(self) -> Integer4

Source

pub const fn yxyx(self) -> Integer4

Source

pub const fn yxyy(self) -> Integer4

Source

pub const fn yxzx(self) -> Integer4

Source

pub const fn yxzy(self) -> Integer4

Source

pub const fn yxzz(self) -> Integer4

Source

pub const fn yyxx(self) -> Integer4

Source

pub const fn yyxy(self) -> Integer4

Source

pub const fn yyxz(self) -> Integer4

Source

pub const fn yyyx(self) -> Integer4

Source

pub const fn yyyy(self) -> Integer4

Source

pub const fn yyyz(self) -> Integer4

Source

pub const fn yyzx(self) -> Integer4

Source

pub const fn yyzy(self) -> Integer4

Source

pub const fn yyzz(self) -> Integer4

Source

pub const fn yzxx(self) -> Integer4

Source

pub const fn yzxy(self) -> Integer4

Source

pub const fn yzxz(self) -> Integer4

Source

pub const fn yzyx(self) -> Integer4

Source

pub const fn yzyy(self) -> Integer4

Source

pub const fn yzyz(self) -> Integer4

Source

pub const fn yzzx(self) -> Integer4

Source

pub const fn yzzy(self) -> Integer4

Source

pub const fn yzzz(self) -> Integer4

Source

pub const fn zxxx(self) -> Integer4

Source

pub const fn zxxy(self) -> Integer4

Source

pub const fn zxxz(self) -> Integer4

Source

pub const fn zxyx(self) -> Integer4

Source

pub const fn zxyy(self) -> Integer4

Source

pub const fn zxyz(self) -> Integer4

Source

pub const fn zxzx(self) -> Integer4

Source

pub const fn zxzy(self) -> Integer4

Source

pub const fn zxzz(self) -> Integer4

Source

pub const fn zyxx(self) -> Integer4

Source

pub const fn zyxy(self) -> Integer4

Source

pub const fn zyxz(self) -> Integer4

Source

pub const fn zyyx(self) -> Integer4

Source

pub const fn zyyy(self) -> Integer4

Source

pub const fn zyyz(self) -> Integer4

Source

pub const fn zyzx(self) -> Integer4

Source

pub const fn zyzy(self) -> Integer4

Source

pub const fn zyzz(self) -> Integer4

Source

pub const fn zzxx(self) -> Integer4

Source

pub const fn zzxy(self) -> Integer4

Source

pub const fn zzxz(self) -> Integer4

Source

pub const fn zzyx(self) -> Integer4

Source

pub const fn zzyy(self) -> Integer4

Source

pub const fn zzyz(self) -> Integer4

Source

pub const fn zzzx(self) -> Integer4

Source

pub const fn zzzy(self) -> Integer4

Source

pub const fn zzzz(self) -> Integer4

Source§

impl Integer3

Source

pub const fn new(x: i32, y: i32, z: i32) -> Self

Creates with given elements.

Source

pub const fn fill(val: i32) -> Self

Fills all elements with the given values.

Source

pub const fn from_array(arr: [i32; 3]) -> Self

Creates with given array.

Source

pub const fn to_array(self) -> [i32; 3]

Convert to array.

Source

pub fn from_slice(slice: &[i32]) -> Self

Creates with given slice.

§Panics

If the length of the given array is less than the number of elements in the vector, an index out of range error occurs.

Source

pub const fn from_tuple(tuple: (i32, i32, i32)) -> Self

Creates with given tuple.

Source

pub const fn to_tuple(self) -> (i32, i32, i32)

Convert to tuple.

Source

pub fn set_x(self, x: i32) -> Integer3

Sets the value of the x element.

Source

pub fn set_y(self, y: i32) -> Integer3

Sets the value of the y element.

Source

pub fn set_z(self, z: i32) -> Integer3

Sets the value of the z element.

Trait Implementations§

Source§

impl Add<Integer3> for i32

Source§

fn add(self, rhs: Integer3) -> Self::Output

Adds a vector elements to scalar value.

Source§

type Output = Integer3

The resulting type after applying the + operator.
Source§

impl Add<i32> for Integer3

Source§

fn add(self, rhs: i32) -> Self::Output

Adds a scalar value to vector elements.

Source§

type Output = Integer3

The resulting type after applying the + operator.
Source§

impl Add for Integer3

Source§

fn add(self, rhs: Integer3) -> Self::Output

Adds two vectors.

Source§

type Output = Integer3

The resulting type after applying the + operator.
Source§

impl AddAssign<i32> for Integer3

Source§

fn add_assign(&mut self, rhs: i32)

Adds a scalar value to vector elements. (assign)

Source§

impl AddAssign for Integer3

Source§

fn add_assign(&mut self, rhs: Integer3)

Adds two vectors. (assign)

Source§

impl AsMut<[i32; 3]> for Integer3

Source§

fn as_mut(&mut self) -> &mut [i32; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[i32; 3]> for Integer3

Source§

fn as_ref(&self) -> &[i32; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl BitAnd for Integer3

Source§

fn bitand(self, rhs: Self) -> Self::Output

Element-wise bit AND operation of two vectors.

Source§

type Output = Integer3

The resulting type after applying the & operator.
Source§

impl BitAndAssign for Integer3

Source§

fn bitand_assign(&mut self, rhs: Self)

Element-wise bit AND operation of two vectors. (assign)

Source§

impl BitOr for Integer3

Source§

fn bitor(self, rhs: Self) -> Self::Output

Element-wise bit OR operation of two vectors.

Source§

type Output = Integer3

The resulting type after applying the | operator.
Source§

impl BitOrAssign for Integer3

Source§

fn bitor_assign(&mut self, rhs: Self)

Element-wise bit OR operation of two vectors. (assign)

Source§

impl BitXor for Integer3

Source§

fn bitxor(self, rhs: Self) -> Self::Output

Element-wise bit XOR operation of two vectors.

Source§

type Output = Integer3

The resulting type after applying the ^ operator.
Source§

impl BitXorAssign for Integer3

Source§

fn bitxor_assign(&mut self, rhs: Self)

Element-wise bit XOR operation of two vectors. (assign)

Source§

impl Clone for Integer3

Source§

fn clone(&self) -> Integer3

Returns a copy 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 Integer3

Source§

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

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

impl Default for Integer3

Source§

fn default() -> Self

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

impl Display for Integer3

Source§

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

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

impl Div<Integer3> for i32

Source§

fn div(self, rhs: Integer3) -> Self::Output

Divide a scalar value to a vector elements.

Source§

type Output = Integer3

The resulting type after applying the / operator.
Source§

impl Div<i32> for Integer3

Source§

fn div(self, rhs: i32) -> Self::Output

Divide a vector elements to a scalar value.

Source§

type Output = Integer3

The resulting type after applying the / operator.
Source§

impl Div for Integer3

Source§

fn div(self, rhs: Integer3) -> Self::Output

Element-wise division of two vectors.

Source§

type Output = Integer3

The resulting type after applying the / operator.
Source§

impl DivAssign<i32> for Integer3

Source§

fn div_assign(&mut self, rhs: i32)

Divide a vector elements to a scalar value. (assign)

Source§

impl DivAssign for Integer3

Source§

fn div_assign(&mut self, rhs: Integer3)

Element-wise division of two vectors. (assign)

Source§

impl From<[i32; 3]> for Integer3

Source§

fn from(value: [i32; 3]) -> Self

Converts to this type from the input type.
Source§

impl From<(i32, i32, i32)> for Integer3

Source§

fn from(value: (i32, i32, i32)) -> Self

Converts to this type from the input type.
Source§

impl From<Integer2> for Integer3

Source§

fn from(value: Integer2) -> Self

Converts to this type from the input type.
Source§

impl From<Integer3> for Integer2

Source§

fn from(value: Integer3) -> Self

Converts to this type from the input type.
Source§

impl From<Integer3> for Integer4

Source§

fn from(value: Integer3) -> Self

Converts to this type from the input type.
Source§

impl From<Integer3> for VectorInt

Source§

fn from(value: Integer3) -> Self

Converts to this type from the input type.
Source§

impl From<Integer4> for Integer3

Source§

fn from(value: Integer4) -> Self

Converts to this type from the input type.
Source§

impl Index<usize> for Integer3

Source§

type Output = i32

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for Integer3

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl Into<[i32; 3]> for Integer3

Source§

fn into(self) -> [i32; 3]

Converts this type into the (usually inferred) input type.
Source§

impl Into<(i32, i32, i32)> for Integer3

Source§

fn into(self) -> (i32, i32, i32)

Converts this type into the (usually inferred) input type.
Source§

impl Into<Integer3> for VectorInt

Source§

fn into(self) -> Integer3

Converts this type into the (usually inferred) input type.
Source§

impl Mul<Integer3> for i32

Source§

fn mul(self, rhs: Integer3) -> Self::Output

Multiply a vector elements to scalar value.

Source§

type Output = Integer3

The resulting type after applying the * operator.
Source§

impl Mul<i32> for Integer3

Source§

fn mul(self, rhs: i32) -> Self::Output

Multiply a scalar value to vector elements.

Source§

type Output = Integer3

The resulting type after applying the * operator.
Source§

impl Mul for Integer3

Source§

fn mul(self, rhs: Integer3) -> Self::Output

Element-wise multiplication of two vectors.

Source§

type Output = Integer3

The resulting type after applying the * operator.
Source§

impl MulAssign<i32> for Integer3

Source§

fn mul_assign(&mut self, rhs: i32)

Multiply a scalar value to vector elements. (assign)

Source§

impl MulAssign for Integer3

Source§

fn mul_assign(&mut self, rhs: Integer3)

Element-wise multiplication of two vectors. (assign)

Source§

impl Neg for Integer3

Source§

type Output = Integer3

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Not for Integer3

Source§

fn not(self) -> Self::Output

Element-wise bit NOT operation of two vectors. (assign)

Source§

type Output = Integer3

The resulting type after applying the ! operator.
Source§

impl PartialEq for Integer3

Source§

fn eq(&self, other: &Integer3) -> 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 Rem<Integer3> for i32

Source§

fn rem(self, rhs: Integer3) -> Self::Output

Remainders a vector elements to a scalar value.

Source§

type Output = Integer3

The resulting type after applying the % operator.
Source§

impl Rem<i32> for Integer3

Source§

fn rem(self, rhs: i32) -> Self::Output

Remainders a scalar value to a vector elements.

Source§

type Output = Integer3

The resulting type after applying the % operator.
Source§

impl Rem for Integer3

Source§

fn rem(self, rhs: Integer3) -> Self::Output

Element-wise remaindation of two vectors.

Source§

type Output = Integer3

The resulting type after applying the % operator.
Source§

impl RemAssign<i32> for Integer3

Source§

fn rem_assign(&mut self, rhs: i32)

Remainders a scalar value to a vector elements. (assign)

Source§

impl RemAssign for Integer3

Source§

fn rem_assign(&mut self, rhs: Integer3)

Element-wise remaindation of two vectors. (assign)

Source§

impl Sub<Integer3> for i32

Source§

fn sub(self, rhs: Integer3) -> Self::Output

Subtracts a vector elements to scalar value.

Source§

type Output = Integer3

The resulting type after applying the - operator.
Source§

impl Sub<i32> for Integer3

Source§

fn sub(self, rhs: i32) -> Self::Output

Subtracts a scalar value to vector elements.

Source§

type Output = Integer3

The resulting type after applying the - operator.
Source§

impl Sub for Integer3

Source§

fn sub(self, rhs: Integer3) -> Self::Output

Subtracts two vectors.

Source§

type Output = Integer3

The resulting type after applying the - operator.
Source§

impl SubAssign<i32> for Integer3

Source§

fn sub_assign(&mut self, rhs: i32)

Subtracts a scalar value to vector elements. (assign)

Source§

impl SubAssign for Integer3

Source§

fn sub_assign(&mut self, rhs: Integer3)

Subtracts two vectors. (assign)

Source§

impl Copy for Integer3

Source§

impl Eq for Integer3

Source§

impl StructuralPartialEq for Integer3

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.