pub struct Automaton { /* private fields */ }Expand description
The humble 2D cellular automaton.
Implementations§
Source§impl Automaton
impl Automaton
Sourcepub fn new(
rules: AutomataRules,
bounds: Vec2,
start_cells: Vec<Vec2>,
) -> Result<Automaton, u8>
pub fn new( rules: AutomataRules, bounds: Vec2, start_cells: Vec<Vec2>, ) -> Result<Automaton, u8>
Creates a new flat (2D) automaton with the given rules, bounds, and starting cells. This can fail if your survival and birth rules exceeds the amount of neighbors a cell could have, given your chosen neighbor counting method. If that happens, this function will error out and return the maximum amount of neighbors.
Auto Trait Implementations§
impl Freeze for Automaton
impl RefUnwindSafe for Automaton
impl Send for Automaton
impl Sync for Automaton
impl Unpin for Automaton
impl UnwindSafe for Automaton
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