pub struct Rule {
pub birth: u32,
pub survive: u32,
pub states: u32,
pub neighbourhood: Neighbourhood,
}Expand description
One compiled rule, as the step shader reads it.
Fields§
§birth: u32Bit k: a dead cell with k live neighbours is born.
survive: u32Bit k: a live cell with k live neighbours stays live.
states: u32Dead, live and the decay stages: 2..=MAX_STATES.
neighbourhood: NeighbourhoodWhich cells are counted.
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn inline(
birth: &[i64],
survive: &[i64],
states: i64,
neighbourhood: Neighbourhood,
) -> Result<Self, String>
pub fn inline( birth: &[i64], survive: &[i64], states: i64, neighbourhood: Neighbourhood, ) -> Result<Self, String>
An inline rule from its birth and survive counts, or the reason it is not
one: a count past the neighbourhood’s max_count
(or below zero), or states outside 2..=MAX_STATES.
Trait Implementations§
impl Copy for Rule
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.