pub struct QueryOne<'w, Q: Query> {
row: usize,
plan: Q::Plan<'w>,
_claims: Claims<'w>,
marker: PhantomData<fn() -> Q>,
}Expand description
What a scope hands out for a query over one entity.
Made by crate::Scope::query_one, which claims the components the query
reaches on that entity’s row. A missing match is still answered with an
error rather than a holder, so a caller that finds nothing holds no claim.
QueryOne::get is what reads the row, and it takes the holder
exclusively: an exclusive item borrows from the call, so the compiler refuses
a second one while the first is alive.
Fields§
§row: usize§plan: Q::Plan<'w>§_claims: Claims<'w>Held for the life of the holder: dropping it is what releases the claim.
marker: PhantomData<fn() -> Q>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'w, Q> !RefUnwindSafe for QueryOne<'w, Q>
impl<'w, Q> !Send for QueryOne<'w, Q>
impl<'w, Q> !Sync for QueryOne<'w, Q>
impl<'w, Q> !UnwindSafe for QueryOne<'w, Q>
impl<'w, Q> Forget for QueryOne<'w, Q>
impl<'w, Q> Freeze for QueryOne<'w, Q>
impl<'w, Q> Unpin for QueryOne<'w, Q>
impl<'w, Q> UnsafeUnpin for QueryOne<'w, Q>
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