wgpu_core::hal_api

Trait HalApi

Source
pub trait HalApi: Api {
    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<G: GlobalIdentityHandlerFactory>(global: &Global<G>) -> &Hub<Self, G>;
    fn get_surface(surface: &Surface) -> Option<&HalSurface<Self>>;
    fn get_surface_mut(surface: &mut Surface) -> Option<&mut HalSurface<Self>>;
}

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<G: GlobalIdentityHandlerFactory>(global: &Global<G>) -> &Hub<Self, G>

Source

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

Source

fn get_surface_mut(surface: &mut Surface) -> Option<&mut HalSurface<Self>>

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

Source§

const VARIANT: Backend = Backend::Gl

Source§

impl HalApi for Vulkan

Source§

const VARIANT: Backend = Backend::Vulkan