[][src]Struct math2d::Point2i

#[repr(C)]
pub struct Point2i { pub x: i32, pub y: i32, }

Mathematical point on the 2D (x, y) plane.

Fields

x: i32

Horizontal component

y: i32

Vertical component

Methods

impl Point2i[src]

pub const ORIGIN: Point2i[src]

Mathematical origin point

pub fn new(x: i32, y: i32) -> Point2i[src]

Construct a point from its components

pub fn to_f32(self) -> Point2f[src]

Convert this value to a floating point

pub fn to_u32(self) -> Point2u[src]

Convert this value to an unsigned point. It is the caller's duty to ensure the values are not negative to avoid casting underflow.

Trait Implementations

impl PartialOrd<Point2i> for Point2i[src]

impl Copy for Point2i[src]

impl PartialEq<Point2i> for Point2i[src]

impl Default for Point2i[src]

impl From<(i32, i32)> for Point2i[src]

impl From<Point2i> for (i32, i32)[src]

impl From<Point2i> for D2D_POINT_2L[src]

impl From<POINT> for Point2i[src]

impl From<Point2i> for Point2<i32>[src]

impl From<Point2<i32>> for Point2i[src]

impl From<Point2i> for Recti[src]

impl Clone for Point2i[src]

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

Performs copy-assignment from source. Read more

impl Ord for Point2i[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Eq for Point2i[src]

impl Debug for Point2i[src]

impl<V> Add<V> for Point2i where
    V: Into<Vector2i>, 
[src]

type Output = Point2i

The resulting type after applying the + operator.

impl Add<Point2i> for Vector2i[src]

type Output = Point2i

The resulting type after applying the + operator.

impl Sub<Point2i> for Point2i[src]

type Output = Vector2i

The resulting type after applying the - operator.

impl Sub<(i32, i32)> for Point2i[src]

type Output = Vector2i

The resulting type after applying the - operator.

impl<V> Sub<V> for Point2i where
    V: Into<Vector2i>, 
[src]

type Output = Point2i

The resulting type after applying the - operator.

impl<V> AddAssign<V> for Point2i where
    Point2i: Add<V, Output = Point2i>, 
[src]

impl<V> SubAssign<V> for Point2i where
    Point2i: Sub<V, Output = Point2i>, 
[src]

impl Hash for Point2i[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for Point2i[src]

impl<'de> Deserialize<'de> for Point2i[src]

Auto Trait Implementations

impl Send for Point2i

impl Sync for Point2i

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]