Trait specs::UnprotectedStorage [] [src]

pub trait UnprotectedStorage<T>: Sized {
    fn new() -> Self;
unsafe fn clean<F>(&mut self, f: F)
    where
        F: Fn(Index) -> bool
;
unsafe fn get(&self, id: Index) -> &T;
unsafe fn get_mut(&mut self, id: Index) -> &mut T;
unsafe fn insert(&mut self, id: Index, value: T);
unsafe fn remove(&mut self, id: Index) -> T; }

Used by the framework to quickly join components.

Required Methods

Creates a new Storage<T>. This is called when you register a new component type within the world.

Clean the storage given a check to figure out if an index is valid or not. Allows us to safely drop the storage.

Tries reading the data associated with an Index. This is unsafe because the external set used to protect this storage is absent.

Tries mutating the data associated with an Index. This is unsafe because the external set used to protect this storage is absent.

Inserts new data for a given Index.

Removes the data associated with an Index.

Implementors