Struct wgpu_core::registry::Registry

source ·
pub(crate) struct Registry<T: StorageItem> {
    identity: Arc<IdentityManager<T::Marker>>,
    storage: RwLock<Storage<T>>,
}
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

Fields§

§identity: Arc<IdentityManager<T::Marker>>§storage: RwLock<Storage<T>>

Implementations§

source§

impl<T: StorageItem> Registry<T>

source

pub(crate) fn new() -> Self

source§

impl<T: StorageItem> Registry<T>

source

pub(crate) fn prepare(&self, id_in: Option<Id<T::Marker>>) -> FutureId<'_, T>

source

pub(crate) fn read<'a>(&'a self) -> RwLockReadGuard<'a, Storage<T>>

source

pub(crate) fn write<'a>(&'a self) -> RwLockWriteGuard<'a, Storage<T>>

source

pub(crate) fn remove(&self, id: Id<T::Marker>) -> T

source

pub(crate) fn generate_report(&self) -> RegistryReport

source§

impl<T: StorageItem + Clone> Registry<T>

source

pub(crate) fn get(&self, id: Id<T::Marker>) -> T

Trait Implementations§

source§

impl<T: Debug + StorageItem> Debug for Registry<T>
where T::Marker: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for Registry<T>

§

impl<T> !RefUnwindSafe for Registry<T>

§

impl<T> Send for Registry<T>
where T: Send,

§

impl<T> Sync for Registry<T>
where T: Send + Sync,

§

impl<T> Unpin for Registry<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Registry<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,