pub fn add<T: Any + Clone>(&mut self, val: T) {
        let type_id = TypeId::of::<T>();
        let mut map = self.map.borrow_mut();
        map.insert(type_id, Box::new(val));
    }
/// Adds a new element to the state by its type. Any existing element with the same type will be silently overriden (use `.contains()` to check first if needed).
Adds a new element to the state by its type. Any existing element with the same type will be silently overriden (use `.contains()` to check first if needed).
Adds a new element to the state by its type . Any existing element with the same type will be silently overriden ( use ` . contains () ` to check first if needed ) .
pub fn add<T: Any + Clone>(&mut self, val: T) {
        let type_id = TypeId::of::<T>();
        let mut map = self.map.borrow_mut();
        map.insert(type_id, Box::new(val));
    }
pub fn add < T : Any + Clone > ( & mut self , val : T ) { let type_id = TypeId :: of :: < T > ( ) ; let mut map = self . map . borrow_mut ( ) ; map . insert ( type_id , Box :: new ( val ) ) ; }
Adds a new element to the state by its type.
Adds a new element to the state by its type .
&mut self
val
T
&mut self
val
T