Skip to main content

IndexFromPosition

Trait IndexFromPosition 

Source
pub trait IndexFromPosition<P> {
    type Location: Ord;

    // Required method
    fn location_from_position(&self, position: &P) -> Self::Location;
}
Expand description

Locate the index of a given point.

This is used by Microstate to sort for cache coherency.

Required Associated Types§

Source

type Location: Ord

Orderable type based on the site’s position.

Required Methods§

Source

fn location_from_position(&self, position: &P) -> Self::Location

Determine the location of a site based on its position.

Many positions can map to the same location. The ideal mapping will place points close together in physical space close together in the ordering.

Implementors§

Source§

impl<K, const D: usize> IndexFromPosition<Cartesian<D>> for VecCell<K, D>
where K: Eq + Hash,