#![feature(type_alias_impl_trait)]
#![feature(generic_associated_types)]
#![allow(incomplete_features)]
mod neumann;
mod square_grid;
pub use neumann::*;
pub use square_grid::*;
pub trait Neighborhood {
type Neighbors<'a, T: 'a>;
type Edges<T>;
}
pub trait Sim<N>
where
N: Neighborhood,
{
type Cell: 'static;
type Diff: 'static;
type Flow;
fn compute(&self, cells: N::Neighbors<'_, Self::Cell>) -> Self::Diff;
fn egress(
&self,
cell: &mut Self::Cell,
diffs: N::Neighbors<'_, Self::Diff>,
) -> N::Edges<Self::Flow>;
fn ingress(&self, cell: &mut Self::Cell, flows: N::Edges<Self::Flow>);
fn cell_padding(&self) -> Self::Cell;
fn diff_padding(&self) -> Self::Diff;
fn flow_padding(&self) -> Self::Flow;
}