[−][src]Struct rltk::Point
Helper struct defining a 2D point in space.
Fields
x: i32
y: i32
Methods
impl Point
[src]
pub fn new<T>(x: T, y: T) -> Point where
T: TryInto<i32>,
[src]
T: TryInto<i32>,
Create a new point from an x/y coordinate.
pub fn zero() -> Self
[src]
pub fn from_tuple<T>(t: (T, T)) -> Self where
T: TryInto<i32>,
[src]
T: TryInto<i32>,
pub fn to_index<T>(&self, width: T) -> usize where
T: TryInto<usize>,
[src]
T: TryInto<usize>,
pub fn to_tuple(&self) -> (i32, i32)
[src]
pub fn to_unsigned_tuple(&self) -> (usize, usize)
[src]
Trait Implementations
impl Add<Point> for Point
[src]
Overloads: We support basic point math Support adding a point to a point
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: Point) -> Point
[src]
impl Add<i32> for Point
[src]
Support adding an int to a point
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: i32) -> Point
[src]
impl Clone for Point
[src]
impl Copy for Point
[src]
impl Debug for Point
[src]
impl Div<Point> for Point
[src]
Support dividing a point by a point
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: Point) -> Point
[src]
impl Div<f32> for Point
[src]
Support dividing a point by an f32
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Point
[src]
impl Div<i32> for Point
[src]
Support dividing a point by an int
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: i32) -> Point
[src]
impl Eq for Point
[src]
impl Hash for Point
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<Point> for Point
[src]
Support multiplying a point by a point
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: Point) -> Point
[src]
impl Mul<f32> for Point
[src]
Support multiplying a point by an f32
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Point
[src]
impl Mul<i32> for Point
[src]
Support multiplying a point by an int
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: i32) -> Point
[src]
impl PartialEq<Point> for Point
[src]
impl StructuralEq for Point
[src]
impl StructuralPartialEq for Point
[src]
impl Sub<Point> for Point
[src]
Support subtracting a point from a point
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, rhs: Point) -> Point
[src]
impl Sub<i32> for Point
[src]
Support subtracting an int from a point
Auto Trait Implementations
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,