intuicio_framework_ecs::world

Struct World

source
pub struct World {
    pub new_archetype_capacity: usize,
    /* private fields */
}

Fields§

§new_archetype_capacity: usize

Implementations§

source§

impl World

source

pub fn with_new_archetype_capacity(self, value: usize) -> Self

source

pub fn is_empty(&self) -> bool

source

pub fn len(&self) -> usize

source

pub fn entities(&self) -> impl Iterator<Item = Entity> + '_

source

pub fn archetypes(&self) -> impl Iterator<Item = &Archetype>

source

pub fn clear(&mut self)

source

pub fn spawn(&mut self, bundle: impl Bundle) -> Result<Entity, WorldError>

source

pub unsafe fn spawn_uninitialized<T: BundleColumns>( &mut self, ) -> Result<(Entity, ArchetypeEntityRowAccess<'_>), WorldError>

§Safety
source

pub unsafe fn spawn_uninitialized_raw( &mut self, columns: Vec<ArchetypeColumnInfo>, ) -> Result<(Entity, ArchetypeEntityRowAccess<'_>), WorldError>

§Safety
source

pub fn despawn(&mut self, entity: Entity) -> Result<(), WorldError>

source

pub fn insert( &mut self, entity: Entity, bundle: impl Bundle, ) -> Result<(), WorldError>

source

pub fn remove<T: BundleColumns>( &mut self, entity: Entity, ) -> Result<(), WorldError>

source

pub fn remove_raw( &mut self, entity: Entity, columns: Vec<ArchetypeColumnInfo>, ) -> Result<(), WorldError>

source

pub fn get<const LOCKING: bool, T: Component>( &self, entity: Entity, unique: bool, ) -> Result<ArchetypeEntityColumnAccess<'_, LOCKING, T>, WorldError>

source

pub fn dynamic_get<const LOCKING: bool>( &self, type_hash: TypeHash, entity: Entity, unique: bool, ) -> Result<ArchetypeDynamicEntityColumnAccess<'_, LOCKING>, WorldError>

source

pub fn query<'a, const LOCKING: bool, Fetch: TypedQueryFetch<'a, LOCKING>>( &'a self, ) -> TypedQueryIter<'a, LOCKING, Fetch>

source

pub fn dynamic_query<'a, const LOCKING: bool>( &'a self, filter: &DynamicQueryFilter, ) -> DynamicQueryIter<'a, LOCKING>

source

pub fn relate<T>(&mut self, from: Entity, to: Entity)

source

pub fn relate_raw(&mut self, type_hash: TypeHash, from: Entity, to: Entity)

source

pub fn unrelate<T>(&mut self, from: Entity, to: Entity)

source

pub fn unrelate_raw(&mut self, type_hash: TypeHash, from: Entity, to: Entity)

source

pub fn unrelate_from<T>(&mut self, from: Entity)

source

pub fn unrelate_from_raw(&mut self, type_hash: TypeHash, from: Entity)

source

pub fn unrelate_to<T>(&mut self, to: Entity)

source

pub fn unrelate_to_raw(&mut self, type_hash: TypeHash, to: Entity)

source

pub fn unrelate_all<T>(&mut self, entity: Entity)

source

pub fn unrelate_all_raw(&mut self, type_hash: TypeHash, entity: Entity)

source

pub fn unrelate_any(&mut self, entity: Entity)

source

pub fn relations<T>(&self, entity: Entity) -> impl Iterator<Item = Entity> + '_

source

pub fn relations_raw( &self, type_hash: TypeHash, entity: Entity, ) -> impl Iterator<Item = Entity> + '_

source

pub fn outgoing_relations<T>( &self, entity: Entity, ) -> impl Iterator<Item = Entity> + '_

source

pub fn outgoing_relations_raw( &self, type_hash: TypeHash, entity: Entity, ) -> impl Iterator<Item = Entity> + '_

source

pub fn incoming_relations<T>( &self, entity: Entity, ) -> impl Iterator<Item = Entity> + '_

source

pub fn incoming_relations_raw( &self, type_hash: TypeHash, entity: Entity, ) -> impl Iterator<Item = Entity> + '_

source

pub fn traverse_outgoing<T>( &self, entities: impl IntoIterator<Item = Entity>, ) -> RelationsTraverseIter<'_>

source

pub fn traverse_outgoing_raw( &self, type_hash: TypeHash, entities: impl IntoIterator<Item = Entity>, ) -> RelationsTraverseIter<'_>

source

pub fn traverse_incoming<T>( &self, entities: impl IntoIterator<Item = Entity>, ) -> RelationsTraverseIter<'_>

source

pub fn traverse_incoming_raw( &self, type_hash: TypeHash, entities: impl IntoIterator<Item = Entity>, ) -> RelationsTraverseIter<'_>

Trait Implementations§

source§

impl Default for World

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for World

§

impl RefUnwindSafe for World

§

impl Send for World

§

impl Sync for World

§

impl Unpin for World

§

impl UnwindSafe for World

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Finalize for T

source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Initialize for T
where T: Default,

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Component for T
where T: Send + Sync + 'static,