Trait spirt::EntityOrientedMapKey
source · pub trait EntityOrientedMapKey<V>: Copy {
type Entity: Entity;
type DenseValueSlots: Default;
// Required methods
fn to_entity(key: Self) -> Self::Entity;
fn get_dense_value_slot(
key: Self,
slots: &Self::DenseValueSlots
) -> &Option<V>;
fn get_dense_value_slot_mut(
key: Self,
slots: &mut Self::DenseValueSlots
) -> &mut Option<V>;
}
Expand description
EntityOriented*Map<Self, V>
support trait, implemented for entity types,
but which can also be implemented by users for their own newtypes and other
types wrapping entity types (such as finite enum
s).
Required Associated Types§
sourcetype DenseValueSlots: Default
type DenseValueSlots: Default
A type holding enough different Option<V>
slots, for all possible
values of Self
, for a given Self::Entity
value contained inside.