Struct dces::system::SystemStore
source · [−]pub struct SystemStore<E, Ctx> where
E: EntityStore, {
pub priorities: BTreeMap<i32, Vec<u32>>,
/* private fields */
}
Expand description
The SystemStore represents the main system storage.
Fields
priorities: BTreeMap<i32, Vec<u32>>
Priorities of the systems.
Implementations
sourceimpl<E, Ctx> SystemStore<E, Ctx> where
E: EntityStore,
impl<E, Ctx> SystemStore<E, Ctx> where
E: EntityStore,
sourcepub fn register_init_system(&mut self, init_system: impl System<E, Ctx>)
pub fn register_init_system(&mut self, init_system: impl System<E, Ctx>)
Registers the init system.
sourcepub fn register_cleanup_system(&mut self, cleanup_system: impl System<E, Ctx>)
pub fn register_cleanup_system(&mut self, cleanup_system: impl System<E, Ctx>)
Registers the cleanup system.
sourcepub fn register_system(&mut self, system: impl System<E, Ctx>, system_id: u32)
pub fn register_system(&mut self, system: impl System<E, Ctx>, system_id: u32)
Registers a new system
.
sourcepub fn remove_system(&mut self, system_id: u32)
pub fn remove_system(&mut self, system_id: u32)
Removes a system from the storage.
sourcepub fn register_priority(&mut self, priority: Priority, system_id: u32)
pub fn register_priority(&mut self, priority: Priority, system_id: u32)
Register a priority
for the system with the given system_id
.
sourcepub fn borrow_entity_system(
&self,
entity_system_id: u32
) -> Result<&EntitySystem<E, Ctx>, NotFound>
pub fn borrow_entity_system(
&self,
entity_system_id: u32
) -> Result<&EntitySystem<E, Ctx>, NotFound>
Returns a reference of a entity system. If the entity system does not exists NotFound
will be returned.
sourcepub fn borrow_init_system(&self) -> &Option<EntitySystem<E, Ctx>>
pub fn borrow_init_system(&self) -> &Option<EntitySystem<E, Ctx>>
Returns a reference of the init entity system. If the init entity system does not exists None
will be returned.
sourcepub fn borrow_cleanup_system(&self) -> &Option<EntitySystem<E, Ctx>>
pub fn borrow_cleanup_system(&self) -> &Option<EntitySystem<E, Ctx>>
Returns a reference of the cleanup entity system. If the init entity system does not exists None
will be returned.
Trait Implementations
sourceimpl<E: Default, Ctx: Default> Default for SystemStore<E, Ctx> where
E: EntityStore,
impl<E: Default, Ctx: Default> Default for SystemStore<E, Ctx> where
E: EntityStore,
sourcefn default() -> SystemStore<E, Ctx>
fn default() -> SystemStore<E, Ctx>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<E, Ctx> !RefUnwindSafe for SystemStore<E, Ctx>
impl<E, Ctx> !Send for SystemStore<E, Ctx>
impl<E, Ctx> !Sync for SystemStore<E, Ctx>
impl<E, Ctx> Unpin for SystemStore<E, Ctx>
impl<E, Ctx> !UnwindSafe for SystemStore<E, Ctx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more