Skip to main content

QueryCommands

Struct QueryCommands 

Source
pub struct QueryCommands<'w> { /* private fields */ }
Expand description

Deferred structural commands available while a query callback runs.

Implementations§

Source§

impl<'w> QueryCommands<'w>

Source

pub fn spawn(&mut self) -> Result<EntityId, QueryError>

Reserves a new entity id and queues a deferred spawn.

Source

pub fn despawn(&mut self, entity: EntityId) -> Result<(), QueryError>

Queues a deferred despawn when the target is live or reserved.

Source

pub fn insert<T: 'static>( &mut self, entity: EntityId, value: T, ) -> Result<(), QueryError>

Queues a deferred component insert for a live or reserved entity.

Source

pub fn remove<T: 'static>(&mut self, entity: EntityId) -> Result<(), QueryError>

Queues a deferred component removal for a live or reserved entity.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.