wgpu_core::hal_api

Trait HalApi

Source
pub trait HalApi:
    Api
    + 'static
    + WasmNotSendSync {
    const VARIANT: Backend;

    // Required methods
    fn create_instance_from_hal(
        name: &str,
        hal_instance: Self::Instance,
    ) -> Instance;
    fn instance_as_hal(instance: &Instance) -> Option<&Self::Instance>;
    fn hub(global: &Global) -> &Hub<Self>;
    fn surface_as_hal(surface: &Surface) -> Option<&Self::Surface>;
}

Required Associated Constants§

Required Methods§

Source

fn create_instance_from_hal( name: &str, hal_instance: Self::Instance, ) -> Instance

Source

fn instance_as_hal(instance: &Instance) -> Option<&Self::Instance>

Source

fn hub(global: &Global) -> &Hub<Self>

Source

fn surface_as_hal(surface: &Surface) -> Option<&Self::Surface>

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 HalApi for Empty

Source§

const VARIANT: Backend = Backend::Empty

Source§

impl HalApi for Gles

Available on gles only.
Source§

const VARIANT: Backend = Backend::Gl

Source§

impl HalApi for Vulkan

Available on vulkan only.
Source§

const VARIANT: Backend = Backend::Vulkan