pub struct ResourceRegistry<T, HandleType> { /* private fields */ }
Expand description
Registry that stores values in an IndexMap.
Used by many managers without special requirements.
Implementations§
Source§impl<T, HandleType> ResourceRegistry<T, HandleType>
impl<T, HandleType> ResourceRegistry<T, HandleType>
pub fn new() -> Self
pub fn insert(&mut self, handle: &ResourceHandle<HandleType>, data: T)
pub fn remove_all_dead(&mut self, func: impl FnMut(&mut Self, usize, T))
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&usize, &T)> + Clone
pub fn values(&self) -> impl ExactSizeIterator<Item = &T> + Clone
pub fn values_mut(&mut self) -> impl ExactSizeIterator<Item = &mut T>
pub fn get(&self, handle: RawResourceHandle<HandleType>) -> &T
pub fn get_mut(&mut self, handle: RawResourceHandle<HandleType>) -> &mut T
pub fn get_index_of(&self, handle: RawResourceHandle<HandleType>) -> usize
pub fn count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<T, HandleType> Freeze for ResourceRegistry<T, HandleType>
impl<T, HandleType> RefUnwindSafe for ResourceRegistry<T, HandleType>where
HandleType: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, HandleType> Send for ResourceRegistry<T, HandleType>
impl<T, HandleType> Sync for ResourceRegistry<T, HandleType>
impl<T, HandleType> Unpin for ResourceRegistry<T, HandleType>
impl<T, HandleType> UnwindSafe for ResourceRegistry<T, HandleType>where
HandleType: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more