pub struct QueryCommands<'w> { /* private fields */ }Expand description
Deferred structural commands available while a query callback runs.
Implementations§
Source§impl<'w> QueryCommands<'w>
impl<'w> QueryCommands<'w>
Sourcepub fn spawn(&mut self) -> Result<EntityId, QueryError>
pub fn spawn(&mut self) -> Result<EntityId, QueryError>
Reserves a new entity id and queues a deferred spawn.
Sourcepub fn despawn(&mut self, entity: EntityId) -> Result<(), QueryError>
pub fn despawn(&mut self, entity: EntityId) -> Result<(), QueryError>
Queues a deferred despawn when the target is live or reserved.
Sourcepub fn insert<T: 'static>(
&mut self,
entity: EntityId,
value: T,
) -> Result<(), QueryError>
pub fn insert<T: 'static>( &mut self, entity: EntityId, value: T, ) -> Result<(), QueryError>
Queues a deferred component insert for a live or reserved entity.
Sourcepub fn remove<T: 'static>(&mut self, entity: EntityId) -> Result<(), QueryError>
pub fn remove<T: 'static>(&mut self, entity: EntityId) -> Result<(), QueryError>
Queues a deferred component removal for a live or reserved entity.
Sourcepub fn insert_bundle<B: Bundle>(
&mut self,
entity: EntityId,
bundle: B,
) -> Result<(), QueryError>
pub fn insert_bundle<B: Bundle>( &mut self, entity: EntityId, bundle: B, ) -> Result<(), QueryError>
Queues a deferred bundle write for a live or reserved entity.
Auto Trait Implementations§
impl<'w> !RefUnwindSafe for QueryCommands<'w>
impl<'w> !Send for QueryCommands<'w>
impl<'w> !Sync for QueryCommands<'w>
impl<'w> !UnwindSafe for QueryCommands<'w>
impl<'w> Freeze for QueryCommands<'w>
impl<'w> Unpin for QueryCommands<'w>
impl<'w> UnsafeUnpin for QueryCommands<'w>
Blanket Implementations§
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