Struct rin::ecs::HasOption [−][src]
pub struct HasOption<T> where
T: 'static, { /* fields omitted */ }
Operator that matches every entity no matter if it has the component or not but doesn’t give access to the component, only returns a boolean specifying if the component is present or not.
This doesn’t lock the accessed component so it can be used in parallel even with write access operators
for (has_pos, vel) in entities.iter_for::<(HasOption<Position>, Read<Velocity>)>(){ if has_pos { // ... } }
Will select all entities that optionally have Position and have a Velocity component pos will be false for those that don’t have Position
Methods from Deref<Target = bool>
Trait Implementations
impl<T> DataAccesses for HasOption<T> where
T: 'static,
[src]
impl<T> DataAccesses for HasOption<T> where
T: 'static,
[src]impl<'a, T> FromComponent<'a, bool> for HasOption<T> where
T: 'static,
[src]
impl<'a, T> FromComponent<'a, bool> for HasOption<T> where
T: 'static,
[src]pub fn from_component(has: bool) -> HasOption<T>
[src]
impl<'a, T> UnorderedData<'a> for HasOption<T> where
T: 'static,
[src]
impl<'a, T> UnorderedData<'a> for HasOption<T> where
T: 'static,
[src]type Iter = IterHasOption<'a, T>
type IterMut = IterHasOption<'a, T>
type Components = T
type ComponentsRef = bool
type Storage = StorageHasOption<'a, T>
pub fn query_mask<E>(&E) -> Bitmask where
E: EntitiesStorage,
[src]
E: EntitiesStorage,
pub fn into_iter<E>(
entities: &'a E
) -> <HasOption<T> as UnorderedData<'a>>::Iter where
E: EntitiesStorage,
[src]
entities: &'a E
) -> <HasOption<T> as UnorderedData<'a>>::Iter where
E: EntitiesStorage,
pub fn into_iter_mut<E>(
entities: &'a E
) -> <HasOption<T> as UnorderedData<'a>>::Iter where
E: EntitiesStorage,
[src]
entities: &'a E
) -> <HasOption<T> as UnorderedData<'a>>::Iter where
E: EntitiesStorage,
pub fn storage<E>(
entities: &'a E
) -> Option<<HasOption<T> as UnorderedData<'a>>::Storage> where
E: EntitiesStorage,
[src]
entities: &'a E
) -> Option<<HasOption<T> as UnorderedData<'a>>::Storage> where
E: EntitiesStorage,
impl<'_, T> SafeIter<'_> for HasOption<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for HasOption<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for HasOption<T> where
T: Send,
T: Send,
impl<T> Sync for HasOption<T> where
T: Sync,
T: Sync,
impl<T> Unpin for HasOption<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for HasOption<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]