Struct mutils::Point[][src]

pub struct Point<N: Num = f32>(pub N, pub N);

Implementations

impl<N: Num> Point<N>[src]

pub fn x(&self) -> N[src]

pub fn y(&self) -> N[src]

pub fn move_x(&mut self, x: N)[src]

pub fn move_y(&mut self, y: N)[src]

pub fn set_x(&mut self, x: N)[src]

pub fn set_y(&mut self, y: N)[src]

pub fn rect_to(&self, other: Self) -> Rect<N>[src]

pub fn distance_to(&self, other: Self) -> Size<N>[src]

impl<N: Num> Point<N>[src]

pub fn to_clamped<T: Num + FromClamped<N>>(&self) -> Point<T>[src]

Converts to a new type. If the current values don't fit in the new type, then it'll be clamped between min and max. i.e. NumTuple::new(1 as i16, 1 as i16)::to::<u16>()

pub fn to<T: Num + From<N>>(&self) -> Point<T>[src]

This is to allow creating a new Point, with a new type, from the type given. i.e. Point::new(1 as u8, 1 as u8)::to::<u32>()

impl<N: Num + Signed> Point<N>[src]

pub fn sign(&self) -> Self[src]

pub fn sign_exclusive_dir(&self) -> Self[src]

impl Point<f32>[src]

pub fn overlaps(self, Point(w, h): Self, xy1: Self, xy2: Self) -> bool[src]

pub fn floor(self) -> Self[src]

pub fn ceil(self) -> Self[src]

pub fn round(self) -> Self[src]

Trait Implementations

impl<N: Num> Add<Point<N>> for Line<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Num> Add<Point<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Num> Add<Point<N>> for Rect<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Point<f32>> for Random[src]

type Output = Point

The resulting type after applying the + operator.

impl<N: Num> Add<Size<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Num> AddAssign<Point<N>> for Line<N>[src]

impl<N: Num> AddAssign<Point<N>> for Point<N>[src]

impl<N: Num> AddAssign<Point<N>> for Rect<N>[src]

impl<N: Num> AddAssign<Size<N>> for Point<N>[src]

impl<N: Clone + Num> Clone for Point<N>[src]

impl<N: Copy + Num> Copy for Point<N>[src]

impl<N: Debug + Num> Debug for Point<N>[src]

impl<N: Num> Div<N> for Point<N>[src]

type Output = Self

The resulting type after applying the / operator.

impl<N: Num> Div<Point<N>> for Line<N>[src]

type Output = Self

The resulting type after applying the / operator.

impl<N: Num> Div<Point<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the / operator.

impl<N: Num> Div<Size<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the / operator.

impl<N: Num> DivAssign<N> for Point<N>[src]

impl<N: Num> DivAssign<Point<N>> for Line<N>[src]

impl<N: Num> DivAssign<Point<N>> for Point<N>[src]

impl<N: Num> DivAssign<Size<N>> for Point<N>[src]

impl<N: Num> From<(N, N)> for Point<N>[src]

fn from((x, y): (N, N)) -> Self[src]

(N, N) -> Point(N, N)

impl From<Point<f32>> for Transform[src]

impl<V: Copy> Index<Point<usize>> for Vec2D<V>[src]

type Output = V

The returned type after indexing.

impl<V: Copy> IndexMut<Point<usize>> for Vec2D<V>[src]

impl<N: Num> Into<(N, N)> for Point<N>[src]

fn into(self) -> (N, N)[src]

Point(N, N) -> (N, N)

impl<N: Num> Mul<N> for Point<N>[src]

type Output = Self

The resulting type after applying the * operator.

impl<N: Num> Mul<Point<N>> for Line<N>[src]

type Output = Self

The resulting type after applying the * operator.

impl<N: Num> Mul<Point<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the * operator.

impl<N: Num> Mul<Size<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the * operator.

impl<N: Num> MulAssign<N> for Point<N>[src]

impl<N: Num> MulAssign<Point<N>> for Line<N>[src]

impl<N: Num> MulAssign<Point<N>> for Point<N>[src]

impl<N: Num> MulAssign<Size<N>> for Point<N>[src]

impl<N: Num + Signed> Neg for Point<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Num> NumTuple<N> for Point<N>[src]

impl<N: Num> PartialEq<Point<N>> for Point<N>[src]

impl<N: Num> Rem<Point<N>> for Line<N>[src]

type Output = Self

The resulting type after applying the % operator.

impl<N: Num> Rem<Point<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the % operator.

impl<N: Num> Sub<Point<N>> for Line<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Num> Sub<Point<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Num> Sub<Point<N>> for Rect<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Point<f32>> for Random[src]

type Output = Point

The resulting type after applying the - operator.

impl<N: Num> Sub<Size<N>> for Point<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Num> SubAssign<Point<N>> for Line<N>[src]

impl<N: Num> SubAssign<Point<N>> for Point<N>[src]

impl<N: Num> SubAssign<Point<N>> for Rect<N>[src]

impl<N: Num> SubAssign<Size<N>> for Point<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Point<N> where
    N: RefUnwindSafe
[src]

impl<N> Send for Point<N> where
    N: Send
[src]

impl<N> Sync for Point<N> where
    N: Sync
[src]

impl<N> Unpin for Point<N> where
    N: Unpin
[src]

impl<N> UnwindSafe for Point<N> where
    N: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

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

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.