pub struct ResourceRegistry<T, HandleType> { /* private fields */ }
Expand description
Registry that stores values in an IndexMap.
Used by many managers without special requirements.
Implementations
sourceimpl<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
sourceimpl<T: Debug, HandleType: Debug> Debug for ResourceRegistry<T, HandleType>
impl<T: Debug, HandleType: Debug> Debug for ResourceRegistry<T, HandleType>
Auto Trait Implementations
impl<T, HandleType> RefUnwindSafe for ResourceRegistry<T, HandleType> where
HandleType: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, HandleType> Send for ResourceRegistry<T, HandleType> where
HandleType: Send,
T: Send,
impl<T, HandleType> Sync for ResourceRegistry<T, HandleType> where
HandleType: Sync,
T: Sync,
impl<T, HandleType> Unpin for ResourceRegistry<T, HandleType> where
HandleType: Unpin,
T: Unpin,
impl<T, HandleType> UnwindSafe for ResourceRegistry<T, HandleType> where
HandleType: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more