Struct wgpu::core::any_surface::AnySurface
source · pub struct AnySurface(/* private fields */);
Expand description
A Arc
of a HalSurface<A>
, for any backend A
.
Any AnySurface
is just like an Arc<HalSurface<A>>
, except that the
A
type parameter is erased. To access the Surface
, you must
downcast to a particular backend with the [downcast_ref
] or
[take
] methods.
Implementations§
source§impl AnySurface
impl AnySurface
sourcepub fn new<A>(surface: HalSurface<A>) -> AnySurfacewhere
A: HalApi,
pub fn new<A>(surface: HalSurface<A>) -> AnySurfacewhere
A: HalApi,
Return an AnySurface
that holds an owning Arc
to HalSurface
.
pub fn backend(&self) -> Backend
sourcepub fn downcast_ref<A>(&self) -> Option<&HalSurface<A>>where
A: HalApi,
pub fn downcast_ref<A>(&self) -> Option<&HalSurface<A>>where
A: HalApi,
If self
is an Arc<HalSurface<A>>
, return a reference to the
HalSurface.
Trait Implementations§
Auto Trait Implementations§
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