[][src]Struct wgpu::Instance

pub struct Instance { /* fields omitted */ }

Instance of wgpu. First thing you create when using wgpu.

An instance sets up the context for all other wgpu objects.

Instances and adapters do not have to be kept alive, only devices.

Methods

impl Instance[src]

pub fn new() -> Self[src]

Create an new instance of wgpu.

pub fn enumerate_adapters(
    &self,
    unsafe_extensions: UnsafeExtensions,
    backends: BackendBit
) -> impl Iterator<Item = Adapter>
[src]

Retrieves all available [Adapter]s that match the given backends.

pub unsafe fn create_surface<W: HasRawWindowHandle>(
    &self,
    window: &W
) -> Surface
[src]

Creates a surface from a raw window handle.

Safety

  • Raw Window Handle must be a valid object to create a surface upon.

pub fn request_adapter(
    &self,
    options: &RequestAdapterOptions,
    unsafe_extensions: UnsafeExtensions,
    backends: BackendBit
) -> impl Future<Output = Option<Adapter>> + Send
[src]

Retrieves an [Adapter] which matches the given options.

Some options are "soft", so treated as non-mandatory. Others are "hard".

If no adapters are found that suffice all the "hard" options, None is returned.

Auto Trait Implementations

impl !RefUnwindSafe for Instance

impl Send for Instance

impl Sync for Instance

impl Unpin for Instance

impl !UnwindSafe for Instance

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.