pub trait IsBundle: Sized {
type EntryBundle: IsBundle;
type MutBundle: IsBundle;
fn unordered_types() -> SmallVec<[TypeId; 4]>;
fn empty_vecs() -> SmallVec<[AnyVec<dyn Send + Sync + 'static>; 4]>;
fn into_vecs(self) -> SmallVec<[AnyVec<dyn Send + Sync + 'static>; 4]>;
fn try_from_any_bundle(bundle: AnyBundle) -> Result<Self>;
fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle;
fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self;
fn ordered_types() -> Result<SmallVec<[TypeId; 4]>> { ... }
fn empty_any_bundle() -> Result<AnyBundle> { ... }
fn try_into_any_bundle(self) -> Result<AnyBundle> { ... }
}Expand description
Provides runtime type info about bundles and more.
Required Associated Types
sourcetype EntryBundle: IsBundle
type EntryBundle: IsBundle
A bundle where each of this bundle’s types are wrapped in Entry.
Required Methods
sourcefn unordered_types() -> SmallVec<[TypeId; 4]>
fn unordered_types() -> SmallVec<[TypeId; 4]>
Produces a list of types of a bundle, ordered by their position in the tuple.
sourcefn empty_vecs() -> SmallVec<[AnyVec<dyn Send + Sync + 'static>; 4]>
fn empty_vecs() -> SmallVec<[AnyVec<dyn Send + Sync + 'static>; 4]>
Produces an unordered list of empty AnyVecs to store
components, with the given capacity.
sourcefn into_vecs(self) -> SmallVec<[AnyVec<dyn Send + Sync + 'static>; 4]>
fn into_vecs(self) -> SmallVec<[AnyVec<dyn Send + Sync + 'static>; 4]>
Produces a list of AnyVecs of length 1, each containing
its corresponding component. The list is ordered by each component’s
position in the tuple.
fn try_from_any_bundle(bundle: AnyBundle) -> Result<Self>
fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle
fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self
Provided Methods
sourcefn ordered_types() -> Result<SmallVec<[TypeId; 4]>>
fn ordered_types() -> Result<SmallVec<[TypeId; 4]>>
Produces a list of types in a bundle, ordered ascending.
Errors if the bundle contains duplicate types.