Struct coord::vec2::Vec2 [−][src]
pub struct Vec2<'a, T: 'a + VecItem<'a>> { pub x: T, pub y: T, // some fields omitted }
Fields
x: T
y: T
Methods
impl<'a, T: VecItem<'a>> Vec2<'a, T>
[src]
impl<'a, T: VecItem<'a>> Vec2<'a, T>
Trait Implementations
impl<'a, T: Copy + 'a + VecItem<'a>> Copy for Vec2<'a, T>
[src]
impl<'a, T: Copy + 'a + VecItem<'a>> Copy for Vec2<'a, T>
impl<'a, T: Clone + 'a + VecItem<'a>> Clone for Vec2<'a, T>
[src]
impl<'a, T: Clone + 'a + VecItem<'a>> Clone for Vec2<'a, T>
fn clone(&self) -> Vec2<'a, T>
[src]
fn clone(&self) -> Vec2<'a, T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a, T: Default + 'a + VecItem<'a>> Default for Vec2<'a, T>
[src]
impl<'a, T: Default + 'a + VecItem<'a>> Default for Vec2<'a, T>
impl<'a, T: VecItem<'a>> Vector<'a> for Vec2<'a, T>
[src]
impl<'a, T: VecItem<'a>> Vector<'a> for Vec2<'a, T>
type Item = T
impl<'a, T: VecItem<'a> + Debug> Debug for Vec2<'a, T>
[src]
impl<'a, T: VecItem<'a> + Debug> Debug for Vec2<'a, T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, T: VecItem<'a> + Display> Display for Vec2<'a, T>
[src]
impl<'a, T: VecItem<'a> + Display> Display for Vec2<'a, T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, T: VecItem<'a>> From<[T; 2]> for Vec2<'a, T>
[src]
impl<'a, T: VecItem<'a>> From<[T; 2]> for Vec2<'a, T>
impl<'a, T: VecItem<'a>> From<(T, T)> for Vec2<'a, T>
[src]
impl<'a, T: VecItem<'a>> From<(T, T)> for Vec2<'a, T>
impl<'a, T> Add for Vec2<'a, T> where
T: VecItem<'a> + Add,
T::Output: VecItem<'a> + Add,
[src]
impl<'a, T> Add for Vec2<'a, T> where
T: VecItem<'a> + Add,
T::Output: VecItem<'a> + Add,
type Output = Vec2<'a, T::Output>
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Vec2<'a, T::Output>
[src]
fn add(self, other: Self) -> Vec2<'a, T::Output>
Performs the +
operation.
impl<'a, T> Sub for Vec2<'a, T> where
T: VecItem<'a> + Sub,
T::Output: VecItem<'a> + Sub,
[src]
impl<'a, T> Sub for Vec2<'a, T> where
T: VecItem<'a> + Sub,
T::Output: VecItem<'a> + Sub,
type Output = Vec2<'a, T::Output>
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Vec2<'a, T::Output>
[src]
fn sub(self, other: Self) -> Vec2<'a, T::Output>
Performs the -
operation.
impl<'a, T> Mul for Vec2<'a, T> where
T: VecItem<'a> + Mul,
T::Output: VecItem<'a> + Mul,
[src]
impl<'a, T> Mul for Vec2<'a, T> where
T: VecItem<'a> + Mul,
T::Output: VecItem<'a> + Mul,
type Output = Vec2<'a, T::Output>
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Vec2<'a, T::Output>
[src]
fn mul(self, other: Self) -> Vec2<'a, T::Output>
Performs the *
operation.
impl<'a, T> Div for Vec2<'a, T> where
T: VecItem<'a> + Div,
T::Output: VecItem<'a> + Div,
[src]
impl<'a, T> Div for Vec2<'a, T> where
T: VecItem<'a> + Div,
T::Output: VecItem<'a> + Div,
type Output = Vec2<'a, T::Output>
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Vec2<'a, T::Output>
[src]
fn div(self, other: Self) -> Vec2<'a, T::Output>
Performs the /
operation.
impl<'a, T> Add<T> for Vec2<'a, T> where
T: VecItem<'a> + Add,
T::Output: VecItem<'a> + Add,
[src]
impl<'a, T> Add<T> for Vec2<'a, T> where
T: VecItem<'a> + Add,
T::Output: VecItem<'a> + Add,
type Output = Vec2<'a, T::Output>
The resulting type after applying the +
operator.
fn add(self, other: T) -> Vec2<'a, T::Output>
[src]
fn add(self, other: T) -> Vec2<'a, T::Output>
Performs the +
operation.
impl<'a, T> Sub<T> for Vec2<'a, T> where
T: VecItem<'a> + Sub,
T::Output: VecItem<'a> + Sub,
[src]
impl<'a, T> Sub<T> for Vec2<'a, T> where
T: VecItem<'a> + Sub,
T::Output: VecItem<'a> + Sub,
type Output = Vec2<'a, T::Output>
The resulting type after applying the -
operator.
fn sub(self, other: T) -> Vec2<'a, T::Output>
[src]
fn sub(self, other: T) -> Vec2<'a, T::Output>
Performs the -
operation.
impl<'a, T> Mul<T> for Vec2<'a, T> where
T: VecItem<'a> + Mul,
T::Output: VecItem<'a> + Mul,
[src]
impl<'a, T> Mul<T> for Vec2<'a, T> where
T: VecItem<'a> + Mul,
T::Output: VecItem<'a> + Mul,
type Output = Vec2<'a, T::Output>
The resulting type after applying the *
operator.
fn mul(self, other: T) -> Vec2<'a, T::Output>
[src]
fn mul(self, other: T) -> Vec2<'a, T::Output>
Performs the *
operation.
impl<'a, T> Div<T> for Vec2<'a, T> where
T: VecItem<'a> + Div,
T::Output: VecItem<'a> + Div,
[src]
impl<'a, T> Div<T> for Vec2<'a, T> where
T: VecItem<'a> + Div,
T::Output: VecItem<'a> + Div,
type Output = Vec2<'a, T::Output>
The resulting type after applying the /
operator.
fn div(self, other: T) -> Vec2<'a, T::Output>
[src]
fn div(self, other: T) -> Vec2<'a, T::Output>
Performs the /
operation.
impl<'a, T> AddAssign for Vec2<'a, T> where
T: VecItem<'a> + Add<Output = T>,
[src]
impl<'a, T> AddAssign for Vec2<'a, T> where
T: VecItem<'a> + Add<Output = T>,
fn add_assign(&mut self, other: Self)
[src]
fn add_assign(&mut self, other: Self)
Performs the +=
operation.
impl<'a, T> SubAssign for Vec2<'a, T> where
T: VecItem<'a> + Sub<Output = T>,
[src]
impl<'a, T> SubAssign for Vec2<'a, T> where
T: VecItem<'a> + Sub<Output = T>,
fn sub_assign(&mut self, other: Self)
[src]
fn sub_assign(&mut self, other: Self)
Performs the -=
operation.
impl<'a, T> MulAssign for Vec2<'a, T> where
T: VecItem<'a> + Mul<Output = T>,
[src]
impl<'a, T> MulAssign for Vec2<'a, T> where
T: VecItem<'a> + Mul<Output = T>,
fn mul_assign(&mut self, other: Self)
[src]
fn mul_assign(&mut self, other: Self)
Performs the *=
operation.
impl<'a, T> DivAssign for Vec2<'a, T> where
T: VecItem<'a> + Div<Output = T>,
[src]
impl<'a, T> DivAssign for Vec2<'a, T> where
T: VecItem<'a> + Div<Output = T>,
fn div_assign(&mut self, other: Self)
[src]
fn div_assign(&mut self, other: Self)
Performs the /=
operation.
impl<'a, T> AddAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Add<Output = T>,
[src]
impl<'a, T> AddAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Add<Output = T>,
fn add_assign(&mut self, other: T)
[src]
fn add_assign(&mut self, other: T)
Performs the +=
operation.
impl<'a, T> SubAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Sub<Output = T>,
[src]
impl<'a, T> SubAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Sub<Output = T>,
fn sub_assign(&mut self, other: T)
[src]
fn sub_assign(&mut self, other: T)
Performs the -=
operation.
impl<'a, T> MulAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Mul<Output = T>,
[src]
impl<'a, T> MulAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Mul<Output = T>,
fn mul_assign(&mut self, other: T)
[src]
fn mul_assign(&mut self, other: T)
Performs the *=
operation.
impl<'a, T> DivAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Div<Output = T>,
[src]
impl<'a, T> DivAssign<T> for Vec2<'a, T> where
T: VecItem<'a> + Div<Output = T>,
fn div_assign(&mut self, other: T)
[src]
fn div_assign(&mut self, other: T)
Performs the /=
operation.
impl<'a, T> VecNum<'a> for Vec2<'a, T> where
T: VecItem<'a> + Num,
[src]
impl<'a, T> VecNum<'a> for Vec2<'a, T> where
T: VecItem<'a> + Num,
fn sum(&self) -> Self::Item
[src]
fn sum(&self) -> Self::Item
Calculates the sum of all components of the vector
fn product(&self) -> Self::Item
[src]
fn product(&self) -> Self::Item
Calculates the produce of all components of the vector
impl<'a, T> VecSigned<'a> for Vec2<'a, T> where
T: VecItem<'a> + Signed,
[src]
impl<'a, T> VecSigned<'a> for Vec2<'a, T> where
T: VecItem<'a> + Signed,
fn snake_length(&self) -> Self::Item
[src]
fn snake_length(&self) -> Self::Item
Calculates the snake length (also known as 'manhattan distance') of the vector Read more
impl<'a, T> VecFloat<'a> for Vec2<'a, T> where
T: VecItem<'a> + Float,
[src]
impl<'a, T> VecFloat<'a> for Vec2<'a, T> where
T: VecItem<'a> + Float,