Trait wgpu_hal::dynamic::DynResourceExt

source ·
trait DynResourceExt {
    // Required methods
    fn expect_downcast_ref<T: DynResource>(&self) -> &T;
    fn expect_downcast_mut<T: DynResource>(&mut self) -> &mut T;
    unsafe fn unbox<T: DynResource + 'static>(self: Box<Self>) -> T;
}
Expand description

Extension trait for DynResource used by implementations of various dynamic resource traits.

Required Methods§

source

fn expect_downcast_ref<T: DynResource>(&self) -> &T

§Panics
  • Panics if self is not downcastable to T.
source

fn expect_downcast_mut<T: DynResource>(&mut self) -> &mut T

§Panics
  • Panics if self is not downcastable to T.
source

unsafe fn unbox<T: DynResource + 'static>(self: Box<Self>) -> T

Unboxes a Box<dyn DynResource> to a concrete type.

§Safety
  • self must be the correct concrete type.

Object Safety§

This trait is not object safe.

Implementors§