[][src]Struct spacebattleship::board::CellRef

pub struct CellRef<'a, I, D: Dimensions> { /* fields omitted */ }

Reference to a particular cell in the grid.

Implementations

impl<'a, I, D: Dimensions> CellRef<'a, I, D>[src]

pub fn coord(&self) -> &D::Coordinate[src]

The grid coordinate of this cell.

pub fn hit(&self) -> bool[src]

Whether this cell has been hit previously.

pub fn ship(&self) -> Option<ShipRef<'a, I, D>>[src]

The ship reference for the ship that occupies this cell, if any.

Trait Implementations

impl<'a, I: Clone, D: Clone + Dimensions> Clone for CellRef<'a, I, D> where
    D::Coordinate: Clone
[src]

impl<'a, I: Copy, D: Copy + Dimensions> Copy for CellRef<'a, I, D> where
    D::Coordinate: Copy
[src]

impl<'a, I: Debug, D: Debug + Dimensions> Debug for CellRef<'a, I, D> where
    D::Coordinate: Debug
[src]

Auto Trait Implementations

impl<'a, I, D> RefUnwindSafe for CellRef<'a, I, D> where
    D: RefUnwindSafe,
    I: RefUnwindSafe,
    <D as Dimensions>::Coordinate: RefUnwindSafe

impl<'a, I, D> Send for CellRef<'a, I, D> where
    D: Sync,
    I: Sync,
    <D as Dimensions>::Coordinate: Send + Sync

impl<'a, I, D> Sync for CellRef<'a, I, D> where
    D: Sync,
    I: Sync,
    <D as Dimensions>::Coordinate: Sync

impl<'a, I, D> Unpin for CellRef<'a, I, D> where
    <D as Dimensions>::Coordinate: Unpin

impl<'a, I, D> UnwindSafe for CellRef<'a, I, D> where
    D: RefUnwindSafe,
    I: RefUnwindSafe,
    <D as Dimensions>::Coordinate: RefUnwindSafe + UnwindSafe

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, 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.