Trait wgpu_hal::Instance

source ·
pub trait Instance: Sized + WasmNotSendSync {
    type A: Api;

    // Required methods
    unsafe fn init(desc: &InstanceDescriptor<'_>) -> Result<Self, InstanceError>;
    unsafe fn create_surface(
        &self,
        display_handle: RawDisplayHandle,
        window_handle: RawWindowHandle,
    ) -> Result<<Self::A as Api>::Surface, InstanceError>;
    unsafe fn destroy_surface(&self, surface: <Self::A as Api>::Surface);
    unsafe fn enumerate_adapters(&self) -> Vec<ExposedAdapter<Self::A>>;
}

Required Associated Types§

source

type A: Api

Required Methods§

source

unsafe fn init(desc: &InstanceDescriptor<'_>) -> Result<Self, InstanceError>

source

unsafe fn create_surface( &self, display_handle: RawDisplayHandle, window_handle: RawWindowHandle, ) -> Result<<Self::A as Api>::Surface, InstanceError>

source

unsafe fn destroy_surface(&self, surface: <Self::A as Api>::Surface)

source

unsafe fn enumerate_adapters(&self) -> Vec<ExposedAdapter<Self::A>>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Instance for Context

§

type A = Api

source§

impl Instance for Instance

Available on vulkan only.
§

type A = Api