Struct rin::ecs::World [−][src]
pub struct World { /* fields omitted */ }
Main rinecs object that contains all entities, resources and systems.
A world is the first object one creates when using rinecs.
Through it one can create every other element, like entities and their components.
Also resources, globbally accessible data, is stored in the world and passed later to the systems.
The systems order of exectuion is defined by adding systems to the world and using barriers to define groups of parallel execution.
Once the world is setup one can call run_once or the more specific run_multi_threaded and run_single_threaded to run the systems in the order they were added.
Implementations
impl World
[src]
impl World
[src]pub fn new() -> World
[src]
pub fn register_with_capacity<'r, C>(&mut self, capacity: usize) where
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Registers a type that implements Send
as Component
reserving an initial amount of memory.
Send
components can be used from System
which run from different threads.
Calling this method is not needed but will make initial insertion faster if we can estimate the total amount of components beforehand
pub fn register_thread_local_with_capacity<'r, C>(&mut self, capacity: usize) where
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Registers a type that can only be used from the main thread asComponent
reserving an
initial amount of memory.
Send
components can be used from System
which run from different threads.
Calling this method is not needed but will make initial insertion faster if we can estimate the total amount of components beforehand
pub fn new_entity(&mut self) -> EntityBuilder<'_>
[src]
Returns an EntityBuilder that allows to create an entity and it’s components.
let e = world.new_entity() .add(Position{x: 0., y: 0.}) .add(Velocity{x: 0., y: 0.}) .build();
pub fn component_mask<C>(&self) -> U256 where
C: 'static,
[src]
C: 'static,
pub fn entities(&mut self) -> Entities<'_>
[src]
Returns an Entities
object that allows to iterate over all the Send
components
of entities in this world.
pub fn entities_thread_local(&mut self) -> EntitiesThreadLocal<'_>
[src]
Returns an EntitiesThreadLocal
object that allows to iterate over all the
Send
and non Send
components of entities in this world.
pub fn entities_creation(&mut self) -> EntitiesCreation<'_>
[src]
Returns an EntitiesCreation
object that allows to iterate over all the
Send
and non Send
components of entities in this world and create
new entities and resources.
pub fn debug_entities(&mut self) -> EntitiesDebug<'_>
[src]
Returns an EntitiesDebug
object that allows to iterate over all the
Send
and non Send
components of entities in this world and debug / serialize
them
pub fn add_component_to<'r, C>(&mut self, entity: &Entity, component: C) where
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Adds a Send
Component
to an already existing Entity
.
pub fn add_component_to_thread_local<'r, C>(
&mut self,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Adds a non Send
Component
to an already existing Entity
.
pub fn add_tag_to<C>(&mut self, entity: &Entity) where
C: 'static,
[src]
C: 'static,
pub fn add_child_component_to<'r, C>(
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Adds a Send
Component
to an already existing Entity
.
pub fn add_child_component_to_thread_local<'r, C>(
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Adds a non Send
Component
to an already existing Entity
.
pub fn add_slice_component_to<'r, C, I>(
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentSend,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentSend,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Adds a Send
OneToNComponent
to an already existing Entity
.
This allows to add a slice of components to an entity instead of only one component. This components are stored contiguously in memory for all the entities.
pub fn add_slice_component_to_thread_local<'r, C, I>(
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentThreadLocal,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentThreadLocal,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Adds a non Send
OneToNComponent
to an already existing Entity
.
This allows to add a slice of components to an entity instead of only one component. This components are stored contiguously in memory for all the entities.
pub fn remove_component_from<'r, C>(&mut self, entity: &Entity) where
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
Removes a compoenent of the specified type from an entity.
pub fn remove_entity(&mut self, entity: &Entity)
[src]
Removes an Entity
and all it’s compoenents.
pub fn add_resource<T>(&mut self, resource: T) where
T: 'static + Send,
[src]
T: 'static + Send,
Adds a Send
resource to the world.
Resources are globally accesible by any system through
the Resources
object passed as parameter to them.
pub fn add_resource_as_trait<T, U, F, FMut>(&mut self, resource: (T, F, FMut)) where
T: 'static + Send,
F: Fn(&T) -> &U + 'static,
U: 'static + Send + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
[src]
T: 'static + Send,
F: Fn(&T) -> &U + 'static,
U: 'static + Send + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
Adds a Send
resource to the world accessible as a &dyn Trait.
Resources are globally accesible by any system through
the Resources
object passed as parameter to them.
pub fn resources(&self) -> Resources<'_>
[src]
Returns a Resources
object that allows to access all the
Send
resources in the world.
pub fn entities_and_resources(&mut self) -> (Entities<'_>, Resources<'_>)
[src]
pub fn remove_resource<T>(&mut self) -> Option<T> where
T: 'static,
[src]
T: 'static,
Removes a resource of the specified type.
pub fn add_resource_thread_local<T>(&mut self, resource: T) where
T: 'static,
[src]
T: 'static,
Adds a non Send
resource to the world.
Non Send
resources are globally accesible by any SystemThreadLocal
through the ResourcesThreadLocal
object passed as parameter to them.
pub fn add_resource_as_trait_thread_local<T, U, F, FMut>(
&mut self,
resource: (T, F, FMut)
) where
T: 'static,
F: Fn(&T) -> &U + 'static,
U: 'static + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
[src]
&mut self,
resource: (T, F, FMut)
) where
T: 'static,
F: Fn(&T) -> &U + 'static,
U: 'static + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
Adds a non Send
resource to the world accessible as a &dyn Trait.
Non Send
resources are are globally accesible by any system through
the Resources
object passed as parameter to them.
pub fn resource<T>(&self) -> Option<ReadGuardRef<'_, T>> where
T: 'static,
[src]
T: 'static,
Returns a resource of the specified type if it exists for reading.
pub fn resource_as<T>(&self) -> Option<ReadGuardRef<'_, T>> where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
Returns a resource of the specified type if it exists for reading.
pub fn resource_mut<T>(&self) -> Option<WriteGuardRef<'_, T, ()>> where
T: 'static,
[src]
T: 'static,
Returns a resource of the specified type if it exists for writing.
pub fn resources_thread_local(&self) -> ResourcesThreadLocal<'_>
[src]
Returns a ResourcesThreadLocal
object that allows to access all the
resources in the world.
pub fn entities_and_resources_thread_local(
&mut self
) -> (EntitiesThreadLocal<'_>, ResourcesThreadLocal<'_>)
[src]
&mut self
) -> (EntitiesThreadLocal<'_>, ResourcesThreadLocal<'_>)
pub fn resources_creation(&mut self) -> ResourcesCreation<'_>
[src]
Returns a Resources
object that allows to access all the
Send
and non Send
resources in the world and also allows to create new resources
and delete them.
pub fn entities_and_resources_creation(
&mut self
) -> (EntitiesCreation<'_>, ResourcesCreation<'_>)
[src]
&mut self
) -> (EntitiesCreation<'_>, ResourcesCreation<'_>)
pub fn add_system<S>(&mut self, system: S) -> &mut World where
S: System + 'static,
[src]
S: System + 'static,
Adds a Send
System
that will be run in the order it was added.
Send
systems will run in parallel with other Send
systems and
with thread local systems added in between barriers.
pub fn add_system_once<S>(&mut self, system: S) -> &mut World where
S: SystemOnce + 'static,
[src]
S: SystemOnce + 'static,
Adds a Send
System
that will be run in the order it was added.
Send
systems will run in parallel with other Send
systems and
with thread local systems added in between barriers.
pub fn add_system_with_data<S, D>(&mut self, system: S, data: D) -> &mut World where
D: Send + 'static,
S: FnMut(&mut D, Entities<'_>, Resources<'_>) + Send + 'static,
[src]
D: Send + 'static,
S: FnMut(&mut D, Entities<'_>, Resources<'_>) + Send + 'static,
Adds a Send
System
that will be run in the order it was added
and data that will be passed to the system as first parameter.
Send
systems will run in parallel with other Send
systems and
with thread local systems added in between barriers.
pub fn add_system_thread_local<S>(&mut self, system: S) -> &mut World where
S: SystemThreadLocal + 'static,
[src]
S: SystemThreadLocal + 'static,
Adds a non Send
System
that will be run in the order it was added.
SystemThreadLocal will always run in the main thread but can run in parallel
with Send
systems.
pub fn add_system_once_thread_local<S>(&mut self, system: S) -> &mut World where
S: SystemOnceThreadLocal + 'static,
[src]
S: SystemOnceThreadLocal + 'static,
Adds a non Send
System
that will be run only once
SystemOnceThreadLocal will run in the main thread but can run in parallel
with Send
systems.
pub fn add_system_thread_local_with_data<S, D>(
&mut self,
system: S,
data: D
) -> &mut World where
D: 'static,
S: FnMut(&mut D, EntitiesThreadLocal<'_>, ResourcesThreadLocal<'_>) + 'static,
[src]
&mut self,
system: S,
data: D
) -> &mut World where
D: 'static,
S: FnMut(&mut D, EntitiesThreadLocal<'_>, ResourcesThreadLocal<'_>) + 'static,
Adds a non Send
System
that will be run in the order it was added
and data that will be passed to the system as first parameter.
SystemThreadLocal will always run in the main thread but can run in parallel
with Send
systems.
pub fn add_creation_system<S>(&mut self, system: S) -> &mut World where
S: CreationSystem + 'static,
[src]
S: CreationSystem + 'static,
Adds a CreationSystem
that will be run in the order it was added.
CreationSystems run alone with no other system running in parallel.
pub fn add_creation_system_once<S>(&mut self, system: S) -> &mut World where
S: CreationSystemOnce + 'static,
[src]
S: CreationSystemOnce + 'static,
Adds a CreationSystemOnce
CreationSystemsOnce run once and alone with no other system running in parallel.
pub fn add_creation_system_with_data<S, D>(
&mut self,
system: S,
data: D
) -> &mut World where
D: 'static,
S: FnMut(&mut D, EntitiesCreation<'_>, ResourcesCreation<'_>) + 'static,
[src]
&mut self,
system: S,
data: D
) -> &mut World where
D: 'static,
S: FnMut(&mut D, EntitiesCreation<'_>, ResourcesCreation<'_>) + 'static,
Adds a CreationSystem
that will be run in the order it was added
and data that will be passed to the system as first parameter.
CreationSystems run alone with no other system running in parallel.
pub fn add_system_with<S>(&mut self, system: S) -> Builder<'_, '_, S> where
S: System + 'static,
[src]
S: System + 'static,
Adds a Send
System
that will be run in the order it was added using a Builder that
allows to set some system settings like the name it’ll show up with in stats or the conditions
under it will run.
The settings set using the builder will override those that system sets itself through attributes or implementation.
Send
systems will run in parallel with other Send
systems and
with thread local systems added in between barriers.
pub fn add_system_once_with<S>(&mut self, system: S) -> BuilderOnce<'_, '_, S> where
S: SystemOnce + 'static,
[src]
S: SystemOnce + 'static,
Adds a Send
SystemOnce
that will be run only once using a Builder that
allows to set some system settings like the name it’ll show up with in stats or the conditions
under it will run.
The settings set using the builder will override those that system sets itself through attributes or implementation.
Send
systems will run in parallel with other Send
systems and
with thread local systems added in between barriers.
pub fn add_system_thread_local_with<S>(
&mut self,
system: S
) -> BuilderThreadLocal<'_, '_, S> where
S: SystemThreadLocal + 'static,
[src]
&mut self,
system: S
) -> BuilderThreadLocal<'_, '_, S> where
S: SystemThreadLocal + 'static,
Adds a thread local System
using a Builder that
allows to set some system settings like the name it’ll show up with in stats or the conditions
under it will run.
The settings set using the builder will override those that system sets itself through attributes or implementation.
SystemThreadLocal will always run in the main thread but can run in parallel
with Send
systems.
pub fn add_system_once_thread_local_with<S>(
&mut self,
system: S
) -> BuilderOnceThreadLocal<'_, '_, S> where
S: SystemOnceThreadLocal + 'static,
[src]
&mut self,
system: S
) -> BuilderOnceThreadLocal<'_, '_, S> where
S: SystemOnceThreadLocal + 'static,
Adds a thread local System
that will be run only once using a Builder that
allows to set some system settings like the name it’ll show up with in stats or the conditions
under it will run.
The settings set using the builder will override those that system sets itself through attributes or implementation.
SystemThreadLocal will always run in the main thread but can run in parallel
with Send
systems.
pub fn add_creation_system_with<S>(
&mut self,
system: S
) -> BuilderCreation<'_, '_, S> where
S: CreationSystem + 'static,
[src]
&mut self,
system: S
) -> BuilderCreation<'_, '_, S> where
S: CreationSystem + 'static,
Adds a creation System
using a Builder that
allows to set some system settings like the name it’ll show up with in stats or the conditions
under it will run.
The settings set using the builder will override those that system sets itself through attributes or implementation.
CreationSystems run alone with no other system running in parallel.
pub fn add_creation_system_once_with<S>(
&mut self,
system: S
) -> BuilderCreationOnce<'_, '_, S> where
S: CreationSystemOnce + 'static,
[src]
&mut self,
system: S
) -> BuilderCreationOnce<'_, '_, S> where
S: CreationSystemOnce + 'static,
Adds a creation System
that will be run only once using a Builder that
allows to set some system settings like the name it’ll show up with in stats or the conditions
under it will run.
The settings set using the builder will override those that system sets itself through attributes or implementation.
CreationSystems run alone with no other system running in parallel.
pub fn add_debug_system<S>(&mut self, system: S) -> &mut World where
S: SystemDebug + 'static,
[src]
S: SystemDebug + 'static,
Adds a SystemDebug
SystemDebug run alone with no other system running in parallel.
pub fn add_barrier<B>(&mut self) -> &mut World where
B: 'static + Barrier,
[src]
B: 'static + Barrier,
Delimits all the systems that will run in parallel.
Only systems between barriers (or creation and debug systems) will run in parallel with each other.
Barriers allow to create groups of systems that run in parallel
including thread local systems that run one by one in the main
thread but in parallel with Send
systems.
pub fn render_systems_dependency_graph<P>(&mut self, file: P) where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
pub fn run_once(&mut self)
[src]
Runs all the systems in the world once.
If the parallel_systems
features
are enabled the systems will al be run in the main thread sequentially
but without monitoring for parallelism conflicts.
If parallel_systems
is enabled it’ll run Send
and thread local systems
in parallel, running thread local systems always from the main thread.
Creation and Debug systems act as a barrier and run alone.
pub fn run_multi_threaded(&mut self)
[src]
Only available when the default parallel_systems
feature is enabled
it’ll run Send
and thread local systems in parallel, running thread local
systems always from the main thread. Creation and Debug systems act as a
barrier and run alone.
pub fn run_single_threaded(&mut self)
[src]
It runs all he systems in the world in the main thread sequentially
pub fn is_registered<C>(&self) -> bool where
C: Component,
[src]
C: Component,
pub fn creation_storage<C>(&mut self) -> CreationSto<'_, C> where
C: Component,
[src]
C: Component,
pub fn component_for<C>(&self, entity: &Entity) -> Option<Ptr<'_, C>> where
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
[src]
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
pub fn component_for_mut<C>(&self, entity: &Entity) -> Option<PtrMut<'_, C>> where
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
[src]
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
pub fn storage_for<'r, S>(&'r self) -> Sto<'r, S> where
S: UnorderedData<'r> + ReadOnlyOp<'r>,
[src]
S: UnorderedData<'r> + ReadOnlyOp<'r>,
pub fn storage_for_mut<'r, S>(&'r mut self) -> Sto<'r, S> where
S: UnorderedData<'r>,
[src]
S: UnorderedData<'r>,
Trait Implementations
impl<'a> CreationContextExt<'a> for World
[src]
impl<'a> CreationContextExt<'a> for World
[src]pub fn with_entities_and_resources_creation<'e, F, R>(&'e mut self, f: F) -> R where
F: FnOnce(EntitiesCreation<'e>, ResourcesCreation<'e>) -> R,
[src]
F: FnOnce(EntitiesCreation<'e>, ResourcesCreation<'e>) -> R,
impl<'a> EntitiesCreationExt<'a> for World
[src]
impl<'a> EntitiesCreationExt<'a> for World
[src]pub fn with_entities_creation<'e, F, R>(&'e mut self, f: F) -> R where
F: FnOnce(EntitiesCreation<'e>) -> R,
[src]
F: FnOnce(EntitiesCreation<'e>) -> R,
pub fn new_entity(&mut self) -> EntityBuilder<'_>
[src]
pub fn creation_storage<C>(&mut self) -> CreationSto<'_, C> where
C: Component,
[src]
C: Component,
pub fn add_component_to<'r, C>(&mut self, entity: &Entity, component: C) where
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn add_component_to_thread_local<'r, C>(
&mut self,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn add_tag_to<C>(&mut self, entity: &Entity) where
C: 'static,
[src]
C: 'static,
pub fn add_child_component_to<'r, C>(
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn add_child_component_to_thread_local<'r, C>(
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
parent: &Entity,
entity: &Entity,
component: C
) where
C: ComponentThreadLocal,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn add_slice_component_to<'r, C, I>(
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentSend,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentSend,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn add_slice_component_to_thread_local<'r, C, I>(
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentThreadLocal,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
&mut self,
entity: &Entity,
component: I
) where
C: OneToNComponentThreadLocal,
I: IntoIterator<Item = C>,
<C as Component>::Storage: for<'s> OneToNStorage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn remove_component_from<'r, C>(&mut self, entity: &Entity) where
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
[src]
C: Component,
<C as Component>::Storage: for<'s> Storage<'s, C>,
<<C as Component>::Storage as Storage<'r, C>>::Get: DebugParameter,
pub fn remove_entity(&mut self, entity: &Entity)
[src]
impl<'a> EntitiesExt<'a> for World
[src]
impl<'a> EntitiesExt<'a> for World
[src]pub fn iter_for<'e, S>(&'e self) -> <S as UnorderedData<'e>>::Iter where
S: UnorderedDataSend<'e> + ReadOnlyOp<'e>,
[src]
S: UnorderedDataSend<'e> + ReadOnlyOp<'e>,
pub fn iter_for_mut<'e, S>(&'e mut self) -> <S as UnorderedData<'e>>::IterMut where
S: UnorderedDataSend<'e>,
[src]
S: UnorderedDataSend<'e>,
pub fn ordered_iter_for<'e, S>(&'e self) -> <S as OrderedData<'e>>::Iter where
S: OrderedDataSend<'e> + ReadOnlyOrderedOp<'e>,
[src]
S: OrderedDataSend<'e> + ReadOnlyOrderedOp<'e>,
pub fn ordered_iter_for_mut<'e, S>(&'e mut self) -> <S as OrderedData<'e>>::Iter where
S: OrderedDataSend<'e>,
[src]
S: OrderedDataSend<'e>,
pub fn iter_for_entities<'e, U, E>(
&'e self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesIter where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
<U as UnorderedData<'e>>::Storage: ReadOnlyStorage,
[src]
&'e self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesIter where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
<U as UnorderedData<'e>>::Storage: ReadOnlyStorage,
pub fn iter_for_entities_mut<'e, U, E>(
&'e mut self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesIterMut where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
[src]
&'e mut self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesIterMut where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
pub fn iter_for_entities_opt<'e, U, E>(
&'e self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesOptIter where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
<U as UnorderedData<'e>>::Storage: ReadOnlyStorage,
[src]
&'e self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesOptIter where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
<U as UnorderedData<'e>>::Storage: ReadOnlyStorage,
pub fn iter_for_entities_opt_mut<'e, U, E>(
&'e mut self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesOptIterMut where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
[src]
&'e mut self,
entities: E
) -> <E as IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>>::IntoEntitiesOptIterMut where
E: IntoEntitiesIterator<'e, <U as UnorderedData<'e>>::Storage>,
U: UnorderedDataSend<'e>,
pub fn entity_components<'r, S>(
&'r self,
entity: &Entity
) -> Option<<S as UnorderedData<'r>>::ComponentsRef> where
S: UnorderedDataSend<'r> + ReadOnlyOp<'r> + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
<<S as UnorderedData<'r>>::Storage as StorageRef<'r>>::Component == <S as UnorderedData<'r>>::ComponentsRef,
[src]
&'r self,
entity: &Entity
) -> Option<<S as UnorderedData<'r>>::ComponentsRef> where
S: UnorderedDataSend<'r> + ReadOnlyOp<'r> + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
<<S as UnorderedData<'r>>::Storage as StorageRef<'r>>::Component == <S as UnorderedData<'r>>::ComponentsRef,
pub fn entity_components_mut<'r, S>(
&'r mut self,
entity: &Entity
) -> Option<<S as UnorderedData<'r>>::ComponentsRef> where
S: UnorderedDataSend<'r> + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
<<S as UnorderedData<'r>>::Storage as StorageRef<'r>>::Component == <S as UnorderedData<'r>>::ComponentsRef,
[src]
&'r mut self,
entity: &Entity
) -> Option<<S as UnorderedData<'r>>::ComponentsRef> where
S: UnorderedDataSend<'r> + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
<<S as UnorderedData<'r>>::Storage as StorageRef<'r>>::Component == <S as UnorderedData<'r>>::ComponentsRef,
pub fn component_for<C>(&self, entity: &Entity) -> Option<Ptr<'_, C>> where
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
pub fn component_for_mut<C>(&self, entity: &Entity) -> Option<PtrMut<'_, C>> where
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'s> Storage<'s, C>,
pub fn has_component<C>(&self, entity: &Entity) -> bool where
C: 'static,
[src]
C: 'static,
pub fn tree_node_for<C>(&self, entity: &Entity) -> Option<NodePtr<'_, C>> where
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
pub fn tree_node_for_mut<C>(&self, entity: &Entity) -> Option<NodePtrMut<'_, C>> where
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
[src]
C: ComponentSend,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
pub fn changed_iter_for<'r, S>(
&'r self
) -> EntitiesComponentIter<'r, <S as ChangedData<'r>>::ChangedIter, <S as UnorderedData<'r>>::Storage> where
S: ChangedDataSend<'r> + EntitiesData + ReadOnlyOp<'r> + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
[src]
&'r self
) -> EntitiesComponentIter<'r, <S as ChangedData<'r>>::ChangedIter, <S as UnorderedData<'r>>::Storage> where
S: ChangedDataSend<'r> + EntitiesData + ReadOnlyOp<'r> + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
pub fn changed_iter_for_mut<'r, S>(
&'r mut self
) -> EntitiesComponentIter<'r, <S as ChangedData<'r>>::ChangedIter, <S as UnorderedData<'r>>::Storage> where
S: ChangedDataSend<'r> + EntitiesData + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
[src]
&'r mut self
) -> EntitiesComponentIter<'r, <S as ChangedData<'r>>::ChangedIter, <S as UnorderedData<'r>>::Storage> where
S: ChangedDataSend<'r> + EntitiesData + 'r,
<S as UnorderedData<'r>>::Storage: StorageRef<'r>,
pub fn storage_for<'r, S>(&'r self) -> Sto<'r, S> where
S: UnorderedDataSend<'r> + ReadOnlyOp<'r>,
[src]
S: UnorderedDataSend<'r> + ReadOnlyOp<'r>,
pub fn storage_for_mut<'r, S>(&'r mut self) -> Sto<'r, S> where
S: UnorderedDataSend<'r>,
[src]
S: UnorderedDataSend<'r>,
impl EntitiesStorage for World
[src]
impl EntitiesStorage for World
[src]pub fn storage<C>(&self) -> Option<ReadGuardRef<'_, <C as Component>::Storage>> where
C: Component,
[src]
C: Component,
pub fn storage_mut<C>(
&self
) -> Option<WriteGuardRef<'_, <C as Component>::Storage, <C as Component>::MutStorageCacheGuard>> where
C: Component,
[src]
&self
) -> Option<WriteGuardRef<'_, <C as Component>::Storage, <C as Component>::MutStorageCacheGuard>> where
C: Component,
pub fn entities_ref(&self) -> &[(Entity, U256)]ⓘ
[src]
pub fn component_mask<C>(&self) -> U256 where
C: 'static,
[src]
C: 'static,
pub fn entities_for_mask<S>(
&self,
query_mask: Bitmask,
storage: &S
) -> IndexGuard<'_> where
S: FastIndexExt,
[src]
&self,
query_mask: Bitmask,
storage: &S
) -> IndexGuard<'_> where
S: FastIndexExt,
pub fn lazy_entities_for_mask(&self, query_mask: Bitmask) -> LazyIndexGuard<'_>
[src]
pub fn ordered_entities_for<C, S>(
&self,
query_mask: Bitmask,
unordered_storage: &S
) -> OrderedIndexGuard<'_> where
C: Component,
S: FastIndexExt,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
[src]
&self,
query_mask: Bitmask,
unordered_storage: &S
) -> OrderedIndexGuard<'_> where
C: Component,
S: FastIndexExt,
<C as Component>::Storage: for<'b> HierarchicalStorage<'b, C>,
impl ResourcesCreationExt for World
[src]
impl ResourcesCreationExt for World
[src]pub fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R,
[src]
F: FnOnce(ResourcesCreation<'_>) -> R,
pub fn add_resource<T>(&mut self, resource: T) where
T: 'static + Send,
[src]
T: 'static + Send,
pub fn remove_resource<T>(&mut self) -> Option<T> where
T: 'static,
[src]
T: 'static,
pub fn add_resource_thread_local<T>(&mut self, resource: T) where
T: 'static,
[src]
T: 'static,
pub fn add_resource_as_trait<T, U, F, FMut>(&mut self, resource: (T, F, FMut)) where
T: 'static + Send,
F: Fn(&T) -> &U + 'static,
U: 'static + Send + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
[src]
T: 'static + Send,
F: Fn(&T) -> &U + 'static,
U: 'static + Send + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
pub fn add_resource_as_trait_thread_local<T, U, F, FMut>(
&mut self,
resource: (T, F, FMut)
) where
T: 'static,
F: Fn(&T) -> &U + 'static,
U: 'static + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
[src]
&mut self,
resource: (T, F, FMut)
) where
T: 'static,
F: Fn(&T) -> &U + 'static,
U: 'static + ?Sized,
FMut: Fn(&mut T) -> &mut U + 'static,
impl ResourcesExt for World
[src]
impl ResourcesExt for World
[src]pub fn resource<T>(&self) -> Option<ReadGuardRef<'_, T>> where
T: 'static + Send,
[src]
T: 'static + Send,
pub fn resource_mut<T>(&self) -> Option<WriteGuardRef<'_, T, ()>> where
T: 'static + Send,
[src]
T: 'static + Send,
pub fn resource_as_trait<T>(&self) -> Option<ReadGuardRef<'_, T>> where
T: 'static + Send + ?Sized,
[src]
T: 'static + Send + ?Sized,
pub fn resource_as_trait_mut<T>(&self) -> Option<WriteGuardRef<'_, T, ()>> where
T: 'static + Send + ?Sized,
[src]
T: 'static + Send + ?Sized,
impl ResourcesThreadLocalExt for World
[src]
impl ResourcesThreadLocalExt for World
[src]pub fn resource_thread_local<T>(&self) -> Option<ReadGuardRef<'_, T>> where
T: 'static,
[src]
T: 'static,
pub fn resource_thread_local_mut<T>(&self) -> Option<WriteGuardRef<'_, T, ()>> where
T: 'static,
[src]
T: 'static,
pub fn resource_as_trait_thread_local<T>(&self) -> Option<ReadGuardRef<'_, T>> where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
pub fn resource_as_trait_thread_local_mut<T>(
&self
) -> Option<WriteGuardRef<'_, T, ()>> where
T: 'static + ?Sized,
[src]
&self
) -> Option<WriteGuardRef<'_, T, ()>> where
T: 'static + ?Sized,
Auto Trait Implementations
impl !RefUnwindSafe for World
impl !Send for World
impl !Sync for World
impl Unpin for World
impl !UnwindSafe for World
Blanket Implementations
impl<'a, C> CreationContext<'a> for C where
C: CreationContextExt<'a> + EntitiesExt<'a> + ResourcesExt + ResourcesThreadLocalExt,
[src]
impl<'a, C> CreationContext<'a> for C where
C: CreationContextExt<'a> + EntitiesExt<'a> + ResourcesExt + ResourcesThreadLocalExt,
[src]pub fn add<'e, B>(&'e mut self, settings: <B as Builder<'e>>::Settings) -> B where
B: Builder<'e>,
[src]
B: Builder<'e>,
pub fn add_model(&mut self, name: &str) -> ModelBuilder<'_>
[src]
pub fn add_child_model(
&mut self,
name: &str,
parent: Entity
) -> ModelBuilder<'_>
[src]
&mut self,
name: &str,
parent: Entity
) -> ModelBuilder<'_>
pub fn add_empty(&mut self, name: &str) -> EmptyBuilder<'_>
[src]
pub fn add_child_empty(
&mut self,
name: &str,
parent: Entity
) -> EmptyBuilder<'_>
[src]
&mut self,
name: &str,
parent: Entity
) -> EmptyBuilder<'_>
pub fn register_mesh<T>(&mut self, geom: Mesh<T>) -> GeometryRef where
T: 'static + VertexFormat + Send + Clone + Copy + Debug,
[src]
T: 'static + VertexFormat + Send + Clone + Copy + Debug,
pub fn register_named_mesh<T>(
&mut self,
geom: Mesh<T>,
name: &str
) -> GeometryRef where
T: 'static + VertexFormat + Send + Clone + Copy + Debug,
[src]
&mut self,
geom: Mesh<T>,
name: &str
) -> GeometryRef where
T: 'static + VertexFormat + Send + Clone + Copy + Debug,
pub fn add_ambient_light(
&mut self,
diffuse: Rgb<f32, LinearRgb>,
specular: Rgb<f32, LinearRgb>
) -> Entity
[src]
&mut self,
diffuse: Rgb<f32, LinearRgb>,
specular: Rgb<f32, LinearRgb>
) -> Entity
pub fn add_directional_light(
&'e mut self,
name: &'e str
) -> DirectionalLightBuilder<'e, C>
[src]
&'e mut self,
name: &'e str
) -> DirectionalLightBuilder<'e, C>
pub fn add_area_light(&'e mut self, name: &'e str) -> AreaLightBuilder<'e, C>
[src]
pub fn add_spot_light(&'e mut self, name: &'e str) -> SpotLightBuilder<'e, C>
[src]
pub fn add_point_light(&'e mut self, name: &'e str) -> PointLightBuilder<'e, C>
[src]
pub fn update_all_transformations(&mut self)
[src]
pub fn add_image_based_light(
&'e mut self,
name: &'e str
) -> ImageBasedLightBuilder<'e, C>
[src]
&'e mut self,
name: &'e str
) -> ImageBasedLightBuilder<'e, C>
pub fn register_material<M>(&mut self, name: &str, material: M) -> MaterialRef where
M: 'static + FullMaterial,
[src]
M: 'static + FullMaterial,
pub fn register_shadow_material<M>(
&mut self,
name: &str,
material: M
) -> ShadowMaterialRef where
M: 'static + FullMaterial,
[src]
&mut self,
name: &str,
material: M
) -> ShadowMaterialRef where
M: 'static + FullMaterial,
pub fn find_material(&self, name: &str) -> Option<MaterialRef>
[src]
pub fn register_texture(&mut self, texture: Texture) -> TextureRef
[src]
pub fn register_texture_from_data_format<T>(
&mut self,
format: LoadDataFormat,
creation_flags: TextureCreationFlags,
data: &[T]
) -> Result<TextureRef, Error> where
T: 'static,
[src]
&mut self,
format: LoadDataFormat,
creation_flags: TextureCreationFlags,
data: &[T]
) -> Result<TextureRef, Error> where
T: 'static,
pub fn register_image<I>(
&mut self,
img: &I,
creation_flags: TextureCreationFlags
) -> Result<TextureRef, Error> where
I: Image + Clone,
[src]
&mut self,
img: &I,
creation_flags: TextureCreationFlags
) -> Result<TextureRef, Error> where
I: Image + Clone,
pub fn register_named_texture_from_data_format<T>(
&mut self,
name: &str,
format: LoadDataFormat,
creation_flags: TextureCreationFlags,
data: &[T]
) -> Result<TextureRef, Error> where
T: 'static,
[src]
&mut self,
name: &str,
format: LoadDataFormat,
creation_flags: TextureCreationFlags,
data: &[T]
) -> Result<TextureRef, Error> where
T: 'static,
pub fn register_named_image<I>(
&mut self,
name: &str,
img: &I,
creation_flags: TextureCreationFlags
) -> Result<TextureRef, Error> where
I: Image + Clone,
[src]
&mut self,
name: &str,
img: &I,
creation_flags: TextureCreationFlags
) -> Result<TextureRef, Error> where
I: Image + Clone,
pub fn register_sampler(&mut self, sampler: Sampler) -> SamplerRef
[src]
pub fn register_named_sampler(
&mut self,
name: &str,
sampler: Sampler
) -> SamplerRef
[src]
&mut self,
name: &str,
sampler: Sampler
) -> SamplerRef
pub fn register_cubemap(&mut self, cubemap: CubeMap) -> CubemapRef
[src]
pub fn register_named_cubemap(
&mut self,
name: &str,
cubemap: CubeMap
) -> CubemapRef
[src]
&mut self,
name: &str,
cubemap: CubeMap
) -> CubemapRef
pub fn find_named_texture(&self, name: &str) -> Option<TextureRef>
[src]
pub fn find_named_cubemap(&self, name: &str) -> Option<CubemapRef>
[src]
pub fn find_named_sampler(&self, name: &str) -> Option<SamplerRef>
[src]
pub fn load_image<P>(
&mut self,
path: P,
flags: TextureCreationFlags
) -> Result<TextureRef, Error> where
P: AsRef<Path>,
[src]
&mut self,
path: P,
flags: TextureCreationFlags
) -> Result<TextureRef, Error> where
P: AsRef<Path>,
pub fn load_cubemap<P>(
&mut self,
path: P,
flags: TextureCreationFlags
) -> Result<CubemapRef, Error> where
P: AsRef<Path>,
[src]
&mut self,
path: P,
flags: TextureCreationFlags
) -> Result<CubemapRef, Error> where
P: AsRef<Path>,
pub fn load_equirectangular_cubemap<P>(
&mut self,
path: P,
flags: TextureCreationFlags,
color_format: ColorFormat
) -> Result<CubemapRef, Error> where
P: AsRef<Path>,
[src]
&mut self,
path: P,
flags: TextureCreationFlags,
color_format: ColorFormat
) -> Result<CubemapRef, Error> where
P: AsRef<Path>,
pub fn load_equirectangular_levels_cubemap<P>(
&mut self,
paths: &[P],
flags: TextureCreationFlags,
color_format: ColorFormat
) -> Result<CubemapRef, Error> where
P: AsRef<Path>,
[src]
&mut self,
paths: &[P],
flags: TextureCreationFlags,
color_format: ColorFormat
) -> Result<CubemapRef, Error> where
P: AsRef<Path>,
pub fn register_vertex_type<T>(&mut self) where
T: 'static + VertexFormat + Send + Clone + Copy + Debug,
[src]
T: 'static + VertexFormat + Send + Clone + Copy + Debug,
impl<'a, C> PathFollowerBuilderExt<C> for C where
C: CreationContext<'a>,
[src]
impl<'a, C> PathFollowerBuilderExt<C> for C where
C: CreationContext<'a>,
[src]pub fn add_path_follower(
&mut self,
entity: &Entity
) -> PathFollowerBuilder<'_, C>
[src]
&mut self,
entity: &Entity
) -> PathFollowerBuilder<'_, C>
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]