pub struct Registry<I: TypedId, T: Resource<I>> { /* private fields */ }
Expand description
Registry is the primary holder of each resource type Every resource is now arcanized so the last arc released will in the end free the memory and release the inner raw resource
Registry act as the main entry point to keep resource alive when created and released from user land code
A resource may still be alive when released from user land code if it’s used in active submission or anyway kept alive from any other dependent resource
Implementations§
source§impl<I: TypedId, T: Resource<I>> Registry<I, T>
impl<I: TypedId, T: Resource<I>> Registry<I, T>
pub fn unregister_locked( &self, id: I, storage: &mut Storage<T, I> ) -> Option<Arc<T>>
pub fn force_replace(&self, id: I, value: T)
pub fn force_replace_with_error(&self, id: I, label: &str)
pub fn label_for_resource(&self, id: I) -> String
Trait Implementations§
Auto Trait Implementations§
impl<I, T> !RefUnwindSafe for Registry<I, T>
impl<I, T> Send for Registry<I, T>
impl<I, T> Sync for Registry<I, T>
impl<I, T> Unpin for Registry<I, T>where
I: Unpin,
impl<I, T> !UnwindSafe for Registry<I, T>
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