Struct termite::QueryState
source · pub struct QueryState<Q: WorldQuery, F: ReadOnlyWorldQuery> { /* private fields */ }
Implementations
sourceimpl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F>
impl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F>
pub fn new(world: &mut World) -> Self
pub fn get_entities(&self, world: &World) -> EntityIdSet
pub fn contains(&self, world: &World, entity: Entity) -> bool
pub fn as_readonly(&self) -> &QueryState<Q::ReadOnly, F::ReadOnly>
sourcepub unsafe fn as_transmuted_state<NQ, NF>(&self) -> &QueryState<NQ, NF>where
NQ: WorldQuery<State = Q::State>,
NF: ReadOnlyWorldQuery<State = F::State>,
pub unsafe fn as_transmuted_state<NQ, NF>(&self) -> &QueryState<NQ, NF>where
NQ: WorldQuery<State = Q::State>,
NF: ReadOnlyWorldQuery<State = F::State>,
Safety
NQ
must have a subset of the access ofQ
.NF
must have a subset of the access ofF
.
sourcepub unsafe fn get_unchecked_manual<'w>(
&self,
world: &'w World,
entity: Entity,
last_change_tick: u32,
change_tick: u32
) -> Option<Q::Item<'w>>
pub unsafe fn get_unchecked_manual<'w>(
&self,
world: &'w World,
entity: Entity,
last_change_tick: u32,
change_tick: u32
) -> Option<Q::Item<'w>>
Safety
world
must be the same world that was used to create thisQueryState
.
sourceimpl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F>
impl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F>
pub fn validate_world(&self, world: &World)
pub fn debug_validate_world(&self, world: &World)
pub fn get<'w>(
&self,
world: &'w World,
entity: Entity
) -> Option<ReadOnlyQueryItem<'w, Q>>
pub fn get_mut<'w>(
&mut self,
world: &'w mut World,
entity: Entity
) -> Option<QueryItem<'w, Q>>
sourcepub unsafe fn iter_unchecked_manual<'w, 's>(
&'s self,
world: &'w World,
last_change_tick: u32,
change_tick: u32
) -> QueryIter<'w, 's, Q, F>ⓘNotable traits for QueryIter<'w, 's, Q, F>impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Iterator for QueryIter<'w, 's, Q, F> type Item = QueryItem<'w, Q>;
pub unsafe fn iter_unchecked_manual<'w, 's>(
&'s self,
world: &'w World,
last_change_tick: u32,
change_tick: u32
) -> QueryIter<'w, 's, Q, F>ⓘNotable traits for QueryIter<'w, 's, Q, F>impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Iterator for QueryIter<'w, 's, Q, F> type Item = QueryItem<'w, Q>;
Safety
world
must be the same world that was used to create thisQueryState
.
pub fn iter<'w, 's>(
&'s self,
world: &'w World
) -> QueryIter<'w, 's, Q::ReadOnly, F::ReadOnly>ⓘNotable traits for QueryIter<'w, 's, Q, F>impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Iterator for QueryIter<'w, 's, Q, F> type Item = QueryItem<'w, Q>;
pub fn iter_mut<'w, 's>(
&'s mut self,
world: &'w mut World
) -> QueryIter<'w, 's, Q, F>ⓘNotable traits for QueryIter<'w, 's, Q, F>impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Iterator for QueryIter<'w, 's, Q, F> type Item = QueryItem<'w, Q>;
Trait Implementations
sourceimpl<'w, 's, Q, F> SystemParamFetch<'w, 's> for QueryState<Q, F>where
Q: WorldQuery + 'static,
F: ReadOnlyWorldQuery + 'static,
impl<'w, 's, Q, F> SystemParamFetch<'w, 's> for QueryState<Q, F>where
Q: WorldQuery + 'static,
F: ReadOnlyWorldQuery + 'static,
sourceimpl<Q, F> SystemParamState for QueryState<Q, F>where
Q: WorldQuery + 'static,
F: ReadOnlyWorldQuery + 'static,
impl<Q, F> SystemParamState for QueryState<Q, F>where
Q: WorldQuery + 'static,
F: ReadOnlyWorldQuery + 'static,
Auto Trait Implementations
impl<Q, F> RefUnwindSafe for QueryState<Q, F>where
<F as WorldQuery>::State: RefUnwindSafe,
<Q as WorldQuery>::State: RefUnwindSafe,
impl<Q, F> Send for QueryState<Q, F>
impl<Q, F> Sync for QueryState<Q, F>
impl<Q, F> Unpin for QueryState<Q, F>where
<F as WorldQuery>::State: Unpin,
<Q as WorldQuery>::State: Unpin,
impl<Q, F> UnwindSafe for QueryState<Q, F>where
<F as WorldQuery>::State: UnwindSafe,
<Q as WorldQuery>::State: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more