Auto Generated Documentation

This commit is contained in:
github-actions[bot]
2025-04-02 13:41:38 +00:00
parent e9a232e07d
commit 21efed14f2
18523 changed files with 340249 additions and 282417 deletions
+1
View File
@@ -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-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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.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.offset_of.html">offset_of</a></li><li><a href="macro.offset_of_tuple.html">offset_of_tuple</a></li><li><a href="macro.offset_of_union.html">offset_of_union</a></li><li><a href="macro.raw_field.html">raw_field</a></li><li><a href="macro.raw_field_tuple.html">raw_field_tuple</a></li><li><a href="macro.raw_field_union.html">raw_field_union</a></li><li><a href="macro.span_of.html">span_of</a></li></ul></section></div></main></body></html>
+31
View File
@@ -0,0 +1,31 @@
<!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="A crate used for calculating offsets of struct members and their spans."><title>memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.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 <span>memoffset</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/memoffset/lib.rs.html#21-86">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A crate used for calculating offsets of struct members and their spans.</p>
<p>This functionality currently can not be used in compile time code such as <code>const</code> or <code>const fn</code> definitions.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memoffset::{offset_of, span_of};
<span class="attr">#[repr(C, packed)]
</span><span class="kw">struct </span>HelpMeIAmTrappedInAStructFactory {
help_me_before_they_: [u8; <span class="number">15</span>],
a: u32
}
<span class="macro">assert_eq!</span>(<span class="macro">offset_of!</span>(HelpMeIAmTrappedInAStructFactory, a), <span class="number">15</span>);
<span class="macro">assert_eq!</span>(<span class="macro">span_of!</span>(HelpMeIAmTrappedInAStructFactory, a), <span class="number">15</span>..<span class="number">19</span>);
<span class="macro">assert_eq!</span>(<span class="macro">span_of!</span>(HelpMeIAmTrappedInAStructFactory, help_me_before_they_ .. a), <span class="number">0</span>..<span class="number">15</span>);</code></pre></div>
<p>This functionality can be useful, for example, for checksum calculations:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="attr">#[repr(C, packed)]
</span><span class="kw">struct </span>Message {
header: MessageHeader,
fragment_index: u32,
fragment_count: u32,
payload: [u8; <span class="number">1024</span>],
checksum: u16
}
<span class="kw">let </span>checksum_range = <span class="kw-2">&amp;</span>raw[<span class="macro">span_of!</span>(Message, header..checksum)];
<span class="kw">let </span>checksum = crc16(checksum_range);</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.offset_of.html" title="macro memoffset::offset_of">offset_<wbr>of</a></div><div class="desc docblock-short">Calculates the offset of the specified field from the start of the named struct.</div></li><li><div class="item-name"><a class="macro" href="macro.offset_of_tuple.html" title="macro memoffset::offset_of_tuple">offset_<wbr>of_<wbr>tuple</a></div><div class="desc docblock-short">Calculates the offset of the specified field from the start of the tuple.</div></li><li><div class="item-name"><a class="macro" href="macro.offset_of_union.html" title="macro memoffset::offset_of_union">offset_<wbr>of_<wbr>union</a></div><div class="desc docblock-short">Calculates the offset of the specified union member from the start of the union.</div></li><li><div class="item-name"><a class="macro" href="macro.raw_field.html" title="macro memoffset::raw_field">raw_<wbr>field</a></div><div class="desc docblock-short">Computes a const raw pointer to the given field of the given base pointer
to the given parent type.</div></li><li><div class="item-name"><a class="macro" href="macro.raw_field_tuple.html" title="macro memoffset::raw_field_tuple">raw_<wbr>field_<wbr>tuple</a></div><div class="desc docblock-short">Computes a const raw pointer to the given field of the given base pointer
to the given parent tuple type.</div></li><li><div class="item-name"><a class="macro" href="macro.raw_field_union.html" title="macro memoffset::raw_field_union">raw_<wbr>field_<wbr>union</a></div><div class="desc docblock-short">Computes a const raw pointer to the given field of the given base pointer
to the given parent tuple type.</div></li><li><div class="item-name"><a class="macro" href="macro.span_of.html" title="macro memoffset::span_of">span_of</a></div><div class="desc docblock-short">Produces a range instance representing the sub-slice containing the specified member.</div></li></ul></section></div></main></body></html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.offset_of.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.offset_of.html">macro.offset_of.html</a>...</p>
<script>location.replace("macro.offset_of.html" + location.search + location.hash);</script>
</body>
</html>
+23
View File
@@ -0,0 +1,23 @@
<!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="Calculates the offset of the specified field from the start of the named struct."><title>offset_of in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">offset_<wbr>of</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#notes" title="Notes">Notes</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memoffset</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">memoffset</a></span><h1>Macro <span class="macro">offset_of</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/memoffset/offset_of.rs.html#119-125">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! offset_of {
($parent:path, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Calculates the offset of the specified field from the start of the named struct.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memoffset::offset_of;
<span class="attr">#[repr(C, packed)]
</span><span class="kw">struct </span>Foo {
a: u32,
b: u64,
c: [u8; <span class="number">5</span>]
}
<span class="macro">assert_eq!</span>(<span class="macro">offset_of!</span>(Foo, a), <span class="number">0</span>);
<span class="macro">assert_eq!</span>(<span class="macro">offset_of!</span>(Foo, b), <span class="number">4</span>);</code></pre></div>
<h3 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h3>
<p>Rusts ABI is unstable, and <a href="https://doc.rust-lang.org/reference/type-layout.html">type layout can be changed with each
compilation</a>.</p>
<p>Using <code>offset_of!</code> with a <code>repr(Rust)</code> struct will return the correct offset of the
specified <code>field</code> for a particular compilation, but the exact value may change
based on the compiler version, concrete struct type, time of day, or rustcs mood.</p>
<p>As a result, the value should not be retained and used between different compilations.</p>
</div></details></section></div></main></body></html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.offset_of_tuple.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.offset_of_tuple.html">macro.offset_of_tuple.html</a>...</p>
<script>location.replace("macro.offset_of_tuple.html" + location.search + location.hash);</script>
</body>
</html>
@@ -0,0 +1,8 @@
<!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="Calculates the offset of the specified field from the start of the tuple."><title>offset_of_tuple in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">offset_<wbr>of_<wbr>tuple</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><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 memoffset</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">memoffset</a></span><h1>Macro <span class="macro">offset_of_tuple</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/memoffset/offset_of.rs.html#162-168">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! offset_of_tuple {
($parent:ty, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Calculates the offset of the specified field from the start of the tuple.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memoffset::offset_of_tuple;
<span class="macro">assert!</span>(<span class="macro">offset_of_tuple!</span>((u8, u32), <span class="number">1</span>) &gt;= <span class="number">0</span>, <span class="string">"Tuples do not have a defined layout"</span>);</code></pre></div>
</div></details></section></div></main></body></html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.offset_of_union.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.offset_of_union.html">macro.offset_of_union.html</a>...</p>
<script>location.replace("macro.offset_of_union.html" + location.search + location.hash);</script>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
<!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="Calculates the offset of the specified union member from the start of the union."><title>offset_of_union in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">offset_<wbr>of_<wbr>union</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#note" title="Note">Note</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memoffset</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">memoffset</a></span><h1>Macro <span class="macro">offset_of_union</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/memoffset/offset_of.rs.html#213-219">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! offset_of_union {
($parent:path, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Calculates the offset of the specified union member from the start of the union.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memoffset::offset_of_union;
<span class="attr">#[repr(C, packed)]
</span><span class="kw">union </span>Foo {
foo32: i32,
foo64: i64,
}
<span class="macro">assert!</span>(<span class="macro">offset_of_union!</span>(Foo, foo64) == <span class="number">0</span>);</code></pre></div>
<h3 id="note"><a class="doc-anchor" href="#note">§</a>Note</h3>
<p>Due to <code>macro_rules!</code> limitations, this macro will accept structs with a single field as well as unions.
This is not a stable guarantee, and future versions of this crate might fail
on any use of this macro with a struct, without a semver bump.</p>
</div></details></section></div></main></body></html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.raw_field.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.raw_field.html">macro.raw_field.html</a>...</p>
<script>location.replace("macro.raw_field.html" + location.search + location.hash);</script>
</body>
</html>
+7
View File
@@ -0,0 +1,7 @@
<!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="Computes a const raw pointer to the given field of the given base pointer to the given parent type."><title>raw_field in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><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"><span class="rustdoc-breadcrumbs"><a href="index.html">memoffset</a></span><h1>Macro <span class="macro">raw_field</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/memoffset/raw_field.rs.html#163-176">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! raw_field {
($base:expr, $parent:path, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Computes a const raw pointer to the given field of the given base pointer
to the given parent type.</p>
<p>The <code>base</code> pointer <em>must not</em> be dangling, but it <em>may</em> point to
uninitialized memory.</p>
</div></details></section></div></main></body></html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.raw_field_tuple.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.raw_field_tuple.html">macro.raw_field_tuple.html</a>...</p>
<script>location.replace("macro.raw_field_tuple.html" + location.search + location.hash);</script>
</body>
</html>
@@ -0,0 +1,7 @@
<!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="Computes a const raw pointer to the given field of the given base pointer to the given parent tuple type."><title>raw_field_tuple in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><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"><span class="rustdoc-breadcrumbs"><a href="index.html">memoffset</a></span><h1>Macro <span class="macro">raw_field_tuple</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/memoffset/raw_field.rs.html#185-198">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! raw_field_tuple {
($base:expr, $parent:ty, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Computes a const raw pointer to the given field of the given base pointer
to the given parent tuple type.</p>
<p>The <code>base</code> pointer <em>must not</em> be dangling, but it <em>may</em> point to
uninitialized memory.</p>
</div></details></section></div></main></body></html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.raw_field_union.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.raw_field_union.html">macro.raw_field_union.html</a>...</p>
<script>location.replace("macro.raw_field_union.html" + location.search + location.hash);</script>
</body>
</html>
+13
View File
@@ -0,0 +1,13 @@
<!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="Computes a const raw pointer to the given field of the given base pointer to the given parent tuple type."><title>raw_field_union in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">raw_<wbr>field_<wbr>union</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#note" title="Note">Note</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memoffset</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">memoffset</a></span><h1>Macro <span class="macro">raw_field_union</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/memoffset/raw_field.rs.html#213-226">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! raw_field_union {
($base:expr, $parent:path, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Computes a const raw pointer to the given field of the given base pointer
to the given parent tuple type.</p>
<p>The <code>base</code> pointer <em>must not</em> be dangling, but it <em>may</em> point to
uninitialized memory.</p>
<h3 id="note"><a class="doc-anchor" href="#note">§</a>Note</h3>
<p>This macro is the same as <code>raw_field</code>, except for a different Deref-coercion check that
supports unions.
Due to <code>macro_rules!</code> limitations, this check will accept structs with a single field as well as unions.
This is not a stable guarantee, and future versions of this crate might fail
on any use of this macro with a struct, without a semver bump.</p>
</div></details></section></div></main></body></html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.span_of.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.span_of.html">macro.span_of.html</a>...</p>
<script>location.replace("macro.span_of.html" + location.search + location.hash);</script>
</body>
</html>
+64
View File
@@ -0,0 +1,64 @@
<!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="Produces a range instance representing the sub-slice containing the specified member."><title>span_of in memoffset - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memoffset" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.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 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="../memoffset/index.html">memoffset</a><span class="version">0.9.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">span_of</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#note" title="Note">Note</a></li><li><a href="#safety" title="Safety">Safety</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 memoffset</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">memoffset</a></span><h1>Macro <span class="macro">span_of</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/memoffset/span_of.rs.html#93-152">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! span_of {
(@helper $root:ident, [] ..=) =&gt; { ... };
(@helper $root:ident, [] ..) =&gt; { ... };
(@helper $root:ident, $parent:path, [] ..) =&gt; { ... };
(@helper $root:ident, $parent:path, [] ..= $end:tt) =&gt; { ... };
(@helper $root:ident, $parent:path, [] .. $end:tt) =&gt; { ... };
(@helper $root:ident, $parent:path, # $begin:tt [] ..= $end:tt) =&gt; { ... };
(@helper $root:ident, $parent:path, # $begin:tt [] .. $end:tt) =&gt; { ... };
(@helper $root:ident, $parent:path, # $begin:tt [] ..) =&gt; { ... };
(@helper $root:ident, $parent:path, # $begin:tt [] ..=) =&gt; { ... };
(@helper $root:ident, $parent:path, # $field:tt []) =&gt; { ... };
(@helper $root:ident, $parent:path, $(# $begin:tt)+ [] $tt:tt $($rest:tt)*) =&gt; { ... };
(@helper $root:ident, $parent:path, [] $tt:tt $($rest:tt)*) =&gt; { ... };
($sty:path, $($exp:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Produces a range instance representing the sub-slice containing the specified member.</p>
<p>This macro provides 2 forms of differing functionalities.</p>
<p>The first form is identical to the appearance of the <code>offset_of!</code> macro.</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="macro">span_of!</span>(Struct, member)</code></pre></div>
<p>The second form of <code>span_of!</code> returns a sub-slice which starts at one field, and ends at another.
The general pattern of this form is:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="comment">// Exclusive
</span><span class="macro">span_of!</span>(Struct, member_a .. member_b)
<span class="comment">// Inclusive
</span><span class="macro">span_of!</span>(Struct, member_a ..= member_b)
<span class="comment">// Open-ended ranges
</span><span class="macro">span_of!</span>(Struct, .. end)
<span class="macro">span_of!</span>(Struct, start ..)</code></pre></div>
<h4 id="note"><a class="doc-anchor" href="#note">§</a>Note</h4>
<p>This macro uses recursion in order to resolve the range expressions, so there is a limit to
the complexity of the expression.
In order to raise the limit, the compilers recursion limit should be lifted.</p>
<h4 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h4>
<p>The inter-field form mentioned above assumes that the first field is positioned before the
second.
This is only guaranteed for <code>repr(C)</code> structs.
Usage with <code>repr(Rust)</code> structs may yield unexpected results, like downward-going ranges,
spans that include unexpected fields, empty spans, or spans that include <em>unexpected</em> padding bytes.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memoffset::span_of;
<span class="attr">#[repr(C)]
</span><span class="kw">struct </span>Florp {
a: u32
}
<span class="attr">#[repr(C)]
</span><span class="kw">struct </span>Blarg {
x: [u32; <span class="number">2</span>],
y: [u8; <span class="number">56</span>],
z: Florp,
egg: [[u8; <span class="number">4</span>]; <span class="number">4</span>]
}
<span class="macro">assert_eq!</span>(<span class="number">0</span>..<span class="number">84</span>, <span class="macro">span_of!</span>(Blarg, ..));
<span class="macro">assert_eq!</span>(<span class="number">0</span>..<span class="number">8</span>, <span class="macro">span_of!</span>(Blarg, .. y));
<span class="macro">assert_eq!</span>(<span class="number">0</span>..<span class="number">64</span>, <span class="macro">span_of!</span>(Blarg, ..= y));
<span class="macro">assert_eq!</span>(<span class="number">0</span>..<span class="number">8</span>, <span class="macro">span_of!</span>(Blarg, x));
<span class="macro">assert_eq!</span>(<span class="number">8</span>..<span class="number">84</span>, <span class="macro">span_of!</span>(Blarg, y ..));
<span class="macro">assert_eq!</span>(<span class="number">0</span>..<span class="number">8</span>, <span class="macro">span_of!</span>(Blarg, x .. y));
<span class="macro">assert_eq!</span>(<span class="number">0</span>..<span class="number">64</span>, <span class="macro">span_of!</span>(Blarg, x ..= y));</code></pre></div>
</div></details></section></div></main></body></html>
+1
View File
@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"macro":["offset_of","offset_of_tuple","offset_of_union","raw_field","raw_field_tuple","raw_field_union","span_of"]};