[][src]Enum conway::universe::CellState

pub enum CellState {
    Dead,
    Alive(Option<usize>),
    Wall,
    Fog,
}

Variants

DeadAlive(Option<usize>)WallFog

Methods

impl CellState[src]

pub fn to_char(self) -> char[src]

Convert this CellState to a char. When the state is Alive(None) or Dead, this will match what would be found in a .rle file. Wall, Alive(Some(player_id)), and Fog are unsupported in vanilla CGoL, and thus are not part of the RLE specification.

Panics

Panics if player_id is not less than 23, since we map IDs 0 through 22 to uppercase letters A through V. W is not usable since it represents a wall cell.

pub fn from_char(ch: char) -> Option<Self>[src]

Trait Implementations

impl PartialOrd<CellState> for CellState[src]

impl Copy for CellState[src]

impl PartialEq<CellState> for CellState[src]

impl Clone for CellState[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for CellState[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Eq for CellState[src]

impl Debug for CellState[src]

Auto Trait Implementations

impl Send for CellState

impl Sync for CellState

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]