-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b0b6109
Showing
59 changed files
with
2,547 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
window.ALL_CRATES = ["qed"]; | ||
//{"start":21,"fragment_lengths":[5]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="./static.files/rustdoc-405f8b29f52305f8.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="qed" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (9c01301c5 2024-09-05)" data-channel="nightly" data-search-js="search-a99f1315e7cc5121.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="./static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="./static.files/main-14659ec02b58af51.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-40f72c9259523cb3.css"></noscript><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 mod sys"><!--[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><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="./index.html"><img class="rust-logo" src="./static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2><a href="./index.html">Rustdoc</a><span class="version">1.83.0-nightly</span></h2></div><div class="version">(9c01301c5 2024-09-05)</div><h2 class="location">Help</h2><div class="sidebar-elems"></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"><h1>Rustdoc help</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section><p>You need to enable JavaScript to use keyboard commands or search.</p><p>For more information, browse the <a href="https://doc.rust-lang.org/rustdoc/">rustdoc handbook</a>.</p></section></noscript></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-405f8b29f52305f8.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="qed" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (9c01301c5 2024-09-05)" data-channel="nightly" data-search-js="search-a99f1315e7cc5121.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="../static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="../static.files/main-14659ec02b58af51.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-40f72c9259523cb3.css"></noscript><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 mod sys"><!--[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="../qed/index.html">qed</a><span class="version">1.6.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#macros">Crate Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="macros">Macros</h3><ul class="all-items"><li><a href="macro.const_assert.html">const_assert</a></li><li><a href="macro.const_assert_bytes_has_no_nul.html">const_assert_bytes_has_no_nul</a></li><li><a href="macro.const_assert_eq.html">const_assert_eq</a></li><li><a href="macro.const_assert_matches.html">const_assert_matches</a></li><li><a href="macro.const_assert_ne.html">const_assert_ne</a></li><li><a href="macro.const_assert_size_eq.html">const_assert_size_eq</a></li><li><a href="macro.const_cstr_from_bytes.html">const_cstr_from_bytes</a></li><li><a href="macro.const_cstr_from_str.html">const_cstr_from_str</a></li><li><a href="macro.lossless_cast_u32_to_usize.html">lossless_cast_u32_to_usize</a></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!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="Compile time assertions."><title>qed - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-405f8b29f52305f8.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="qed" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (9c01301c5 2024-09-05)" data-channel="nightly" data-search-js="search-a99f1315e7cc5121.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="../static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-14659ec02b58af51.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-40f72c9259523cb3.css"></noscript><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 mod crate"><!--[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="../qed/index.html">qed</a><span class="version">1.6.1</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#macros">Crate Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li></ul></section><div id="rustdoc-modnav"></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"><h1>Crate <a class="mod" href="#">qed</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/qed/lib.rs.html#1-602">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Compile time assertions.</p> | ||
<p>This crate contains compile time assertion macros used for maintaining safety | ||
invariants or limiting platform support. If the assertion is false, a compiler | ||
error is emitted.</p> | ||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">qed::const_assert!</span>(usize::BITS >= u32::BITS); | ||
<span class="macro">qed::const_assert_eq!</span>(<span class="string">"Veni, vidi, vici"</span>.len(), <span class="number">16</span>); | ||
<span class="macro">qed::const_assert_ne!</span>(<span class="string">'∎'</span>.len_utf8(), <span class="number">1</span>); | ||
<span class="macro">qed::const_assert_matches!</span>(NonZeroU8::new(<span class="number">42</span>), <span class="prelude-val">Some</span>(nz) <span class="kw">if </span>nz.get() == <span class="number">42</span>);</code></pre></div> | ||
<p>Assertion failures will result in a compile error:</p> | ||
|
||
<div class="example-wrap compile_fail"><a href="#" class="tooltip" title="This example deliberately fails to compile">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">qed::const_assert!</span>(<span class="string">"non-empty string"</span>.is_empty());</code></pre></div> | ||
</div></details><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="macro" href="macro.const_assert.html" title="macro qed::const_assert">const_<wbr>assert</a></div><div class="desc docblock-short">Asserts that a boolean expression is true at compile time.</div></li><li><div class="item-name"><a class="macro" href="macro.const_assert_bytes_has_no_nul.html" title="macro qed::const_assert_bytes_has_no_nul">const_<wbr>assert_<wbr>bytes_<wbr>has_<wbr>no_<wbr>nul</a></div><div class="desc docblock-short">Asserts that a byte slice does not contain any NUL (<code>\0</code>) bytes.</div></li><li><div class="item-name"><a class="macro" href="macro.const_assert_eq.html" title="macro qed::const_assert_eq">const_<wbr>assert_<wbr>eq</a></div><div class="desc docblock-short">Asserts that two expressions are equal to each other (using <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq"><code>PartialEq</code></a>) | ||
at compile time.</div></li><li><div class="item-name"><a class="macro" href="macro.const_assert_matches.html" title="macro qed::const_assert_matches">const_<wbr>assert_<wbr>matches</a></div><div class="desc docblock-short">Asserts that an expression matches any of the given patterns at compile | ||
time.</div></li><li><div class="item-name"><a class="macro" href="macro.const_assert_ne.html" title="macro qed::const_assert_ne">const_<wbr>assert_<wbr>ne</a></div><div class="desc docblock-short">Asserts that two expressions are not equal to each other (using | ||
<a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq"><code>PartialEq</code></a>) at compile time.</div></li><li><div class="item-name"><a class="macro" href="macro.const_assert_size_eq.html" title="macro qed::const_assert_size_eq">const_<wbr>assert_<wbr>size_<wbr>eq</a></div><div class="desc docblock-short">Asserts that two types have the same size at compile time.</div></li><li><div class="item-name"><a class="macro" href="macro.const_cstr_from_bytes.html" title="macro qed::const_cstr_from_bytes">const_<wbr>cstr_<wbr>from_<wbr>bytes</a></div><div class="desc docblock-short">Construct a const <a href="https://doc.rust-lang.org/nightly/core/ffi/c_str/struct.CStr.html" title="struct core::ffi::c_str::CStr"><code>CStr</code></a> from the given bytes at compile time and assert | ||
that the given bytes are a valid <code>CStr</code> (NUL terminated with no interior NUL | ||
bytes).</div></li><li><div class="item-name"><a class="macro" href="macro.const_cstr_from_str.html" title="macro qed::const_cstr_from_str">const_<wbr>cstr_<wbr>from_<wbr>str</a></div><div class="desc docblock-short">Construct a const <a href="https://doc.rust-lang.org/nightly/core/ffi/c_str/struct.CStr.html" title="struct core::ffi::c_str::CStr"><code>CStr</code></a> from the given <code>str</code> at compile time and assert | ||
that the given <code>str</code> bytes are a valid <code>CStr</code> (NUL terminated with no | ||
interior NUL bytes).</div></li><li><div class="item-name"><a class="macro" href="macro.lossless_cast_u32_to_usize.html" title="macro qed::lossless_cast_u32_to_usize">lossless_<wbr>cast_<wbr>u32_<wbr>to_<wbr>usize</a></div><div class="desc docblock-short">Cast a <a href="https://doc.rust-lang.org/nightly/core/primitive.u32.html" title="primitive u32"><code>u32</code></a> to <a href="https://doc.rust-lang.org/nightly/core/primitive.usize.html" title="primitive usize"><code>usize</code></a> at runtime with a compile time assert that the | ||
cast is lossless and will not overflow.</div></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="refresh" content="0;URL=macro.const_assert.html"> | ||
<title>Redirection</title> | ||
</head> | ||
<body> | ||
<p>Redirecting to <a href="macro.const_assert.html">macro.const_assert.html</a>...</p> | ||
<script>location.replace("macro.const_assert.html" + location.search + location.hash);</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!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="Asserts that a boolean expression is true at compile time."><title>const_assert in qed - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.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-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-405f8b29f52305f8.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="qed" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (9c01301c5 2024-09-05)" data-channel="nightly" data-search-js="search-a99f1315e7cc5121.js" data-settings-js="settings-7e3bb6c46e92e77c.js" ><script src="../static.files/storage-29b1d5a9048d38fe.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-14659ec02b58af51.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-40f72c9259523cb3.css"></noscript><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 macro"><!--[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="../qed/index.html">qed</a><span class="version">1.6.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">const_<wbr>assert</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#uses" title="Uses">Uses</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate qed</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"><h1>Macro <a href="index.html">qed</a>::<wbr><a class="macro" href="#">const_assert</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/qed/lib.rs.html#90-94">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><span class="macro">macro_rules!</span> const_assert { | ||
(<span class="macro-nonterminal">$x</span>:expr $(,)<span class="question-mark">?</span>) => { ... }; | ||
}</pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Asserts that a boolean expression is true at compile time.</p> | ||
<p>This will result in a compile time type error if the boolean expression does | ||
not evaluate to true.</p> | ||
<h2 id="uses"><a class="doc-anchor" href="#uses">§</a>Uses</h2> | ||
<p>Assertions are always checked in both debug and release builds and cannot be | ||
disabled.</p> | ||
<p>Unsafe code and <a href="https://doc.rust-lang.org/nomicon/casts.html"><code>as</code> casts</a> may rely on <code>const_assert!</code> to enforce | ||
runtime invariants that, if violated, could lead to unsafety.</p> | ||
<p>Other use-cases of <code>const_assert!</code> include limiting supported platforms and | ||
architectures.</p> | ||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Assert at compile time that the target platform has at least 32-bit | ||
// `usize`. | ||
</span><span class="macro">qed::const_assert!</span>(usize::BITS >= u32::BITS);</code></pre></div> | ||
<p>Assertion failures will result in a compile error:</p> | ||
|
||
<div class="example-wrap compile_fail"><a href="#" class="tooltip" title="This example deliberately fails to compile">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">qed::const_assert!</span>(<span class="string">"non-empty string"</span>.is_empty());</code></pre></div> | ||
</div></details></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="refresh" content="0;URL=macro.const_assert_bytes_has_no_nul.html"> | ||
<title>Redirection</title> | ||
</head> | ||
<body> | ||
<p>Redirecting to <a href="macro.const_assert_bytes_has_no_nul.html">macro.const_assert_bytes_has_no_nul.html</a>...</p> | ||
<script>location.replace("macro.const_assert_bytes_has_no_nul.html" + location.search + location.hash);</script> | ||
</body> | ||
</html> |
Oops, something went wrong.