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]

Loading content...

Provided methods

pub fn add_resource<T>(&mut self, resource: T) where
    T: 'static + Send
[src]

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]

Removes a resource of the specified type.

pub fn add_resource_thread_local<T>(&mut self, resource: T) where
    T: 'static, 
[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.

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]

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]

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.

Loading content...

Implementors

impl ResourcesCreationExt for Scene[src]

impl ResourcesCreationExt for World[src]

impl<'a> ResourcesCreationExt for CreationStorages<'a>[src]

impl<'a> ResourcesCreationExt for CreationProxy<'a>[src]

impl<'a> ResourcesCreationExt for ResourcesCreation<'a>[src]

Loading content...