brood/entities/sealed/contains.rs
1//! Provides the `Contains` trait to indicate what entity type is contained in a heterogeneous list
2//! implementing `Entities`.
3
4use crate::{
5 component::Component,
6 entities::Null,
7 entity,
8 entity::Entity,
9};
10use alloc::vec::Vec;
11
12/// Defines the entity type contained by `Entities`.
13pub trait Contains {
14 /// The type of entity contained.
15 type Entity: Entity;
16}
17
18impl Contains for Null {
19 type Entity = entity::Null;
20}
21
22impl<C, E> Contains for (Vec<C>, E)
23where
24 C: Component,
25 E: Contains,
26{
27 type Entity = (C, E::Entity);
28}