Struct slender_math::Vector2i
source · #[repr(C, align(8))]pub struct Vector2i(_);Expand description
A vector with 2 i32 components
Implementations§
source§impl Vector2i
impl Vector2i
sourcepub const fn from_scalar(scalar: i32) -> Self
pub const fn from_scalar(scalar: i32) -> Self
Creates a new vector by setting all components to the given scalar
sourcepub const fn from_array(array: [i32; 2]) -> Self
pub const fn from_array(array: [i32; 2]) -> Self
Creates a new vector from the given array
sourcepub fn as_mut_array(&mut self) -> &mut [i32; 2]
pub fn as_mut_array(&mut self) -> &mut [i32; 2]
Returns a mutable array reference to the vector
source§impl Vector2i
impl Vector2i
§impl Vector2i
impl Vector2i
pub fn xx(&self) -> Vector2i
pub fn xy(&self) -> Vector2i
pub fn yx(&self) -> Vector2i
pub fn yy(&self) -> Vector2i
pub fn xxx(&self) -> Vector3i
pub fn xxy(&self) -> Vector3i
pub fn xyx(&self) -> Vector3i
pub fn xyy(&self) -> Vector3i
pub fn yxx(&self) -> Vector3i
pub fn yxy(&self) -> Vector3i
pub fn yyx(&self) -> Vector3i
pub fn yyy(&self) -> Vector3i
pub fn xxxx(&self) -> Vector4i
pub fn xxxy(&self) -> Vector4i
pub fn xxyx(&self) -> Vector4i
pub fn xxyy(&self) -> Vector4i
pub fn xyxx(&self) -> Vector4i
pub fn xyxy(&self) -> Vector4i
pub fn xyyx(&self) -> Vector4i
pub fn xyyy(&self) -> Vector4i
pub fn yxxx(&self) -> Vector4i
pub fn yxxy(&self) -> Vector4i
pub fn yxyx(&self) -> Vector4i
pub fn yxyy(&self) -> Vector4i
pub fn yyxx(&self) -> Vector4i
pub fn yyxy(&self) -> Vector4i
pub fn yyyx(&self) -> Vector4i
pub fn yyyy(&self) -> Vector4i
Trait Implementations§
source§impl AddAssign<Vector2i> for Vector2i
impl AddAssign<Vector2i> for Vector2i
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl AddAssign<i32> for Vector2i
impl AddAssign<i32> for Vector2i
source§fn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
Performs the
+= operation. Read moresource§impl DivAssign<Vector2i> for Vector2i
impl DivAssign<Vector2i> for Vector2i
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moresource§impl DivAssign<i32> for Vector2i
impl DivAssign<i32> for Vector2i
source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
Performs the
/= operation. Read moresource§impl MulAssign<Vector2i> for Vector2i
impl MulAssign<Vector2i> for Vector2i
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moresource§impl MulAssign<i32> for Vector2i
impl MulAssign<i32> for Vector2i
source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
Performs the
*= operation. Read moresource§impl PartialEq<Vector2i> for Vector2i
impl PartialEq<Vector2i> for Vector2i
source§impl RemAssign<Vector2i> for Vector2i
impl RemAssign<Vector2i> for Vector2i
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%= operation. Read moresource§impl RemAssign<i32> for Vector2i
impl RemAssign<i32> for Vector2i
source§fn rem_assign(&mut self, rhs: i32)
fn rem_assign(&mut self, rhs: i32)
Performs the
%= operation. Read moresource§impl SubAssign<Vector2i> for Vector2i
impl SubAssign<Vector2i> for Vector2i
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moresource§impl SubAssign<i32> for Vector2i
impl SubAssign<i32> for Vector2i
source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
Performs the
-= operation. Read moreimpl Copy for Vector2i
impl Eq for Vector2i
impl Pod for Vector2i
impl StructuralEq for Vector2i
impl StructuralPartialEq for Vector2i
Auto Trait Implementations§
impl RefUnwindSafe for Vector2i
impl Send for Vector2i
impl Sync for Vector2i
impl Unpin for Vector2i
impl UnwindSafe for Vector2i
Blanket Implementations§
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.