SpatialTable

Struct SpatialTable 

Source
pub struct SpatialTable<L: Layers> { /* private fields */ }

Implementations§

Source§

impl<L: Layers> SpatialTable<L>

Source

pub fn new(size: Size) -> Self

Source

pub fn clear(&mut self)

Source

pub fn enumerate(&self) -> Enumerate<'_, L>

Source

pub fn grid_size(&self) -> Size

Source

pub fn layers_at(&self, coord: Coord) -> Option<&L>

Source

pub fn layers_at_checked(&self, coord: Coord) -> &L

Source

pub fn location_of(&self, entity: Entity) -> Option<&Location<L::Layer>>

Source

pub fn coord_of(&self, entity: Entity) -> Option<Coord>

Source

pub fn layer_of(&self, entity: Entity) -> Option<L::Layer>

Source

pub fn update( &mut self, entity: Entity, location: Location<L::Layer>, ) -> Result<(), UpdateError>

Source

pub fn update_coord( &mut self, entity: Entity, coord: Coord, ) -> Result<(), UpdateError>

Source

pub fn update_layer( &mut self, entity: Entity, layer: L::Layer, ) -> Result<(), UpdateLayerError>

Source

pub fn clear_layer(&mut self, entity: Entity) -> Result<(), EntityHasNoCoord>

Source

pub fn remove(&mut self, entity: Entity)

Trait Implementations§

Source§

impl<L: Debug + Layers> Debug for SpatialTable<L>
where L::Layer: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L> Freeze for SpatialTable<L>

§

impl<L> RefUnwindSafe for SpatialTable<L>

§

impl<L> Send for SpatialTable<L>
where L: Send, <L as Layers>::Layer: Send,

§

impl<L> Sync for SpatialTable<L>
where L: Sync, <L as Layers>::Layer: Sync,

§

impl<L> Unpin for SpatialTable<L>
where L: Unpin, <L as Layers>::Layer: Unpin,

§

impl<L> UnwindSafe for SpatialTable<L>
where L: UnwindSafe, <L as Layers>::Layer: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.