[][src]Struct texel_types::Position2D

pub struct Position2D {
    pub x: i32,
    pub y: i32,
}

2D position

Fields

x: i32y: i32

Implementations

impl Position2D[src]

pub fn from_xy(x: i32, y: i32) -> Self[src]

pub fn apply(&mut self, translation: Translation, bounds: Bounds) -> bool[src]

Applies given Translation to this Position2D with regards to the provided Bounds area. If Bounds is binding ensures position does not reach outside.

pub fn area(self, other: Position2D) -> Bounds[src]

Create bounds from two points

pub fn area_texels(self, dim: Dimension) -> Vec<Position2D>[src]

Create the list of all positions in given area from point with given dimension

Trait Implementations

impl Add<Position2D> for Position2D[src]

type Output = Position2D

The resulting type after applying the + operator.

impl Add<Position2D> for Position[src]

type Output = Position

The resulting type after applying the + operator.

impl AddAssign<Position2D> for Position[src]

impl AddAssign<Position2D> for Position2D[src]

impl Clone for Position2D[src]

impl Copy for Position2D[src]

impl Debug for Position2D[src]

impl Default for Position2D[src]

impl Display for Position2D[src]

impl Eq for Position2D[src]

impl<'_> From<&'_ Position> for Position2D[src]

impl<'_> From<&'_ mut Position> for Position2D[src]

impl From<Position> for Position2D[src]

impl PartialEq<Position2D> for Position2D[src]

impl StructuralEq for Position2D[src]

impl StructuralPartialEq for Position2D[src]

impl Sub<Position> for Position2D[src]

type Output = Position2D

The resulting type after applying the - operator.

impl Sub<Position2D> for Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl Sub<Position2D> for Position2D[src]

type Output = Position2D

The resulting type after applying the - operator.

impl SubAssign<Position2D> for Position2D[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.