Struct bevy_defer::OwnedQueryState
source · pub struct OwnedQueryState<'t, D: QueryData + 'static, F: QueryFilter + 'static> { /* private fields */ }
Expand description
A World
reference with a cached QueryState
.
Tries to obtain the QueryState
from the World
on create
and stores the QueryState
in the World
on drop.
Since QueryState
cannot be constructed from &World
, readonly access is not supported.
Implementations§
source§impl<D: QueryData + 'static, F: QueryFilter + 'static> OwnedQueryState<'_, D, F>
impl<D: QueryData + 'static, F: QueryFilter + 'static> OwnedQueryState<'_, D, F>
sourcepub fn apply_commands(&mut self, commands: &mut CommandQueue)
pub fn apply_commands(&mut self, commands: &mut CommandQueue)
Apply a command queue to world.
source§impl<'t, D: QueryData + 'static, F: QueryFilter + 'static> OwnedQueryState<'t, D, F>
impl<'t, D: QueryData + 'static, F: QueryFilter + 'static> OwnedQueryState<'t, D, F>
pub fn new(world: &mut World) -> OwnedQueryState<'_, D, F>
pub fn single( &mut self, ) -> Result<<D::ReadOnly as WorldQuery>::Item<'_>, AccessError>
pub fn single_mut(&mut self) -> Result<D::Item<'_>, AccessError>
pub fn get( &mut self, entity: Entity, ) -> Result<<D::ReadOnly as WorldQuery>::Item<'_>, AccessError>
pub fn iter_many<E: IntoIterator>( &mut self, entities: E, ) -> QueryManyIter<'_, '_, D::ReadOnly, F, E::IntoIter>
pub fn iter_many_mut<E: IntoIterator>( &mut self, entities: E, ) -> QueryManyIter<'_, '_, D, F, E::IntoIter>
pub fn get_mut(&mut self, entity: Entity) -> Result<D::Item<'_>, AccessError>
pub fn iter(&mut self) -> QueryIter<'_, '_, D::ReadOnly, F>
pub fn iter_mut(&mut self) -> QueryIter<'_, '_, D, F>
Trait Implementations§
source§impl<'t, D: QueryData + 'static, F: QueryFilter + 'static> Drop for OwnedQueryState<'t, D, F>
impl<'t, D: QueryData + 'static, F: QueryFilter + 'static> Drop for OwnedQueryState<'t, D, F>
source§impl<'w, 's, D: QueryData + 'static, F: QueryFilter + 'static> IntoIterator for &'s mut OwnedQueryState<'w, D, F>
impl<'w, 's, D: QueryData + 'static, F: QueryFilter + 'static> IntoIterator for &'s mut OwnedQueryState<'w, D, F>
Auto Trait Implementations§
impl<'t, D, F> Freeze for OwnedQueryState<'t, D, F>
impl<'t, D, F> !RefUnwindSafe for OwnedQueryState<'t, D, F>
impl<'t, D, F> Send for OwnedQueryState<'t, D, F>
impl<'t, D, F> Sync for OwnedQueryState<'t, D, F>
impl<'t, D, F> Unpin for OwnedQueryState<'t, D, F>
impl<'t, D, F> !UnwindSafe for OwnedQueryState<'t, D, F>
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn 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.source§fn 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.