Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 1b9e4fe

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@877dd5b 🚀
1 parent 1d6b4ae commit 1b9e4fe

9 files changed

+15
-23
lines changed

doc/src/wgpu_core/device/mod.rs.html

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,6 @@
448448
<a href="#448" id="448">448</a>
449449
<a href="#449" id="449">449</a>
450450
<a href="#450" id="450">450</a>
451-
<a href="#451" id="451">451</a>
452-
<a href="#452" id="452">452</a>
453-
<a href="#453" id="453">453</a>
454-
<a href="#454" id="454">454</a>
455451
</pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
456452
binding_model,
457453
hal_api::HalApi,
@@ -727,19 +723,15 @@
727723
}
728724
}
729725

730-
<span class="attr">#[allow(trivial_casts)]
731-
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>call(<span class="self">self</span>, reason: DeviceLostReason, message: String) {
726+
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>call(<span class="self">self</span>, reason: DeviceLostReason, message: String) {
732727
<span class="kw">match </span><span class="self">self</span>.inner {
733728
DeviceLostClosureInner::Rust { callback } =&gt; callback(reason, message),
734729
<span class="comment">// SAFETY: the contract of the call to from_c says that this unsafe is sound.
735730
</span>DeviceLostClosureInner::C { inner } =&gt; <span class="kw">unsafe </span>{
736-
<span class="comment">// We need to pass message as a c_char typed pointer. To avoid trivial
737-
// conversion warnings on some platforms, we use the allow lint.
738-
</span>(inner.callback)(
739-
inner.user_data,
740-
reason <span class="kw">as </span>u8,
741-
message.as_ptr() <span class="kw">as </span><span class="kw-2">*const </span>c_char,
742-
)
731+
<span class="comment">// Ensure message is structured as a null-terminated C string. It only
732+
// needs to live as long as the callback invocation.
733+
</span><span class="kw">let </span>message = std::ffi::CString::new(message).unwrap();
734+
(inner.callback)(inner.user_data, reason <span class="kw">as </span>u8, message.as_ptr())
743735
},
744736
}
745737
}

doc/wgpu_core/device/enum.DeviceError.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

doc/wgpu_core/device/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

doc/wgpu_core/device/struct.DeviceLostClosure.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!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 `DeviceLostClosure` struct in crate `wgpu_core`."><title>DeviceLostClosure in wgpu_core::device - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_core" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0-nightly (2f8d81f9d 2023-11-21)" data-channel="nightly" data-search-js="search-21db098bdc95be9e.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f06f02fd918e3bb3.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc struct"><!--[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">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../wgpu_core/index.html">wgpu_core</a><span class="version">0.18.0</span></h2></div><h2 class="location"><a href="#">DeviceLostClosure</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.from_c">from_c</a></li><li><a href="#method.from_rust">from_rust</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-DeviceLostClosure">!RefUnwindSafe</a></li><li><a href="#impl-Sync-for-DeviceLostClosure">!Sync</a></li><li><a href="#impl-UnwindSafe-for-DeviceLostClosure">!UnwindSafe</a></li><li><a href="#impl-Send-for-DeviceLostClosure">Send</a></li><li><a href="#impl-Unpin-for-DeviceLostClosure">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-Downcast%3CT%3E-for-T">Downcast&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-T">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into&lt;U&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto&lt;U&gt;</a></li><li><a href="#impl-Upcast%3CT%3E-for-T">Upcast&lt;T&gt;</a></li><li><a href="#impl-WasmNotSend-for-T">WasmNotSend</a></li></ul></section><h2><a href="index.html">In wgpu_core::device</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="../index.html">wgpu_core</a>::<wbr><a href="index.html">device</a>::<wbr><a class="struct" href="#">DeviceLostClosure</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/wgpu_core/device/mod.rs.html#239-243">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub struct DeviceLostClosure { /* private fields */ }</code></pre><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-DeviceLostClosure" class="impl"><a class="src rightside" href="../../src/wgpu_core/device/mod.rs.html#256-292">source</a><a href="#impl-DeviceLostClosure" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.DeviceLostClosure.html" title="struct wgpu_core::device::DeviceLostClosure">DeviceLostClosure</a></h3></section></summary><div class="impl-items"><section id="method.from_rust" class="method"><a class="src rightside" href="../../src/wgpu_core/device/mod.rs.html#257-261">source</a><h4 class="code-header">pub fn <a href="#method.from_rust" class="fn">from_rust</a>(callback: <a class="type" href="type.DeviceLostCallback.html" title="type wgpu_core::device::DeviceLostCallback">DeviceLostCallback</a>) -&gt; Self</h4></section><details class="toggle method-toggle" open><summary><section id="method.from_c" class="method"><a class="src rightside" href="../../src/wgpu_core/device/mod.rs.html#270-274">source</a><h4 class="code-header">pub unsafe fn <a href="#method.from_c" class="fn">from_c</a>(inner: <a class="struct" href="struct.DeviceLostClosureC.html" title="struct wgpu_core::device::DeviceLostClosureC">DeviceLostClosureC</a>) -&gt; Self</h4></section></summary><div class="docblock"><h5 id="safety"><a href="#safety">Safety</a></h5>
1+
<!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 `DeviceLostClosure` struct in crate `wgpu_core`."><title>DeviceLostClosure in wgpu_core::device - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_core" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0-nightly (2f8d81f9d 2023-11-21)" data-channel="nightly" data-search-js="search-21db098bdc95be9e.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f06f02fd918e3bb3.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc struct"><!--[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">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../wgpu_core/index.html">wgpu_core</a><span class="version">0.18.0</span></h2></div><h2 class="location"><a href="#">DeviceLostClosure</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.from_c">from_c</a></li><li><a href="#method.from_rust">from_rust</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-DeviceLostClosure">!RefUnwindSafe</a></li><li><a href="#impl-Sync-for-DeviceLostClosure">!Sync</a></li><li><a href="#impl-UnwindSafe-for-DeviceLostClosure">!UnwindSafe</a></li><li><a href="#impl-Send-for-DeviceLostClosure">Send</a></li><li><a href="#impl-Unpin-for-DeviceLostClosure">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-Downcast%3CT%3E-for-T">Downcast&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-T">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into&lt;U&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto&lt;U&gt;</a></li><li><a href="#impl-Upcast%3CT%3E-for-T">Upcast&lt;T&gt;</a></li><li><a href="#impl-WasmNotSend-for-T">WasmNotSend</a></li></ul></section><h2><a href="index.html">In wgpu_core::device</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="../index.html">wgpu_core</a>::<wbr><a href="index.html">device</a>::<wbr><a class="struct" href="#">DeviceLostClosure</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/wgpu_core/device/mod.rs.html#239-243">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub struct DeviceLostClosure { /* private fields */ }</code></pre><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-DeviceLostClosure" class="impl"><a class="src rightside" href="../../src/wgpu_core/device/mod.rs.html#256-288">source</a><a href="#impl-DeviceLostClosure" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.DeviceLostClosure.html" title="struct wgpu_core::device::DeviceLostClosure">DeviceLostClosure</a></h3></section></summary><div class="impl-items"><section id="method.from_rust" class="method"><a class="src rightside" href="../../src/wgpu_core/device/mod.rs.html#257-261">source</a><h4 class="code-header">pub fn <a href="#method.from_rust" class="fn">from_rust</a>(callback: <a class="type" href="type.DeviceLostCallback.html" title="type wgpu_core::device::DeviceLostCallback">DeviceLostCallback</a>) -&gt; Self</h4></section><details class="toggle method-toggle" open><summary><section id="method.from_c" class="method"><a class="src rightside" href="../../src/wgpu_core/device/mod.rs.html#270-274">source</a><h4 class="code-header">pub unsafe fn <a href="#method.from_c" class="fn">from_c</a>(inner: <a class="struct" href="struct.DeviceLostClosureC.html" title="struct wgpu_core::device::DeviceLostClosureC">DeviceLostClosureC</a>) -&gt; Self</h4></section></summary><div class="docblock"><h5 id="safety"><a href="#safety">Safety</a></h5>
22
<ul>
33
<li>
44
<p>The callback pointer must be valid to call with the provided <code>user_data</code>

0 commit comments

Comments
 (0)