pub trait UnprotectedStorage<T>: TryDefault {
// Required methods
unsafe fn clean<B>(&mut self, has: B)
where B: BitSetLike;
unsafe fn get(&self, id: u32) -> &T;
unsafe fn get_mut(&mut self, id: u32) -> &mut T;
unsafe fn insert(&mut self, id: u32, value: T);
unsafe fn remove(&mut self, id: u32) -> T;
// Provided method
unsafe fn drop(&mut self, id: u32) { ... }
}Expand description
Used by the framework to quickly join components.
Required Methods§
Sourceunsafe fn clean<B>(&mut self, has: B)where
B: BitSetLike,
unsafe fn clean<B>(&mut self, has: B)where
B: BitSetLike,
Clean the storage given a bitset with bits set for valid indices. Allows us to safely drop the storage.
Sourceunsafe fn get(&self, id: u32) -> &T
unsafe fn get(&self, id: u32) -> &T
Tries reading the data associated with an Index.
This is unsafe because the external set used
to protect this storage is absent.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.