pub struct Vector<T, const N: usize> { /* private fields */ }Implementations§
Source§impl<T, const N: usize> Vector<T, N>
impl<T, const N: usize> Vector<T, N>
pub const fn new(data: [T; N]) -> Self
pub fn pure(x: T) -> Selfwhere
T: Clone,
pub const fn const_pure(x: T) -> Selfwhere
T: Copy,
pub fn gen<F>(f: F) -> Self
pub fn dot(self, rhs: Vector<T, N>) -> T
pub fn mag_sq(self) -> T
pub fn mag(self) -> T
pub fn normalised(self) -> Self
pub fn map<F, U>(self, f: F) -> Vector<U, N>where
F: Fn(T) -> U,
pub fn map_mut<F>(&mut self, f: F)
pub fn apply<F, U, V>(self, f: F, rhs: Vector<U, N>) -> Vector<V, N>where
F: Fn(T, U) -> V,
pub fn apply_mut<F, U>(&mut self, f: F, rhs: Vector<U, N>)
pub fn into_iter(self) -> <Self as IntoIterator>::IntoIter
pub fn iter(&self) -> <&Self as IntoIterator>::IntoIter
pub fn iter_mut(&mut self) -> <&mut Self as IntoIterator>::IntoIter
Trait Implementations§
Source§impl<T, const N: usize> AddAssign for Vector<T, N>where
T: AddAssign<T>,
impl<T, const N: usize> AddAssign for Vector<T, N>where
T: AddAssign<T>,
Source§fn add_assign(&mut self, rhs: Vector<T, N>)
fn add_assign(&mut self, rhs: Vector<T, N>)
Performs the
+= operation. Read moreSource§impl<T, const N: usize> DivAssign<T> for Vector<T, N>
impl<T, const N: usize> DivAssign<T> for Vector<T, N>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T, const N: usize> DivAssign for Vector<T, N>where
T: DivAssign<T>,
impl<T, const N: usize> DivAssign for Vector<T, N>where
T: DivAssign<T>,
Source§fn div_assign(&mut self, rhs: Vector<T, N>)
fn div_assign(&mut self, rhs: Vector<T, N>)
Performs the
/= operation. Read moreSource§impl<'a, T, const N: usize> IntoIterator for &'a Vector<T, N>
impl<'a, T, const N: usize> IntoIterator for &'a Vector<T, N>
Source§impl<'a, T, const N: usize> IntoIterator for &'a mut Vector<T, N>
impl<'a, T, const N: usize> IntoIterator for &'a mut Vector<T, N>
Source§impl<T, const N: usize> IntoIterator for Vector<T, N>
impl<T, const N: usize> IntoIterator for Vector<T, N>
Source§impl<T, const N: usize> MulAssign<T> for Vector<T, N>
impl<T, const N: usize> MulAssign<T> for Vector<T, N>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T, const N: usize> MulAssign for Vector<T, N>where
T: MulAssign,
impl<T, const N: usize> MulAssign for Vector<T, N>where
T: MulAssign,
Source§fn mul_assign(&mut self, rhs: Vector<T, N>)
fn mul_assign(&mut self, rhs: Vector<T, N>)
Performs the
*= operation. Read moreSource§impl<T, const N: usize> SubAssign for Vector<T, N>where
T: SubAssign<T>,
impl<T, const N: usize> SubAssign for Vector<T, N>where
T: SubAssign<T>,
Source§fn sub_assign(&mut self, rhs: Vector<T, N>)
fn sub_assign(&mut self, rhs: Vector<T, N>)
Performs the
-= operation. Read moreimpl<T: Copy, const N: usize> Copy for Vector<T, N>
impl<T: Eq, const N: usize> Eq for Vector<T, N>
impl<T, const N: usize> StructuralPartialEq for Vector<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Vector<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for Vector<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Vector<T, N>where
T: Send,
impl<T, const N: usize> Sync for Vector<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Vector<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Vector<T, N>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more