Struct hecs::PreparedView
source · pub struct PreparedView<'q, Q: Query> { /* private fields */ }
Expand description
Provides random access to the results of a prepared query
Implementations§
source§impl<'q, Q: Query> PreparedView<'q, Q>
impl<'q, Q: Query> PreparedView<'q, Q>
sourcepub fn get(&self, entity: Entity) -> Option<QueryItem<'_, Q>>where
Q: QueryShared,
pub fn get(&self, entity: Entity) -> Option<QueryItem<'_, Q>>where
Q: QueryShared,
Retrieve the query results corresponding to entity
Will yield None
if the entity does not exist or does not match the query.
Does not require exclusive access to the map, but is defined only for queries yielding only shared references.
sourcepub fn get_mut(&mut self, entity: Entity) -> Option<QueryItem<'_, Q>>
pub fn get_mut(&mut self, entity: Entity) -> Option<QueryItem<'_, Q>>
Retrieve the query results corresponding to entity
Will yield None
if the entity does not exist or does not match the query.