Trait rinecs::ResourcesCreationExt [−][src]
pub trait ResourcesCreationExt {
fn with_resources_creation<F, R>(&mut self, f: F) -> R
where
F: FnOnce(ResourcesCreation<'_>) -> R;
fn add_resource<T: 'static + Send>(&mut self, resource: T) { ... }
fn remove_resource<T: 'static>(&mut self) -> Option<T> { ... }
fn add_resource_thread_local<T: 'static>(&mut self, resource: T) { ... }
fn add_resource_as_trait<T, U: ?Sized, F, FMut>(
&mut self,
resource: (T, F, FMut)
)
where
T: 'static + Send,
U: 'static + Send,
F: Fn(&T) -> &U + 'static,
FMut: Fn(&mut T) -> &mut U + 'static,
{ ... }
fn add_resource_as_trait_thread_local<T, U: ?Sized, F, FMut>(
&mut self,
resource: (T, F, FMut)
)
where
T: 'static,
U: 'static,
F: Fn(&T) -> &U + 'static,
FMut: Fn(&mut T) -> &mut U + 'static,
{ ... }
}Required methods
fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R, [src]
F: FnOnce(ResourcesCreation<'_>) -> R,
Provided methods
fn add_resource<T: 'static + Send>(&mut self, resource: T)[src]
Adds a Send resource to the world.
Resources are globally accesible by any system through
the Resources object passed as parameter to them.
fn remove_resource<T: 'static>(&mut self) -> Option<T>[src]
Removes a resource of the specified type.
fn add_resource_thread_local<T: 'static>(&mut self, resource: T)[src]
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.
fn add_resource_as_trait<T, U: ?Sized, F, FMut>(
&mut self,
resource: (T, F, FMut)
) where
T: 'static + Send,
U: 'static + Send,
F: Fn(&T) -> &U + 'static,
FMut: Fn(&mut T) -> &mut U + 'static, [src]
&mut self,
resource: (T, F, FMut)
) where
T: 'static + Send,
U: 'static + Send,
F: Fn(&T) -> &U + 'static,
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.
fn add_resource_as_trait_thread_local<T, U: ?Sized, F, FMut>(
&mut self,
resource: (T, F, FMut)
) where
T: 'static,
U: 'static,
F: Fn(&T) -> &U + 'static,
FMut: Fn(&mut T) -> &mut U + 'static, [src]
&mut self,
resource: (T, F, FMut)
) where
T: 'static,
U: 'static,
F: Fn(&T) -> &U + 'static,
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 World[src]
impl ResourcesCreationExt for World[src]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]fn with_resources_creation<F, R>(&mut self, f: F) -> R where
F: FnOnce(ResourcesCreation<'_>) -> R, [src]
F: FnOnce(ResourcesCreation<'_>) -> R,