pub struct Loop<'a, S>where
S: Sim<'a>,{ /* private fields */ }
Implementations§
Source§impl<'a, S> Loop<'a, S>where
S: Sim<'a>,
impl<'a, S> Loop<'a, S>where
S: Sim<'a>,
Sourcepub fn new<C>(coloration: C) -> Self
pub fn new<C>(coloration: C) -> Self
Must pass the function that colors cells. Color is in RGB ([red, green, blue]
).
pub fn new_bool() -> Self
pub fn scale(&mut self, scale: f32) -> &mut Self
pub fn filter<F>(&mut self, filter: F) -> &mut Self
pub fn run(&self, grid: SquareGrid<'a, S>)where
S: 'a,
S::Cell: Sync + Send,
S::Move: Sync + Send,
S::Diff: Sync + Send,
S::Neighbors: Sync + Send,
S::MoveNeighbors: Sync + Send,
SquareGrid<'a, S>: TakeMoveNeighbors<usize, S::MoveNeighbors> + GetNeighbors<'a, usize, S::Neighbors>,
Sourcepub unsafe fn run_multi<I0: Read, I1: Read, I2: Read, I3: Read, I4: Read, I5: Read, I6: Read, I7: Read, O0: Write, O1: Write, O2: Write, O3: Write, O4: Write, O5: Write, O6: Write, O7: Write>(
&self,
grid: SquareGrid<'a, S>,
in_right: I0,
in_up_right: I1,
in_up: I2,
in_up_left: I3,
in_left: I4,
in_down_left: I5,
in_down: I6,
in_down_right: I7,
out_right: O0,
out_up_right: O1,
out_up: O2,
out_up_left: O3,
out_left: O4,
out_down_left: O5,
out_down: O6,
out_down_right: O7,
)where
S: 'a,
for<'dc> S::Cell: Sync + Send + Serialize + Deserialize<'dc>,
S::Move: Sync + Send,
S::Diff: Sync + Send,
S::Neighbors: Sync + Send,
S::MoveNeighbors: Sync + Send,
SquareGrid<'a, S>: TakeMoveNeighbors<usize, S::MoveNeighbors> + GetNeighbors<'a, usize, S::Neighbors>,
pub unsafe fn run_multi<I0: Read, I1: Read, I2: Read, I3: Read, I4: Read, I5: Read, I6: Read, I7: Read, O0: Write, O1: Write, O2: Write, O3: Write, O4: Write, O5: Write, O6: Write, O7: Write>(
&self,
grid: SquareGrid<'a, S>,
in_right: I0,
in_up_right: I1,
in_up: I2,
in_up_left: I3,
in_left: I4,
in_down_left: I5,
in_down: I6,
in_down_right: I7,
out_right: O0,
out_up_right: O1,
out_up: O2,
out_up_left: O3,
out_left: O4,
out_down_left: O5,
out_down: O6,
out_down_right: O7,
)where
S: 'a,
for<'dc> S::Cell: Sync + Send + Serialize + Deserialize<'dc>,
S::Move: Sync + Send,
S::Diff: Sync + Send,
S::Neighbors: Sync + Send,
S::MoveNeighbors: Sync + Send,
SquareGrid<'a, S>: TakeMoveNeighbors<usize, S::MoveNeighbors> + GetNeighbors<'a, usize, S::Neighbors>,
Runs serializing and deserializing to and from another run_multi
. As soon as any read or write fails
this will terminate without prompting.
Make sure the reads and writes are only connected to other SquareGrid::run_multi
running
on any machine using THE EXACT SAME simulation or else there may be undefined behavior.
Auto Trait Implementations§
impl<'a, S> Freeze for Loop<'a, S>
impl<'a, S> !RefUnwindSafe for Loop<'a, S>
impl<'a, S> !Send for Loop<'a, S>
impl<'a, S> Sync for Loop<'a, S>
impl<'a, S> Unpin for Loop<'a, S>
impl<'a, S> !UnwindSafe for Loop<'a, S>
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