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

A bundle where each of this bundle’s types are wrapped in Entry.

A bundle where each of this bundle’s types are prefixed with &’static mut.

Required Methods

Produces a list of types of a bundle, ordered by their position in the tuple.

Produces an unordered list of empty AnyVecs to store components, with the given capacity.

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.

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

Provided Methods

Produces a list of types in a bundle, ordered ascending.

Errors if the bundle contains duplicate types.

Converts the tuple into a type-erased AnyBundle.

Errs

Errs if the tuple contains duplicate types.

Implementations on Foreign Types

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

source

fn into_entry_bundle(self, entity_id: usize) -> Self::EntryBundle

source

fn from_entry_bundle(entry_bundle: Self::EntryBundle) -> Self

Implementors