pub enum Rule {
Single(u8),
Range(Range<u8>),
Many(Vec<u8>),
}Expand description
Any cellular automata has two rules that care about neighbors. One rule says how many neighbors a cell needs to be born, and another says how many neighbors a cell needs to continue living. This enum is used to tell the automata how many neighbor counts are valid for a given rule.
Variants§
Single(u8)
This rule only matches a single count of neighbors.
Range(Range<u8>)
This rule matches a consecutive set of neighbor counts. Note that this range is inclusive on the start and exclusive on the end, so a range of 3..5 will include the values 3 and 4.
Many(Vec<u8>)
This rule matches a non-consecutive set of neighbor counts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin 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