pub struct Matches<S>(/* private fields */);
Expand description
A query specification to indicate which entities match the inner query, but without borrowing any components.
§Examples
let mut world = World::new();
let entity1 = world.alloc();
world.insert(entity1, (42_i32, 1.0_f32));
let entity2 = world.alloc();
world.insert(entity2, (23_i32,));
let mut query = Query::<(&i32, Matches<&f32>)>::new();
let mut query = query.borrow(&world);
let mut query = query.map();
let (i1, f1) = query.get(entity1).unwrap();
assert_eq!(*i1, 42);
assert!(f1);
let (i2, f2) = query.get(entity2).unwrap();
assert_eq!(*i2, 23);
assert!(!f2);
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Matches<S>
impl<S> RefUnwindSafe for Matches<S>where
S: RefUnwindSafe,
impl<S> Send for Matches<S>where
S: Send,
impl<S> Sync for Matches<S>where
S: Sync,
impl<S> Unpin for Matches<S>where
S: Unpin,
impl<S> UnwindSafe for Matches<S>where
S: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more