pub struct QueryOne<'a, Q: Query> { /* private fields */ }
Expand description
A borrow of a World
sufficient to execute the query Q
on a single entity
Implementations
sourceimpl<'a, Q: Query> QueryOne<'a, Q>
impl<'a, Q: Query> QueryOne<'a, Q>
sourcepub fn get(&mut self) -> Option<QueryItem<'_, Q>>
pub fn get(&mut self) -> Option<QueryItem<'_, Q>>
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.
Trait Implementations
impl<Q: Query> Send for QueryOne<'_, Q>
impl<Q: Query> Sync for QueryOne<'_, Q>
Auto Trait Implementations
impl<'a, Q> RefUnwindSafe for QueryOne<'a, Q> where
Q: RefUnwindSafe,
impl<'a, Q> Unpin for QueryOne<'a, Q> where
Q: Unpin,
impl<'a, Q> UnwindSafe for QueryOne<'a, Q> where
Q: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more