[][src]Struct hecs::QueryOne

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]

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]

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

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

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

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

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.

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.