pub struct Matches<S>(_);
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> 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
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