23 lines
12 KiB
HTML
23 lines
12 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Instance` trait in crate `wgpu_hal`."><title>Instance in wgpu_hal - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="wgpu_hal" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../wgpu_hal/index.html">wgpu_<wbr>hal</a><span class="version">23.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Instance</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.A" title="A">A</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.create_surface" title="create_surface">create_surface</a></li><li><a href="#tymethod.enumerate_adapters" title="enumerate_adapters">enumerate_adapters</a></li><li><a href="#tymethod.init" title="init">init</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate wgpu_<wbr>hal</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">wgpu_hal</a></span><h1>Trait <span class="trait">Instance</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/wgpu_hal/lib.rs.html#491-505">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Instance: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../wgpu_types/send_sync/trait.WasmNotSendSync.html" title="trait wgpu_types::send_sync::WasmNotSendSync">WasmNotSendSync</a> {
|
|
type <a href="#associatedtype.A" class="associatedtype">A</a>: <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>;
|
|
|
|
// Required methods
|
|
unsafe fn <a href="#tymethod.init" class="fn">init</a>(desc: &<a class="struct" href="struct.InstanceDescriptor.html" title="struct wgpu_hal::InstanceDescriptor">InstanceDescriptor</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="struct.InstanceError.html" title="struct wgpu_hal::InstanceError">InstanceError</a>>;
|
|
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_surface" class="fn">create_surface</a>(
|
|
&self,
|
|
display_handle: <a class="enum" href="../raw_window_handle/enum.RawDisplayHandle.html" title="enum raw_window_handle::RawDisplayHandle">RawDisplayHandle</a>,
|
|
window_handle: <a class="enum" href="../raw_window_handle/enum.RawWindowHandle.html" title="enum raw_window_handle::RawWindowHandle">RawWindowHandle</a>,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Instance.html#associatedtype.A" title="type wgpu_hal::Instance::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Surface" title="type wgpu_hal::Api::Surface">Surface</a>, <a class="struct" href="struct.InstanceError.html" title="struct wgpu_hal::InstanceError">InstanceError</a>>;
|
|
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.enumerate_adapters" class="fn">enumerate_adapters</a>(
|
|
&self,
|
|
surface_hint: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<Self::<a class="associatedtype" href="trait.Instance.html#associatedtype.A" title="type wgpu_hal::Instance::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Surface" title="type wgpu_hal::Api::Surface">Surface</a>>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.ExposedAdapter.html" title="struct wgpu_hal::ExposedAdapter">ExposedAdapter</a><Self::<a class="associatedtype" href="trait.Instance.html#associatedtype.A" title="type wgpu_hal::Instance::A">A</a>>>;
|
|
}</code></pre><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.A" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#492">Source</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a>: <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.init" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#494">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.init" class="fn">init</a>(desc: &<a class="struct" href="struct.InstanceDescriptor.html" title="struct wgpu_hal::InstanceDescriptor">InstanceDescriptor</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="struct" href="struct.InstanceError.html" title="struct wgpu_hal::InstanceError">InstanceError</a>></h4></section><section id="tymethod.create_surface" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#495-499">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_surface" class="fn">create_surface</a>(
|
|
&self,
|
|
display_handle: <a class="enum" href="../raw_window_handle/enum.RawDisplayHandle.html" title="enum raw_window_handle::RawDisplayHandle">RawDisplayHandle</a>,
|
|
window_handle: <a class="enum" href="../raw_window_handle/enum.RawWindowHandle.html" title="enum raw_window_handle::RawWindowHandle">RawWindowHandle</a>,
|
|
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Instance.html#associatedtype.A" title="type wgpu_hal::Instance::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Surface" title="type wgpu_hal::Api::Surface">Surface</a>, <a class="struct" href="struct.InstanceError.html" title="struct wgpu_hal::InstanceError">InstanceError</a>></h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.enumerate_adapters" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#501-504">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.enumerate_adapters" class="fn">enumerate_adapters</a>(
|
|
&self,
|
|
surface_hint: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<Self::<a class="associatedtype" href="trait.Instance.html#associatedtype.A" title="type wgpu_hal::Instance::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Surface" title="type wgpu_hal::Api::Surface">Surface</a>>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.ExposedAdapter.html" title="struct wgpu_hal::ExposedAdapter">ExposedAdapter</a><Self::<a class="associatedtype" href="trait.Instance.html#associatedtype.A" title="type wgpu_hal::Instance::A">A</a>>></h4></section></summary><div class="docblock"><p><code>surface_hint</code> is only used by the GLES backend targeting WebGL2</p>
|
|
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.0/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Instance-for-Context" class="impl"><a class="src rightside" href="../src/wgpu_hal/empty.rs.html#68-87">Source</a><a href="#impl-Instance-for-Context" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Instance.html" title="trait wgpu_hal::Instance">Instance</a> for <a class="struct" href="empty/struct.Context.html" title="struct wgpu_hal::empty::Context">Context</a></h3></section></summary><div class="impl-items"><section id="associatedtype.A-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/wgpu_hal/empty.rs.html#69">Source</a><a href="#associatedtype.A-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a> = <a class="struct" href="empty/struct.Api.html" title="struct wgpu_hal::empty::Api">Api</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Instance-for-Instance" class="impl"><a class="src rightside" href="../src/wgpu_hal/vulkan/instance.rs.html#569-955">Source</a><a href="#impl-Instance-for-Instance" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Instance.html" title="trait wgpu_hal::Instance">Instance</a> for <a class="struct" href="vulkan/struct.Instance.html" title="struct wgpu_hal::vulkan::Instance">Instance</a></h3></section></summary><div class="impl-items"><section id="associatedtype.A-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/wgpu_hal/vulkan/instance.rs.html#570">Source</a><a href="#associatedtype.A-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a> = <a class="struct" href="vulkan/struct.Api.html" title="struct wgpu_hal::vulkan::Api">Api</a></h4></section></div></details></div><script src="../trait.impl/wgpu_hal/trait.Instance.js" async></script></section></div></main></body></html> |