[][src]Struct spacebattleship::game::simple::Coordinate

pub struct Coordinate {
    pub x: usize,
    pub y: usize,
}

The corrdinates of a [GridCell][crate::board::GridCell] in the board.

Fields

x: usize

Horizontal position of the cell.

y: usize

Vertical position of the cell.

Implementations

impl Coordinate2D[src]

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

Construct a Coordinate2D from the given x and y.

Trait Implementations

impl Clone for Coordinate2D[src]

impl Coordinate for Coordinate2D[src]

impl Copy for Coordinate2D[src]

impl Debug for Coordinate2D[src]

impl Eq for Coordinate2D[src]

impl From<(usize, usize)> for Coordinate2D[src]

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

Construct a Coordinate2D from the given (x, y) pair.

impl From<Coordinate2D> for (usize, usize)[src]

fn from(coord: Coordinate2D) -> Self[src]

Convert the Coordinate2D into an (x, y) pair.

impl Hash for Coordinate2D[src]

impl PartialEq<Coordinate2D> for Coordinate2D[src]

impl StructuralEq for Coordinate2D[src]

impl StructuralPartialEq for Coordinate2D[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> PlayerId for T where
    T: Clone + Eq + Debug + Hash
[src]

impl<T> ShipId for T where
    T: Clone + Eq + Debug + Hash
[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.