Struct wgpu::Instance [−][src]
pub struct Instance { /* fields omitted */ }Context for all other wgpu objects. Instance of wgpu.
This is the first thing you create when using wgpu.
Its primary use is to create Adapters and Surfaces.
Does not have to be kept alive.
Implementations
impl Instance[src]
impl Instance[src]pub fn new(backends: BackendBit) -> Self[src]
pub fn new(backends: BackendBit) -> Self[src]pub fn enumerate_adapters(
&self,
backends: BackendBit
) -> impl Iterator<Item = Adapter>[src]
pub fn enumerate_adapters(
&self,
backends: BackendBit
) -> impl Iterator<Item = Adapter>[src]Retrieves all available Adapters that match the given BackendBit.
Arguments
backends- Backends from which to enumerate adapters.
pub fn request_adapter(
&self,
options: &RequestAdapterOptions<'_>
) -> impl Future<Output = Option<Adapter>> + Send[src]
pub fn request_adapter(
&self,
options: &RequestAdapterOptions<'_>
) -> impl Future<Output = Option<Adapter>> + Send[src]Retrieves an Adapter which matches the given RequestAdapterOptions.
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.
pub unsafe fn create_surface<W: HasRawWindowHandle>(
&self,
window: &W
) -> Surface[src]
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.
Trait Implementations
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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more