pub struct Map2D<AG: AdjacencyGenerator<2>, K: DistributionKey, MP: MapPosition<2>> {
pub tiles: Vec<ThreadsafeNodeRef<AG, K, MP>>,
pub undecided_tiles: HashMap<MP, ThreadsafeNodeRef<AG, K, MP>>,
/* private fields */
}Fields§
§tiles: Vec<ThreadsafeNodeRef<AG, K, MP>>§undecided_tiles: HashMap<MP, ThreadsafeNodeRef<AG, K, MP>>Implementations§
Source§impl<AG: AdjacencyGenerator<2, Input = MP>, K: DistributionKey, MP: MapPosition<2>> Map2D<AG, K, MP>
impl<AG: AdjacencyGenerator<2, Input = MP>, K: DistributionKey, MP: MapPosition<2>> Map2D<AG, K, MP>
pub fn from_tiles<I: IntoIterator<Item = Map2DNode<AG, K, MP>>>( tiles: I, ) -> Map2D<AG, K, MP>
pub fn get<BMP: Borrow<MP>>( &self, key: BMP, ) -> Option<&ThreadsafeNodeRef<AG, K, MP>>
pub fn finalize_tile<'n>( &'n mut self, tile: &'n ThreadsafeNodeRef<AG, K, MP>, assignment: K, ) -> Option<&ThreadsafeNodeRef<AG, K, MP>>
pub fn unassign_tile<'n>( &'n mut self, tile: &'n ThreadsafeNodeRef<AG, K, MP>, distribution: &'n MultinomialDistribution<K>, ) -> Option<&ThreadsafeNodeRef<AG, K, MP>>
pub fn unassign_tiles<'n, I: IntoIterator<Item = &'n ThreadsafeNodeRef<AG, K, MP>>>( &'n mut self, tiles: I, distribution: MultinomialDistribution<K>, ) -> Option<()>
Source§impl<K: DistributionKey, MP: MapPosition<2>, RMP: Borrow<MP> + From<MP>, AG: AdjacencyGenerator<2, Input = RMP>> Map2D<AG, K, MP>
impl<K: DistributionKey, MP: MapPosition<2>, RMP: Borrow<MP> + From<MP>, AG: AdjacencyGenerator<2, Input = RMP>> Map2D<AG, K, MP>
pub fn adjacent_from_pos( &self, pos: RMP, ) -> SmallVec<[ThreadsafeNodeRef<AG, K, MP>; 8]>
pub fn adjacent<NR: Borrow<Map2DNode<AG, K, MP>>>( &self, node: NR, ) -> SmallVec<[ThreadsafeNodeRef<AG, K, MP>; 8]>
Trait Implementations§
Source§impl<AG: Clone + AdjacencyGenerator<2>, K: Clone + DistributionKey, MP: Clone + MapPosition<2>> Clone for Map2D<AG, K, MP>
impl<AG: Clone + AdjacencyGenerator<2>, K: Clone + DistributionKey, MP: Clone + MapPosition<2>> Clone for Map2D<AG, K, MP>
Source§impl<'de, AG, K, MP> Deserialize<'de> for Map2D<AG, K, MP>where
AG: Deserialize<'de> + AdjacencyGenerator<2>,
K: Deserialize<'de> + DistributionKey,
MP: Deserialize<'de> + MapPosition<2>,
impl<'de, AG, K, MP> Deserialize<'de> for Map2D<AG, K, MP>where
AG: Deserialize<'de> + AdjacencyGenerator<2>,
K: Deserialize<'de> + DistributionKey,
MP: Deserialize<'de> + MapPosition<2>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<AG, K, MP> Serialize for Map2D<AG, K, MP>where
AG: Serialize + AdjacencyGenerator<2>,
K: Serialize + DistributionKey,
MP: Serialize + MapPosition<2>,
impl<AG, K, MP> Serialize for Map2D<AG, K, MP>where
AG: Serialize + AdjacencyGenerator<2>,
K: Serialize + DistributionKey,
MP: Serialize + MapPosition<2>,
Auto Trait Implementations§
impl<AG, K, MP> Freeze for Map2D<AG, K, MP>where
MP: Freeze,
impl<AG, K, MP> !RefUnwindSafe for Map2D<AG, K, MP>
impl<AG, K, MP> !Send for Map2D<AG, K, MP>
impl<AG, K, MP> !Sync for Map2D<AG, K, MP>
impl<AG, K, MP> Unpin for Map2D<AG, K, MP>where
MP: Unpin,
impl<AG, K, MP> !UnwindSafe for Map2D<AG, K, MP>
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more