Struct dvec::Vec2
[−]
[src]
#[repr(C)]pub struct Vec2<T> { pub x: T, pub y: T, }
2-dimensional vector type.
Fields
x: T
y: T
Methods
impl<T> Vec2<T>
[src]
fn map<U, F>(self, f: F) -> Vec2<U> where
F: FnMut(T) -> U,
F: FnMut(T) -> U,
fn max(self, rhs: Vec2<T>) -> Vec2<T> where
T: Ord,
T: Ord,
fn min(self, rhs: Vec2<T>) -> Vec2<T> where
T: Ord,
T: Ord,
fn new(x: T, y: T) -> Vec2<T>
fn product(self) -> T where
T: Mul<Output = T>,
T: Mul<Output = T>,
fn raw_conv<U>(self) -> Vec2<U> where
T: RawInto<U>,
T: RawInto<U>,
fn sum(self) -> T where
T: Add<Output = T>,
T: Add<Output = T>,
fn to(self, end: Vec2<T>) -> Rect2<T>
fn with_size<S>(self, size: S) -> Rect2<T> where
&'a T: Add<T, Output = T>,
S: Into<Vec2<T>>,
&'a T: Add<T, Output = T>,
S: Into<Vec2<T>>,
fn with_z(self, z: T) -> Vec3<T>
Trait Implementations
impl<T: Clone> Clone for Vec2<T>
[src]
fn clone(&self) -> Vec2<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Vec2<T>
[src]
impl<T: Debug> Debug for Vec2<T>
[src]
impl<T: Default> Default for Vec2<T>
[src]
impl<T: Eq> Eq for Vec2<T>
[src]
impl<T: Hash> Hash for Vec2<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: PartialEq> PartialEq for Vec2<T>
[src]
fn eq(&self, __arg_0: &Vec2<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vec2<T>) -> bool
This method tests for !=
.
impl<T> From<(T, T)> for Vec2<T>
[src]
impl<T> From<Complex<T>> for Vec2<T>
[src]
impl<T> Into<(T, T)> for Vec2<T>
[src]
impl<S, T> Lerp<T> for Vec2<S> where
S: Lerp<T>,
T: Copy,
[src]
S: Lerp<T>,
T: Copy,
impl<T> Zero for Vec2<T> where
T: Zero,
[src]
T: Zero,
impl<T> Mul<T> for Vec2<T> where
T: Copy + Mul<Output = T>,
[src]
T: Copy + Mul<Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: T) -> Vec2<T>
The method for the *
operator
impl<'a, T> Mul<&'a T> for Vec2<T> where
T: Mul<&'a T, Output = T>,
[src]
T: Mul<&'a T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: &'a T) -> Vec2<T>
The method for the *
operator
impl<'a, T> Mul<T> for &'a Vec2<T> where
T: Copy,
&'a T: Mul<T, Output = T>,
[src]
T: Copy,
&'a T: Mul<T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: T) -> Vec2<T>
The method for the *
operator
impl<'a, 'b, T> Mul<&'b T> for &'a Vec2<T> where
&'a T: Mul<&'b T, Output = T>,
[src]
&'a T: Mul<&'b T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: &'b T) -> Vec2<T>
The method for the *
operator
impl<T> Div<T> for Vec2<T> where
T: Copy + Div<Output = T>,
[src]
T: Copy + Div<Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: T) -> Vec2<T>
The method for the /
operator
impl<'a, T> Div<&'a T> for Vec2<T> where
T: Div<&'a T, Output = T>,
[src]
T: Div<&'a T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: &'a T) -> Vec2<T>
The method for the /
operator
impl<'a, T> Div<T> for &'a Vec2<T> where
T: Copy,
&'a T: Div<T, Output = T>,
[src]
T: Copy,
&'a T: Div<T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: T) -> Vec2<T>
The method for the /
operator
impl<'a, 'b, T> Div<&'b T> for &'a Vec2<T> where
&'a T: Div<&'b T, Output = T>,
[src]
&'a T: Div<&'b T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: &'b T) -> Vec2<T>
The method for the /
operator
impl<T> MulAssign<T> for Vec2<T> where
T: Copy + MulAssign,
[src]
T: Copy + MulAssign,
fn mul_assign(&mut self, rhs: T)
The method for the *=
operator
impl<'a, T> MulAssign<&'a T> for Vec2<T> where
T: MulAssign<&'a T>,
[src]
T: MulAssign<&'a T>,
fn mul_assign(&mut self, rhs: &'a T)
The method for the *=
operator
impl<T> DivAssign<T> for Vec2<T> where
T: Copy + DivAssign,
[src]
T: Copy + DivAssign,
fn div_assign(&mut self, rhs: T)
The method for the /=
operator
impl<'a, T> DivAssign<&'a T> for Vec2<T> where
T: DivAssign<&'a T>,
[src]
T: DivAssign<&'a T>,
fn div_assign(&mut self, rhs: &'a T)
The method for the /=
operator
impl<T> Add for Vec2<T> where
T: Add<Output = T>,
[src]
T: Add<Output = T>,
type Output = Vec2<T>
The resulting type after applying the +
operator
fn add(self, rhs: Vec2<T>) -> Vec2<T>
The method for the +
operator
impl<'a, T> Add<&'a Vec2<T>> for Vec2<T> where
T: Add<&'a T, Output = T>,
[src]
T: Add<&'a T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the +
operator
fn add(self, rhs: &'a Vec2<T>) -> Vec2<T>
The method for the +
operator
impl<'a, T> Add<Vec2<T>> for &'a Vec2<T> where
&'a T: Add<T, Output = T>,
[src]
&'a T: Add<T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the +
operator
fn add(self, rhs: Vec2<T>) -> Vec2<T>
The method for the +
operator
impl<'a, 'b, T> Add<&'b Vec2<T>> for &'a Vec2<T> where
&'a T: Add<&'b T, Output = T>,
[src]
&'a T: Add<&'b T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the +
operator
fn add(self, rhs: &'b Vec2<T>) -> Vec2<T>
The method for the +
operator
impl<T> Sub for Vec2<T> where
T: Sub<Output = T>,
[src]
T: Sub<Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn sub(self, rhs: Vec2<T>) -> Vec2<T>
The method for the -
operator
impl<'a, T> Sub<&'a Vec2<T>> for Vec2<T> where
T: Sub<&'a T, Output = T>,
[src]
T: Sub<&'a T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn sub(self, rhs: &'a Vec2<T>) -> Vec2<T>
The method for the -
operator
impl<'a, T> Sub<Vec2<T>> for &'a Vec2<T> where
&'a T: Sub<T, Output = T>,
[src]
&'a T: Sub<T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn sub(self, rhs: Vec2<T>) -> Vec2<T>
The method for the -
operator
impl<'a, 'b, T> Sub<&'b Vec2<T>> for &'a Vec2<T> where
&'a T: Sub<&'b T, Output = T>,
[src]
&'a T: Sub<&'b T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn sub(self, rhs: &'b Vec2<T>) -> Vec2<T>
The method for the -
operator
impl<T> Mul for Vec2<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: Vec2<T>) -> Vec2<T>
The method for the *
operator
impl<'a, T> Mul<&'a Vec2<T>> for Vec2<T> where
T: Mul<&'a T, Output = T>,
[src]
T: Mul<&'a T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: &'a Vec2<T>) -> Vec2<T>
The method for the *
operator
impl<'a, T> Mul<Vec2<T>> for &'a Vec2<T> where
&'a T: Mul<T, Output = T>,
[src]
&'a T: Mul<T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: Vec2<T>) -> Vec2<T>
The method for the *
operator
impl<'a, 'b, T> Mul<&'b Vec2<T>> for &'a Vec2<T> where
&'a T: Mul<&'b T, Output = T>,
[src]
&'a T: Mul<&'b T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: &'b Vec2<T>) -> Vec2<T>
The method for the *
operator
impl<T> Div for Vec2<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: Vec2<T>) -> Vec2<T>
The method for the /
operator
impl<'a, T> Div<&'a Vec2<T>> for Vec2<T> where
T: Div<&'a T, Output = T>,
[src]
T: Div<&'a T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: &'a Vec2<T>) -> Vec2<T>
The method for the /
operator
impl<'a, T> Div<Vec2<T>> for &'a Vec2<T> where
&'a T: Div<T, Output = T>,
[src]
&'a T: Div<T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: Vec2<T>) -> Vec2<T>
The method for the /
operator
impl<'a, 'b, T> Div<&'b Vec2<T>> for &'a Vec2<T> where
&'a T: Div<&'b T, Output = T>,
[src]
&'a T: Div<&'b T, Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: &'b Vec2<T>) -> Vec2<T>
The method for the /
operator
impl<T> AddAssign for Vec2<T> where
T: AddAssign,
[src]
T: AddAssign,
fn add_assign(&mut self, rhs: Vec2<T>)
The method for the +=
operator
impl<'a, T> AddAssign<&'a Vec2<T>> for Vec2<T> where
T: AddAssign<&'a T>,
[src]
T: AddAssign<&'a T>,
fn add_assign(&mut self, rhs: &'a Vec2<T>)
The method for the +=
operator
impl<T> SubAssign for Vec2<T> where
T: SubAssign,
[src]
T: SubAssign,
fn sub_assign(&mut self, rhs: Vec2<T>)
The method for the -=
operator
impl<'a, T> SubAssign<&'a Vec2<T>> for Vec2<T> where
T: SubAssign<&'a T>,
[src]
T: SubAssign<&'a T>,
fn sub_assign(&mut self, rhs: &'a Vec2<T>)
The method for the -=
operator
impl<T> MulAssign for Vec2<T> where
T: MulAssign,
[src]
T: MulAssign,
fn mul_assign(&mut self, rhs: Vec2<T>)
The method for the *=
operator
impl<'a, T> MulAssign<&'a Vec2<T>> for Vec2<T> where
T: MulAssign<&'a T>,
[src]
T: MulAssign<&'a T>,
fn mul_assign(&mut self, rhs: &'a Vec2<T>)
The method for the *=
operator
impl<T> Add<(T, T)> for Vec2<T> where
T: Add<Output = T>,
[src]
T: Add<Output = T>,
type Output = Vec2<T>
The resulting type after applying the +
operator
fn add(self, rhs: (T, T)) -> Vec2<T>
The method for the +
operator
impl<T> Sub<(T, T)> for Vec2<T> where
T: Sub<Output = T>,
[src]
T: Sub<Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn sub(self, rhs: (T, T)) -> Vec2<T>
The method for the -
operator
impl<T> Mul<(T, T)> for Vec2<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, rhs: (T, T)) -> Vec2<T>
The method for the *
operator
impl<T> Div<(T, T)> for Vec2<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, rhs: (T, T)) -> Vec2<T>
The method for the /
operator
impl<T> AddAssign<(T, T)> for Vec2<T> where
T: AddAssign,
[src]
T: AddAssign,
fn add_assign(&mut self, rhs: (T, T))
The method for the +=
operator
impl<T> SubAssign<(T, T)> for Vec2<T> where
T: SubAssign,
[src]
T: SubAssign,
fn sub_assign(&mut self, rhs: (T, T))
The method for the -=
operator
impl<T> MulAssign<(T, T)> for Vec2<T> where
T: MulAssign,
[src]
T: MulAssign,
fn mul_assign(&mut self, rhs: (T, T))
The method for the *=
operator
impl<T> DivAssign<(T, T)> for Vec2<T> where
T: DivAssign,
[src]
T: DivAssign,
fn div_assign(&mut self, rhs: (T, T))
The method for the /=
operator
impl<T> Dot for Vec2<T> where
T: Add<Output = T> + Mul<Output = T>,
[src]
T: Add<Output = T> + Mul<Output = T>,
impl<'a, T> Dot<&'a Vec2<T>> for Vec2<T> where
T: Add<Output = T> + Mul<&'a T, Output = T>,
[src]
T: Add<Output = T> + Mul<&'a T, Output = T>,
impl<'a, T> Dot<Vec2<T>> for &'a Vec2<T> where
T: Add<Output = T>,
&'a T: Mul<T, Output = T>,
[src]
T: Add<Output = T>,
&'a T: Mul<T, Output = T>,
impl<'a, 'b, T> Dot<&'b Vec2<T>> for &'a Vec2<T> where
T: Add<Output = T>,
&'a T: Mul<&'b T, Output = T>,
[src]
T: Add<Output = T>,
&'a T: Mul<&'b T, Output = T>,
impl<T> Neg for Vec2<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn neg(self) -> Vec2<T>
The method for the unary -
operator
impl<'a, T> Neg for &'a Vec2<T> where
&'a T: Neg<Output = T>,
[src]
&'a T: Neg<Output = T>,