wgpu_hal

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Instance for Context

Source§

type A = Api

Source§

impl Instance for Instance

Available on vulkan only.
Source§

type A = Api