Trait rin::ecs::ResourcesCreationExt [−][src]
pub trait ResourcesCreationExt { pub fn with_resources_creation<F, R>(&mut self, f: F) -> R
where
F: FnOnce(ResourcesCreation<'_>) -> R; pub fn add_resource<T>(&mut self, resource: T)
where
T: 'static + Send, { ... } pub fn remove_resource<T>(&mut self) -> Option<T>
where
T: 'static, { ... } pub fn add_resource_thread_local<T>(&mut self, resource: T)
where
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, { ... } 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, { ... } }
Required methods
pub fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R,
[src]
F: FnOnce(ResourcesCreation<'_>) -> R,
Provided methods
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 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<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 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.
Resources are globally accesible by any system through
the Resources
object passed as parameter to them.
Implementors
impl ResourcesCreationExt for Scene
[src]
impl ResourcesCreationExt for Scene
[src]pub fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R,
[src]
F: FnOnce(ResourcesCreation<'_>) -> R,
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,
impl<'a> ResourcesCreationExt for CreationStorages<'a>
[src]
impl<'a> ResourcesCreationExt for CreationStorages<'a>
[src]pub fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R,
[src]
F: FnOnce(ResourcesCreation<'_>) -> R,
impl<'a> ResourcesCreationExt for CreationProxy<'a>
[src]
impl<'a> ResourcesCreationExt for CreationProxy<'a>
[src]pub fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R,
[src]
F: FnOnce(ResourcesCreation<'_>) -> R,
impl<'a> ResourcesCreationExt for ResourcesCreation<'a>
[src]
impl<'a> ResourcesCreationExt for ResourcesCreation<'a>
[src]pub fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R,
[src]
F: FnOnce(ResourcesCreation<'_>) -> R,