[−][src]Struct spacebattleship::board::ShipRef
Handle to a ship that allows getting information about its status.
Implementations
impl<'a, I: ShipId, D: Dimensions> ShipRef<'a, I, D>
[src]
pub fn id(&self) -> &'a I
[src]
Get the ID of the ship.
pub fn sunk(&self) -> bool
[src]
Check if this ship has been sunk.
pub fn coords(&self) -> impl 'a + Iterator<Item = &'a D::Coordinate>
[src]
Get an iterator over the coordinates of this ship.
pub fn hits(&self) -> impl 'a + Iterator<Item = (&'a D::Coordinate, bool)>
[src]
Get an iterator over the coordinates of this ship and whether those coords have been hit.
Trait Implementations
impl<'_, I, D: Dimensions> Clone for ShipRef<'_, I, D>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_, I, D: Dimensions> Copy for ShipRef<'_, I, D>
[src]
impl<'a, I: Debug, D: Debug + Dimensions> Debug for ShipRef<'a, I, D> where
D::Coordinate: Debug,
[src]
D::Coordinate: Debug,
Auto Trait Implementations
impl<'a, I, D> RefUnwindSafe for ShipRef<'a, I, D> where
D: RefUnwindSafe,
I: RefUnwindSafe,
<D as Dimensions>::Coordinate: RefUnwindSafe,
D: RefUnwindSafe,
I: RefUnwindSafe,
<D as Dimensions>::Coordinate: RefUnwindSafe,
impl<'a, I, D> Send for ShipRef<'a, I, D> where
D: Sync,
I: Sync,
<D as Dimensions>::Coordinate: Sync,
D: Sync,
I: Sync,
<D as Dimensions>::Coordinate: Sync,
impl<'a, I, D> Sync for ShipRef<'a, I, D> where
D: Sync,
I: Sync,
<D as Dimensions>::Coordinate: Sync,
D: Sync,
I: Sync,
<D as Dimensions>::Coordinate: Sync,
impl<'a, I, D> Unpin for ShipRef<'a, I, D>
impl<'a, I, D> UnwindSafe for ShipRef<'a, I, D> where
D: RefUnwindSafe,
I: RefUnwindSafe,
<D as Dimensions>::Coordinate: RefUnwindSafe,
D: RefUnwindSafe,
I: RefUnwindSafe,
<D as Dimensions>::Coordinate: RefUnwindSafe,
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>,