Skip to main content

GraphicsApi

Trait GraphicsApi 

Source
pub trait GraphicsApi:
    Send
    + Sync
    + Debug
    + Default
    + Clone
    + 'static {
    // Required method
    fn backend() -> Backend;

    // Provided method
    fn backend_for(device: &WgpuDevice) -> Backend { ... }
}
Expand description

The basic trait to specify which graphics API to use as Backend.

Options are:

Required Methods§

Source

fn backend() -> Backend

The wgpu backend.

Provided Methods§

Source

fn backend_for(device: &WgpuDevice) -> Backend

The wgpu backend device comes up on when set up through this API.

A named API is itself, whatever the device. AutoGraphicsApi is the one that defers, to the API the device pins where it pins one.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§