Struct wgpu::core::registry::Registry

source ·
pub struct Registry<I, T>
where I: TypedId, T: Resource<I>,
{ /* private fields */ }
Available on wgpu_core only.
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, T> Registry<I, T>
where I: TypedId, T: Resource<I>,

source

pub fn unregister_locked( &self, id: I, storage: &mut Storage<T, I> ) -> Option<Arc<T>>

source

pub fn force_replace(&self, id: I, value: T)

source

pub fn force_replace_with_error(&self, id: I, label: &str)

source

pub fn label_for_resource(&self, id: I) -> String

Trait Implementations§

source§

impl<I, T> Debug for Registry<I, T>
where I: Debug + TypedId, T: Debug + Resource<I>,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, T> !Freeze for Registry<I, T>

§

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> 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>,

§

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>,

§

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,