[][src]Struct bevy_hecs::Archetype

pub struct Archetype { /* fields omitted */ }

A collection of entities having the same component types

Accessing Archetypes is only required for complex dynamic scheduling. To manipulate entities, go through the World.

Implementations

impl Archetype[src]

pub fn new(types: Vec<TypeInfo>) -> Self[src]

pub fn with_grow(types: Vec<TypeInfo>, grow_size: usize) -> Self[src]

pub fn has<T: Component>(&self) -> bool[src]

pub fn has_type(&self, ty: TypeId) -> bool[src]

pub fn get<T: Component>(&self) -> Option<NonNull<T>>[src]

pub fn get_with_type_state<T: Component>(
    &self
) -> Option<(NonNull<T>, &TypeState)>
[src]

pub fn get_type_state(&self, ty: TypeId) -> Option<&TypeState>[src]

pub fn get_type_state_mut(&mut self, ty: TypeId) -> Option<&mut TypeState>[src]

pub fn borrow<T: Component>(&self)[src]

pub fn borrow_mut<T: Component>(&self)[src]

pub fn release<T: Component>(&self)[src]

pub fn release_mut<T: Component>(&self)[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn iter_entities(&self) -> impl Iterator<Item = &Entity>[src]

pub fn types(&self) -> &[TypeInfo][src]

pub unsafe fn allocate(&mut self, id: Entity) -> usize[src]

Safety

Every type must be written immediately after this call

pub fn clear_trackers(&mut self)[src]

pub unsafe fn put_dynamic(
    &mut self,
    component: *mut u8,
    ty: TypeId,
    size: usize,
    index: usize,
    added: bool
)
[src]

Safety

  • component must point to valid memory
  • the component type must be registered
  • index must be in-bound
  • size must be the size of the component
  • the storage array must be big enough

Trait Implementations

impl Debug for Archetype[src]

impl Drop for Archetype[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.