pub struct EcsExt<'ecs> { /* private fields */ }Expand description
Extended Ecs with additional methods.
Implementations§
Trait Implementations§
Source§impl EcsEntry for EcsExt<'_>
impl EcsEntry for EcsExt<'_>
Source§fn add_system<T, Sys>(
&mut self,
desc: T,
) -> WithResult<&mut Self, SystemId, EcsError<SystemDesc<Sys>>>
fn add_system<T, Sys>( &mut self, desc: T, ) -> WithResult<&mut Self, SystemId, EcsError<SystemDesc<Sys>>>
Adds the given system. Read more
Source§fn add_once_system<T, Req, F>(
&mut self,
sys: T,
) -> WithResult<&mut Self, SystemId, EcsError<SystemDesc<FnOnceSystem<Req, F>>>>
fn add_once_system<T, Req, F>( &mut self, sys: T, ) -> WithResult<&mut Self, SystemId, EcsError<SystemDesc<FnOnceSystem<Req, F>>>>
Source§fn unregister_system(
&mut self,
sid: SystemId,
) -> WithResult<&mut Self, (), EcsError>
fn unregister_system( &mut self, sid: SystemId, ) -> WithResult<&mut Self, (), EcsError>
Unregisters an inactive system for the given system id. Read more
Source§fn activate_system(
&mut self,
target: SystemId,
at: InsertPos,
live: Tick,
) -> WithResult<&mut Self, (), EcsError>
fn activate_system( &mut self, target: SystemId, at: InsertPos, live: Tick, ) -> WithResult<&mut Self, (), EcsError>
Activates a system for the given system id if it’s not active. Read more
Source§fn inactivate_system(
&mut self,
sid: SystemId,
) -> WithResult<&mut Self, (), EcsError>
fn inactivate_system( &mut self, sid: SystemId, ) -> WithResult<&mut Self, (), EcsError>
Inactivates a system for the given system id. Read more
Source§fn register_entity(
&mut self,
desc: EntityReg,
) -> WithResult<&mut Self, EntityIndex, EcsError>
fn register_entity( &mut self, desc: EntityReg, ) -> WithResult<&mut Self, EntityIndex, EcsError>
Registers an entity type from the given descriptor. Read more
Source§fn unregister_entity<C>(
&mut self,
) -> WithResult<&mut Self, Box<dyn ContainEntity>, EcsError>where
C: Components,
fn unregister_entity<C>(
&mut self,
) -> WithResult<&mut Self, Box<dyn ContainEntity>, EcsError>where
C: Components,
Unregisters an entity type. Read more
Source§fn add_entity<E>(
&mut self,
ei: EntityIndex,
value: E,
) -> WithResult<&mut Self, EntityId, EcsError<E>>where
E: Entity,
fn add_entity<E>(
&mut self,
ei: EntityIndex,
value: E,
) -> WithResult<&mut Self, EntityId, EcsError<E>>where
E: Entity,
Adds an entity. Read more
Source§fn remove_entity(
&mut self,
eid: EntityId,
) -> WithResult<&mut Self, (), EcsError>
fn remove_entity( &mut self, eid: EntityId, ) -> WithResult<&mut Self, (), EcsError>
Removes an entity. Read more
Source§fn add_resource<T>(
&mut self,
desc: T,
) -> WithResult<&mut Self, ResourceIndex, EcsError<ResourceDesc>>where
T: Into<ResourceDesc>,
fn add_resource<T>(
&mut self,
desc: T,
) -> WithResult<&mut Self, ResourceIndex, EcsError<ResourceDesc>>where
T: Into<ResourceDesc>,
Adds the given resource. Read more
Source§fn remove_resource<R>(&mut self) -> WithResult<&mut Self, Option<R>, EcsError>where
R: Resource,
fn remove_resource<R>(&mut self) -> WithResult<&mut Self, Option<R>, EcsError>where
R: Resource,
Removes a resource from the given resource type. Read more
Source§fn get_resource<R>(&self) -> Option<&R>where
R: Resource,
fn get_resource<R>(&self) -> Option<&R>where
R: Resource,
Retrieves shared reference to a resource for the given resource type. Read more
Source§fn get_resource_mut<R>(&mut self) -> Option<&mut R>where
R: Resource,
fn get_resource_mut<R>(&mut self) -> Option<&mut R>where
R: Resource,
Retrieves mutable reference to a resource for the given resource type. Read more
Source§fn get_resource_index<R>(&self) -> Option<ResourceIndex>where
R: Resource,
fn get_resource_index<R>(&self) -> Option<ResourceIndex>where
R: Resource,
Returns resource index for the given resource type. Read more
Source§fn execute_commands<T>(
&mut self,
cmds: T,
) -> WithResult<&mut Self, (), Box<dyn Error + Send + Sync + 'static>>where
T: HelpExecuteManyCommands,
fn execute_commands<T>(
&mut self,
cmds: T,
) -> WithResult<&mut Self, (), Box<dyn Error + Send + Sync + 'static>>where
T: HelpExecuteManyCommands,
Executes the given commands in order. Read more
Source§fn execute_command<F, R>(
&mut self,
f: F,
) -> WithResult<&mut Self, (), Box<dyn Error + Send + Sync + 'static>>
fn execute_command<F, R>( &mut self, f: F, ) -> WithResult<&mut Self, (), Box<dyn Error + Send + Sync + 'static>>
Execute the given command. Read more
Source§fn errors(&mut self) -> Vec<Box<dyn Error + Send + Sync + 'static>>
fn errors(&mut self) -> Vec<Box<dyn Error + Send + Sync + 'static>>
Returns errors generated from commands or futures. Read more
Source§fn add_systems<T, Systems>(
&mut self,
descs: T,
) -> WithResult<&mut Self, (), EcsError>where
T: HelpAddManySystems<Systems>,
fn add_systems<T, Systems>(
&mut self,
descs: T,
) -> WithResult<&mut Self, (), EcsError>where
T: HelpAddManySystems<Systems>,
Adds the given systems. Read more
Source§fn add_once_systems<T, Once>(
&mut self,
descs: T,
) -> WithResult<&mut Self, (), EcsError>where
T: HelpAddManyOnce<Once>,
fn add_once_systems<T, Once>(
&mut self,
descs: T,
) -> WithResult<&mut Self, (), EcsError>where
T: HelpAddManyOnce<Once>,
Source§fn register_entity_of<T>(
&mut self,
) -> WithResult<&mut Self, EntityIndex, EcsError>where
T: AsEntityReg,
fn register_entity_of<T>(
&mut self,
) -> WithResult<&mut Self, EntityIndex, EcsError>where
T: AsEntityReg,
Registers an entity type. Read more
Source§fn add_resources<T>(&mut self, descs: T) -> WithResult<&mut Self, (), EcsError>where
T: HelpAddManyResources,
fn add_resources<T>(&mut self, descs: T) -> WithResult<&mut Self, (), EcsError>where
T: HelpAddManyResources,
Adds the given resources. Read more
Auto Trait Implementations§
impl<'ecs> Freeze for EcsExt<'ecs>
impl<'ecs> RefUnwindSafe for EcsExt<'ecs>
impl<'ecs> !Send for EcsExt<'ecs>
impl<'ecs> !Sync for EcsExt<'ecs>
impl<'ecs> Unpin for EcsExt<'ecs>
impl<'ecs> !UnwindSafe for EcsExt<'ecs>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more