Struct hecs::QueryOne[][src]

pub struct QueryOne<'a, Q: Query> { /* fields omitted */ }

A borrow of a World sufficient to execute the query Q on a single entity

Implementations

impl<'a, Q: Query> QueryOne<'a, Q>[src]

pub fn get(&mut self) -> Option<QueryItem<'_, Q>>[src]

Get the query result, or None if the entity does not satisfy the query

Must be called at most once.

Panics if called more than once or if it would construct a borrow that clashes with another pre-existing borrow.

pub fn with<T: Component>(self) -> QueryOne<'a, With<T, Q>>[src]

Transform the query into one that requires a certain component without borrowing it

See QueryBorrow::with for details.

pub fn without<T: Component>(self) -> QueryOne<'a, Without<T, Q>>[src]

Transform the query into one that skips entities having a certain component

See QueryBorrow::without for details.

Trait Implementations

impl<Q: Query> Drop for QueryOne<'_, Q>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl<Q: Query> Send for QueryOne<'_, Q>[src]

impl<Q: Query> Sync for QueryOne<'_, Q>[src]

Auto Trait Implementations

impl<'a, Q> !RefUnwindSafe for QueryOne<'a, Q>

impl<'a, Q> Unpin for QueryOne<'a, Q> where
    Q: Unpin

impl<'a, Q> !UnwindSafe for QueryOne<'a, Q>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.