pub fn insert<R>(&mut self, r: R)
    where
        R: Resource,
    {
        self.resources
            .insert(ResourceId::new::<R>(), TrustCell::new(Box::new(r)));
    }
/// Inserts a resource into this container. If the resource existed before, it will be
/// overwritten.
///
/// # Examples
///
/// Every type satisfying `Any + Debug + Send + Sync` automatically implements `Resource`,
/// thus can be added:
///
/// ```rust
/// # #![allow(dead_code)]
/// #[derive(Debug)]
/// struct MyRes(i32);
/// ```
///
/// When you have a resource, simply insert it like this:
///
/// ```rust
/// # #[derive(Debug)] struct MyRes(i32);
/// use shred::Resources;
///
/// let mut res = Resources::new();
/// res.insert(MyRes(5));
/// ```
Inserts a resource into this container. If the resource existed before, it will be
overwritten.
Inserts a resource into this container . If the resource existed before it will be overwritten .
pub fn insert<R>(&mut self, r: R)
    where
        R: Resource,
    {
        self.resources
            .insert(ResourceId::new::<R>(), TrustCell::new(Box::new(r)));
    }
pub fn insert < R > ( & mut self , r : R ) where R : Resource , { self . resources . insert ( ResourceId :: new :: < R > ( ) , TrustCell :: new ( Box :: new ( r ) ) ) ; }
Inserts a resource into this container.
Inserts a resource into this container .
&mut self
r
R
&mut self
r
R
examples
Every type satisfying `Any + Debug + Send + Sync` automatically implements `Resource`,
thus can be added.


Every type satisfying ` Any + Debug + Send + Sync ` automatically implements ` Resource ` thus can be added .
#![allow(dead_code)]
None
[derive(debug)]


When you have a resource, simply insert it like this.


When you have a resource simply insert it like this .
#[derive(debug)] struct myres(i32);
use shred::Resources.

let mut res = Resources::new();
res.insert(MyRes(5));
```
use shred :: Resources . let mut res = Resources :: new () ; res . insert ( MyRes ( 5 )) ; ` ` `