Struct 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§

Source§

impl<E, Ctx> SystemStore<E, Ctx>
where E: EntityStore,

Source

pub fn new() -> Self

Creates a new system store with default values.

Source

pub fn register_init_system(&mut self, init_system: impl System<E, Ctx>)

Registers the init system.

Source

pub fn register_cleanup_system(&mut self, cleanup_system: impl System<E, Ctx>)

Registers the cleanup system.

Source

pub fn register_system(&mut self, system: impl System<E, Ctx>, system_id: u32)

Registers a new system.

Source

pub fn remove_system(&mut self, system_id: u32)

Removes a system from the storage.

Source

pub fn register_priority(&mut self, priority: Priority, system_id: u32)

Register a priority for the system with the given system_id.

Source

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.

Source

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.

Source

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§

Source§

impl<E, Ctx: Default> Default for SystemStore<E, Ctx>
where E: EntityStore + Default,

Source§

fn default() -> SystemStore<E, Ctx>

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

Auto Trait Implementations§

§

impl<E, Ctx> Freeze for SystemStore<E, Ctx>

§

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§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<E> Component for E
where E: Any,