Struct gecl::Vector[][src]

#[repr(C)]
pub struct Vector<T> { pub x: T, pub y: T, }

Fields

x: Ty: T

Implementations

impl<T> Vector<T>[src]

pub fn new(x: T, y: T) -> Self[src]

pub fn map<R>(self, f: impl FnMut(T) -> R) -> Vector<R>[src]

impl<T: ToPrimitive> Vector<T>[src]

pub fn cast<U: NumCast>(self) -> Option<Vector<U>>[src]

impl<T> Vector<T> where
    T: Add<T, Output = T> + Mul<T, Output = T>, 
[src]

pub fn dot(self, rhs: impl Into<Self>) -> T[src]

impl<T> Vector<T> where
    T: Sub<T, Output = T> + Mul<T, Output = T>, 
[src]

pub fn cross(self, rhs: impl Into<Self>) -> T[src]

impl<T> Vector<T> where
    T: Add<T, Output = T> + Mul<T, Output = T> + Copy
[src]

pub fn abs_pow2(self) -> T[src]

impl<T: Float> Vector<T>[src]

pub fn abs(self) -> T[src]

Trait Implementations

impl<T, U> Add<U> for Vector<T> where
    T: Add<T, Output = T>,
    U: Into<Self>, 
[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, rhs: U) -> Self[src]

Performs the + operation. Read more

impl<T, U> AddAssign<U> for Vector<T> where
    T: AddAssign<T>,
    U: Into<Self>, 
[src]

fn add_assign(&mut self, rhs: U)[src]

Performs the += operation. Read more

impl<T: Clone> Clone for Vector<T>[src]

fn clone(&self) -> Vector<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Vector<T>[src]

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

Formats the value using the given formatter. Read more

impl<T> Div<T> for Vector<T> where
    T: Div<T, Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, rhs: T) -> Self[src]

Performs the / operation. Read more

impl<T> DivAssign<T> for Vector<T> where
    T: DivAssign<T> + Copy
[src]

fn div_assign(&mut self, rhs: T)[src]

Performs the /= operation. Read more

impl<T: Copy> From<[T; 2]> for Vector<T>[src]

fn from(src: [T; 2]) -> Vector<T>[src]

Performs the conversion.

impl<T> From<(T, T)> for Vector<T>[src]

fn from(src: (T, T)) -> Vector<T>[src]

Performs the conversion.

impl<T> From<Point<T>> for Vector<T>[src]

fn from(src: Point<T>) -> Vector<T>[src]

Performs the conversion.

impl<T> From<Size<T>> for Vector<T>[src]

fn from(src: Size<T>) -> Vector<T>[src]

Performs the conversion.

impl<T> From<Vector<T>> for Point<T>[src]

fn from(src: Vector<T>) -> Point<T>[src]

Performs the conversion.

impl<T> From<Vector<T>> for Size<T>[src]

fn from(src: Vector<T>) -> Size<T>[src]

Performs the conversion.

impl<T> Mul<T> for Vector<T> where
    T: Mul<T, Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, rhs: T) -> Self[src]

Performs the * operation. Read more

impl<T> MulAssign<T> for Vector<T> where
    T: MulAssign<T> + Copy
[src]

fn mul_assign(&mut self, rhs: T)[src]

Performs the *= operation. Read more

impl<T> PartialEq<[T; 2]> for Vector<T> where
    T: PartialEq
[src]

fn eq(&self, other: &[T; 2]) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<T> PartialEq<(T, T)> for Vector<T> where
    T: PartialEq
[src]

fn eq(&self, other: &(T, T)) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<T: PartialEq> PartialEq<Vector<T>> for Vector<T>[src]

fn eq(&self, other: &Vector<T>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Vector<T>) -> bool[src]

This method tests for !=.

impl<T, U> Sub<U> for Vector<T> where
    T: Sub<T, Output = T>,
    U: Into<Self>, 
[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, rhs: U) -> Self[src]

Performs the - operation. Read more

impl<T> Sub<Vector<T>> for Point<T> where
    T: Sub<T, Output = T>, 
[src]

type Output = Point<T>

The resulting type after applying the - operator.

fn sub(self, rhs: Vector<T>) -> Point<T>[src]

Performs the - operation. Read more

impl<T, U> SubAssign<U> for Vector<T> where
    T: SubAssign<T>,
    U: Into<Self>, 
[src]

fn sub_assign(&mut self, rhs: U)[src]

Performs the -= operation. Read more

impl<T> SubAssign<Vector<T>> for Point<T> where
    T: SubAssign<T>, 
[src]

fn sub_assign(&mut self, rhs: Vector<T>)[src]

Performs the -= operation. Read more

impl<T: Copy> Copy for Vector<T>[src]

impl<T: Eq> Eq for Vector<T>[src]

impl<T> StructuralEq for Vector<T>[src]

impl<T> StructuralPartialEq for Vector<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Vector<T> where
    T: RefUnwindSafe

impl<T> Send for Vector<T> where
    T: Send

impl<T> Sync for Vector<T> where
    T: Sync

impl<T> Unpin for Vector<T> where
    T: Unpin

impl<T> UnwindSafe for Vector<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.