Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `Box&#60;T&#62;` as `BoxBytes`."><title>box_bytes_of in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">box_bytes_of</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">box_<wbr>bytes_<wbr>of</span>&nbsp;<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/bytemuck/allocation.rs.html#918-920">Source</a> </span></div><pre class="rust item-decl"><code>pub fn box_bytes_of&lt;T: BoxBytesOf + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;) -&gt; <a class="struct" href="struct.BoxBytes.html" title="struct bytemuck::allocation::BoxBytes">BoxBytes</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>Box&lt;T&gt;</code> as <code>BoxBytes</code>.</p>
<p><code>T</code> must be either <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized"><code>Sized</code></a> and <a href="../trait.NoUninit.html" title="trait bytemuck::NoUninit"><code>NoUninit</code></a>,
<a href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html" title="primitive slice"><code>[U]</code></a> where <code>U: NoUninit</code>, or <a href="https://doc.rust-lang.org/1.93.1/core/primitive.str.html" title="primitive str"><code>str</code></a>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="As `try_cast_arc`, but unwraps for you."><title>cast_arc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_arc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_<wbr>arc</span>&nbsp;<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/bytemuck/allocation.rs.html#389-393">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_arc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;A&gt;,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;B&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_arc.html" title="fn bytemuck::allocation::try_cast_arc"><code>try_cast_arc</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="As `try_cast_box`, but unwraps for you."><title>cast_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#30-32">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_box&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;A&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;B&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_box.html" title="fn bytemuck::allocation::try_cast_box"><code>try_cast_box</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="As `try_cast_rc`, but unwraps for you."><title>cast_rc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_rc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_rc</span>&nbsp;<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/bytemuck/allocation.rs.html#352-356">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_rc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;A&gt;,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;B&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_rc.html" title="fn bytemuck::allocation::try_cast_rc"><code>try_cast_rc</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="As `try_cast_slice_arc`, but unwraps for you."><title>cast_slice_arc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice_arc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_<wbr>slice_<wbr>arc</span>&nbsp;<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/bytemuck/allocation.rs.html#496-503">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice_arc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_slice_arc.html" title="fn bytemuck::allocation::try_cast_slice_arc"><code>try_cast_slice_arc</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="As `try_cast_slice_box`, but unwraps for you."><title>cast_slice_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_<wbr>slice_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#186-190">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice_box&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_slice_box.html" title="fn bytemuck::allocation::try_cast_slice_box"><code>try_cast_slice_box</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="As `try_cast_slice_rc`, but unwraps for you."><title>cast_slice_rc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice_rc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_<wbr>slice_<wbr>rc</span>&nbsp;<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/bytemuck/allocation.rs.html#429-436">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice_rc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_slice_rc.html" title="fn bytemuck::allocation::try_cast_slice_rc"><code>try_cast_slice_rc</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="As `try_cast_vec`, but unwraps for you."><title>cast_vec in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_vec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">cast_<wbr>vec</span>&nbsp;<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/bytemuck/allocation.rs.html#241-243">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_vec&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;A&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;B&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_cast_vec.html" title="fn bytemuck::allocation::try_cast_vec"><code>try_cast_vec</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

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="Re-interprets `BoxBytes` as `Box&#60;T&#62;`."><title>from_box_bytes in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">from_box_bytes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">from_<wbr>box_<wbr>bytes</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">from_<wbr>box_<wbr>bytes</span>&nbsp;<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/bytemuck/allocation.rs.html#933-937">Source</a> </span></div><pre class="rust item-decl"><code>pub fn from_box_bytes&lt;T: FromBoxBytes + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(input: <a class="struct" href="struct.BoxBytes.html" title="struct bytemuck::allocation::BoxBytes">BoxBytes</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>BoxBytes</code> as <code>Box&lt;T&gt;</code>.</p>
<p><code>T</code> must be either <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized"><code>Sized</code></a> + <a href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a>, or
<a href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html" title="primitive slice"><code>[U]</code></a> where <code>U: AnyBitPattern</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_from_box_bytes.html" title="fn bytemuck::allocation::try_from_box_bytes"><code>try_from_box_bytes</code></a> but will panic on error and the input will be
dropped.</p>
</div></details></section></div></main></body></html>

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="This “collects” a slice of pod data into a vec of a different pod type."><title>pod_collect_to_vec in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">pod_collect_to_vec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">pod_<wbr>collect_<wbr>to_<wbr>vec</span>&nbsp;<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/bytemuck/allocation.rs.html#334-348">Source</a> </span></div><pre class="rust item-decl"><code>pub fn pod_collect_to_vec&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
src: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;B&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This “collects” a slice of pod data into a vec of a different pod type.</p>
<p>Unlike with <a href="../fn.cast_slice.html" title="fn bytemuck::cast_slice"><code>cast_slice</code></a> and <a href="../fn.cast_slice_mut.html" title="fn bytemuck::cast_slice_mut"><code>cast_slice_mut</code></a>, this will always work.</p>
<p>The output vec will be of a minimal size/capacity to hold the slice given.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>halfwords: [u16; <span class="number">4</span>] = [<span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>, <span class="number">8</span>];
<span class="kw">let </span>vec_of_words: Vec&lt;u32&gt; = pod_collect_to_vec(<span class="kw-2">&amp;</span>halfwords);
<span class="kw">if </span><span class="macro">cfg!</span>(target_endian = <span class="string">"little"</span>) {
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>vec_of_words[..], <span class="kw-2">&amp;</span>[<span class="number">0x0006_0005</span>, <span class="number">0x0008_0007</span>][..])
} <span class="kw">else </span>{
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>vec_of_words[..], <span class="kw-2">&amp;</span>[<span class="number">0x0005_0006</span>, <span class="number">0x0007_0008</span>][..])
}</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,14 @@
<!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="Attempts to cast the content type of a `Arc`."><title>try_cast_arc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_arc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>arc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>arc</span>&nbsp;<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/bytemuck/allocation.rs.html#410-425">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_arc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;A&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;B&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;A&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <a href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc"><code>Arc</code></a>.</p>
<p>On failure you get back an error along with the starting <code>Arc</code>.</p>
<p>The bounds on this function are the same as <a href="../fn.cast_mut.html" title="fn bytemuck::cast_mut"><code>cast_mut</code></a>, because a user
could call <code>Rc::get_unchecked_mut</code> on the output, which could be observable
in the input.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Arc</code> must have the exact same
alignment.</li>
<li>The start and end size of the <code>Arc</code> must have the exact same size.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!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="Attempts to cast the content type of a `Box`."><title>try_cast_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>box</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#44-56">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_box&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;A&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;B&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;A&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <a href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box"><code>Box</code></a>.</p>
<p>On failure you get back an error along with the starting <code>Box</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Box</code> must have the exact same
alignment.</li>
<li>The start and end size of the <code>Box</code> must have the exact same size.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,14 @@
<!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="Attempts to cast the content type of a `Rc`."><title>try_cast_rc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_rc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>rc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>rc</span>&nbsp;<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/bytemuck/allocation.rs.html#372-384">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_rc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;A&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;B&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;A&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <a href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc"><code>Rc</code></a>.</p>
<p>On failure you get back an error along with the starting <code>Rc</code>.</p>
<p>The bounds on this function are the same as <a href="../fn.cast_mut.html" title="fn bytemuck::cast_mut"><code>cast_mut</code></a>, because a user
could call <code>Rc::get_unchecked_mut</code> on the output, which could be observable
in the input.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Rc</code> must have the exact same
alignment.</li>
<li>The start and end size of the <code>Rc</code> must have the exact same size.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,15 @@
<!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="Attempts to cast the content type of a `Arc&#60;[T]&#62;`."><title>try_cast_slice_arc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice_arc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>slice_<wbr>arc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice_<wbr>arc</span>&nbsp;<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/bytemuck/allocation.rs.html#521-559">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice_arc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <code>Arc&lt;[T]&gt;</code>.</p>
<p>On failure you get back an error along with the starting <code>Arc&lt;[T]&gt;</code>.</p>
<p>The bounds on this function are the same as <a href="../fn.cast_mut.html" title="fn bytemuck::cast_mut"><code>cast_mut</code></a>, because a user
could call <code>Rc::get_unchecked_mut</code> on the output, which could be observable
in the input.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Arc&lt;[T]&gt;</code> must have the exact same
alignment.</li>
<li>The start and end content size in bytes of the <code>Arc&lt;[T]&gt;</code> must be the
exact same.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,12 @@
<!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="Attempts to cast the content type of a `Box&#60;[T]&#62;`."><title>try_cast_slice_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>slice_<wbr>box</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#203-237">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice_box&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <code>Box&lt;[T]&gt;</code>.</p>
<p>On failure you get back an error along with the starting <code>Box&lt;[T]&gt;</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Box&lt;[T]&gt;</code> must have the exact same
alignment.</li>
<li>The start and end content size in bytes of the <code>Box&lt;[T]&gt;</code> must be the
exact same.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,15 @@
<!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="Attempts to cast the content type of a `Rc&#60;[T]&#62;`."><title>try_cast_slice_rc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice_rc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>slice_<wbr>rc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice_<wbr>rc</span>&nbsp;<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/bytemuck/allocation.rs.html#453-491">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice_rc&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <code>Rc&lt;[T]&gt;</code>.</p>
<p>On failure you get back an error along with the starting <code>Rc&lt;[T]&gt;</code>.</p>
<p>The bounds on this function are the same as <a href="../fn.cast_mut.html" title="fn bytemuck::cast_mut"><code>cast_mut</code></a>, because a user
could call <code>Rc::get_unchecked_mut</code> on the output, which could be observable
in the input.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Rc&lt;[T]&gt;</code> must have the exact same
alignment.</li>
<li>The start and end content size in bytes of the <code>Rc&lt;[T]&gt;</code> must be the exact
same.</li>
</ul>
</div></details></section></div></main></body></html>

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="Attempts to cast the content type of a `Vec`."><title>try_cast_vec in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_vec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>vec</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>vec</span>&nbsp;<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/bytemuck/allocation.rs.html#257-316">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_vec&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
input: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;A&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;B&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;A&gt;)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Attempts to cast the content type of a <a href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec"><code>Vec</code></a>.</p>
<p>On failure you get back an error along with the starting <code>Vec</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>The start and end content type of the <code>Vec</code> must have the exact same
alignment.</li>
<li>The start and end content size in bytes of the <code>Vec</code> must be the exact
same.</li>
<li>The start and end capacity in bytes of the <code>Vec</code> must be the exact same.</li>
</ul>
</div></details></section></div></main></body></html>

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="Re-interprets `BoxBytes` as `Box&#60;T&#62;`."><title>try_from_box_bytes in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_from_box_bytes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>from_<wbr>box_<wbr>bytes</span>&nbsp;<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/bytemuck/allocation.rs.html#950-954">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_from_box_bytes&lt;T: FromBoxBytes + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(
input: <a class="struct" href="struct.BoxBytes.html" title="struct bytemuck::allocation::BoxBytes">BoxBytes</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;, (<a class="enum" href="../enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>, <a class="struct" href="struct.BoxBytes.html" title="struct bytemuck::allocation::BoxBytes">BoxBytes</a>)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>BoxBytes</code> as <code>Box&lt;T&gt;</code>.</p>
<p><code>T</code> must be either <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized"><code>Sized</code></a> + <a href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a>, or
<a href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html" title="primitive slice"><code>[U]</code></a> where <code>U: AnyBitPattern</code>.</p>
<p>Returns <code>Err</code>:</p>
<ul>
<li>If the input isnt aligned for <code>T</code>.</li>
<li>If <code>T: Sized</code> and the inputs length isnt exactly the size of <code>T</code>.</li>
<li>If <code>T = [U]</code> and the inputs length isnt exactly a multiple of the size
of <code>U</code>.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -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="Allocates a `Box&#60;T&#62;` with all of the contents being zeroed out."><title>try_zeroed_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_zeroed_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>zeroed_<wbr>box</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>zeroed_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#69-84">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_zeroed_box&lt;T: <a class="trait" href="../trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;() -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Allocates a <code>Box&lt;T&gt;</code> with all of the contents being zeroed out.</p>
<p>This uses the global allocator to create a zeroed allocation and <em>then</em>
turns it into a Box. In other words, its 100% assured that the zeroed data
wont be put temporarily on the stack. You can make a box of any size
without fear of a stack overflow.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<p>This fails if the allocation fails.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Allocates a `Box&#60;[T]&#62;` with all contents being zeroed out."><title>try_zeroed_slice_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_zeroed_slice_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>zeroed_<wbr>slice_<wbr>box</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>zeroed_<wbr>slice_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#125-145">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_zeroed_slice_box&lt;T: <a class="trait" href="../trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;(length: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Allocates a <code>Box&lt;[T]&gt;</code> with all contents being zeroed out.</p>
<p>This uses the global allocator to create a zeroed allocation and <em>then</em>
turns it into a Box. In other words, its 100% assured that the zeroed data
wont be put temporarily on the stack. You can make a box of any size
without fear of a stack overflow.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<p>This fails if the allocation fails, or if a layout cannot be calculated for
the allocation.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Allocates a `Vec&#60;T&#62;` of length and capacity exactly equal to `length` and all elements zeroed."><title>try_zeroed_vec in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_zeroed_vec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>zeroed_<wbr>vec</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">try_<wbr>zeroed_<wbr>vec</span>&nbsp;<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/bytemuck/allocation.rs.html#99-106">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_zeroed_vec&lt;T: <a class="trait" href="../trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;(length: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;T&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Allocates a <code>Vec&lt;T&gt;</code> of length and capacity exactly equal to <code>length</code> and
all elements zeroed.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<p>This fails if the allocation fails, or if a layout cannot be calculated for
the allocation.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="As `try_zeroed_box`, but unwraps for you."><title>zeroed_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">zeroed_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">zeroed_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#88-90">Source</a> </span></div><pre class="rust item-decl"><code>pub fn zeroed_box&lt;T: <a class="trait" href="../trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;() -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_zeroed_box.html" title="fn bytemuck::allocation::try_zeroed_box"><code>try_zeroed_box</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="As `try_zeroed_slice_box`, but unwraps for you."><title>zeroed_slice_box in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">zeroed_slice_box</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">zeroed_<wbr>slice_<wbr>box</span>&nbsp;<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/bytemuck/allocation.rs.html#148-150">Source</a> </span></div><pre class="rust item-decl"><code>pub fn zeroed_slice_box&lt;T: <a class="trait" href="../trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;(length: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_zeroed_slice_box.html" title="fn bytemuck::allocation::try_zeroed_slice_box"><code>try_zeroed_slice_box</code></a>, but unwraps for you.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="As `try_zeroed_vec` but unwraps for you"><title>zeroed_vec in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">zeroed_vec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Function <span class="fn">zeroed_<wbr>vec</span>&nbsp;<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/bytemuck/allocation.rs.html#109-111">Source</a> </span></div><pre class="rust item-decl"><code>pub fn zeroed_vec&lt;T: <a class="trait" href="../trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;(length: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="fn.try_zeroed_vec.html" title="fn bytemuck::allocation::try_zeroed_vec"><code>try_zeroed_vec</code></a> but unwraps for you</p>
</div></details></section></div></main></body></html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["box_bytes_of","cast_arc","cast_box","cast_rc","cast_slice_arc","cast_slice_box","cast_slice_rc","cast_vec","from_box_bytes","pod_collect_to_vec","try_cast_arc","try_cast_box","try_cast_rc","try_cast_slice_arc","try_cast_slice_box","try_cast_slice_rc","try_cast_vec","try_from_box_bytes","try_zeroed_box","try_zeroed_slice_box","try_zeroed_vec","zeroed_box","zeroed_slice_box","zeroed_vec"],"struct":["BoxBytes"],"trait":["TransparentWrapperAlloc"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,30 @@
<!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="An extension trait for `TransparentWrapper` and alloc types."><title>TransparentWrapperAlloc in bytemuck::allocation - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">TransparentWrapperAlloc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Transparent<wbr>Wrapper<wbr>Alloc</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.peel_arc" title="peel_arc">peel_arc</a></li><li><a href="#method.peel_box" title="peel_box">peel_box</a></li><li><a href="#method.peel_rc" title="peel_rc">peel_rc</a></li><li><a href="#method.peel_vec" title="peel_vec">peel_vec</a></li><li><a href="#method.wrap_arc" title="wrap_arc">wrap_arc</a></li><li><a href="#method.wrap_box" title="wrap_box">wrap_box</a></li><li><a href="#method.wrap_rc" title="wrap_rc">wrap_rc</a></li><li><a href="#method.wrap_vec" title="wrap_vec">wrap_vec</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><a href="index.html">In bytemuck::<wbr>allocation</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">allocation</a></div><h1>Trait <span class="trait">Transparent<wbr>Wrapper<wbr>Alloc</span>&nbsp;<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/bytemuck/allocation.rs.html#562-770">Source</a> </span></div><pre class="rust item-decl"><code>pub trait TransparentWrapperAlloc&lt;Inner: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;: <a class="trait" href="../trait.TransparentWrapper.html" title="trait bytemuck::TransparentWrapper">TransparentWrapper</a>&lt;Inner&gt; {
// Provided methods
fn <a href="#method.wrap_vec" class="fn">wrap_vec</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Self&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_box" class="fn">wrap_box</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_rc" class="fn">wrap_rc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_arc" class="fn">wrap_arc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_vec" class="fn">peel_vec</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Inner&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_box" class="fn">peel_box</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Inner&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_rc" class="fn">peel_rc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Inner&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_arc" class="fn">peel_arc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Inner&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An extension trait for <code>TransparentWrapper</code> and alloc types.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.wrap_vec" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#566-584">Source</a><h4 class="code-header">fn <a href="#method.wrap_vec" class="fn">wrap_vec</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert a vec of the inner type into a vec of the wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_box" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#589-613">Source</a><h4 class="code-header">fn <a href="#method.wrap_box" class="fn">wrap_box</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Convert a box to the inner type into a box to the wrapper
type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_rc" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#617-639">Source</a><h4 class="code-header">fn <a href="#method.wrap_rc" class="fn">wrap_rc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Convert an <a href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc"><code>Rc</code></a> to the inner type into an <code>Rc</code> to the wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_arc" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#644-666">Source</a><h4 class="code-header">fn <a href="#method.wrap_arc" class="fn">wrap_arc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Inner&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Convert an <a href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc"><code>Arc</code></a> to the inner type into an <code>Arc</code> to the wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_vec" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#669-687">Source</a><h4 class="code-header">fn <a href="#method.peel_vec" class="fn">peel_vec</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;Inner&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert a vec of the wrapper type into a vec of the inner type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_box" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#692-716">Source</a><h4 class="code-header">fn <a href="#method.peel_box" class="fn">peel_box</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Inner&gt;</h4></section></summary><div class="docblock"><p>Convert a box to the wrapper type into a box to the inner
type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_rc" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#720-742">Source</a><h4 class="code-header">fn <a href="#method.peel_rc" class="fn">peel_rc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Inner&gt;</h4></section></summary><div class="docblock"><p>Convert an <a href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc"><code>Rc</code></a> to the wrapper type into an <code>Rc</code> to the inner type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_arc" class="method"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#747-769">Source</a><h4 class="code-header">fn <a href="#method.peel_arc" class="fn">peel_arc</a>(s: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Inner&gt;</h4></section></summary><div class="docblock"><p>Convert an <a href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc"><code>Arc</code></a> to the wrapper type into an <code>Arc</code> to the inner type.</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.93.1/reference/items/traits.html#dyn-compatibility">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"><section id="impl-TransparentWrapperAlloc%3CI%3E-for-T" class="impl"><a class="src rightside" href="../../src/bytemuck/allocation.rs.html#772-775">Source</a><a href="#impl-TransparentWrapperAlloc%3CI%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;I: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../trait.TransparentWrapper.html" title="trait bytemuck::TransparentWrapper">TransparentWrapper</a>&lt;I&gt;&gt; <a class="trait" href="trait.TransparentWrapperAlloc.html" title="trait bytemuck::allocation::TransparentWrapperAlloc">TransparentWrapperAlloc</a>&lt;I&gt; for T</h3></section></div><script src="../../trait.impl/bytemuck/allocation/trait.TransparentWrapperAlloc.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.AnyBitPattern.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.AnyBitPattern.html">../../bytemuck/trait.AnyBitPattern.html</a>...</p>
<script>location.replace("../../bytemuck/trait.AnyBitPattern.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
<!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="Cast `A` into `B`"><title>cast in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">cast</span>&nbsp;<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/bytemuck/checked.rs.html#462-467">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(a: A) -&gt; B</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>A</code> into <code>B</code></p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<ul>
<li>This is like <a href="fn.try_cast.html" title="fn bytemuck::checked::try_cast"><code>try_cast</code></a>, but will panic on a size mismatch.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Cast `&#38;mut A` into `&#38;mut B`."><title>cast_mut in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">cast_<wbr>mut</span>&nbsp;<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/bytemuck/checked.rs.html#476-486">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_mut&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut A</a>,
) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut B</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;mut A</code> into <code>&amp;mut B</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_mut.html" title="fn bytemuck::checked::try_cast_mut"><code>try_cast_mut</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Cast `&#38;A` into `&#38;B`."><title>cast_ref in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_ref</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>ref</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">cast_<wbr>ref</span>&nbsp;<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/bytemuck/checked.rs.html#495-500">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_ref&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;A</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;B</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;A</code> into <code>&amp;B</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_ref.html" title="fn bytemuck::checked::try_cast_ref"><code>try_cast_ref</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Cast `&#38;[A]` into `&#38;[B]`."><title>cast_slice in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>slice</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">cast_<wbr>slice</span>&nbsp;<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/bytemuck/checked.rs.html#509-514">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(a: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;[A]</code> into <code>&amp;[B]</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_slice.html" title="fn bytemuck::checked::try_cast_slice"><code>try_cast_slice</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Cast `&#38;mut [A]` into `&#38;mut [B]`."><title>cast_slice_mut in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>slice_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">cast_<wbr>slice_<wbr>mut</span>&nbsp;<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/bytemuck/checked.rs.html#523-533">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice_mut&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
a: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_slice_mut.html" title="fn bytemuck::checked::try_cast_slice_mut"><code>try_cast_slice_mut</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `&#38;[u8]` as `&#38;T`."><title>from_bytes in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">from_bytes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">from_<wbr>bytes</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">from_<wbr>bytes</span>&nbsp;<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/bytemuck/checked.rs.html#421-426">Source</a> </span></div><pre class="rust item-decl"><code>pub fn from_bytes&lt;T: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(s: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;T</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_from_bytes.html" title="fn bytemuck::checked::try_from_bytes"><code>try_from_bytes</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `&#38;mut [u8]` as `&#38;mut T`."><title>from_bytes_mut in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">from_bytes_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">from_<wbr>bytes_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">from_<wbr>bytes_<wbr>mut</span>&nbsp;<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/bytemuck/checked.rs.html#435-440">Source</a> </span></div><pre class="rust item-decl"><code>pub fn from_bytes_mut&lt;T: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(s: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut T</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_from_bytes_mut.html" title="fn bytemuck::checked::try_from_bytes_mut"><code>try_from_bytes_mut</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Reads the slice into a `T` value."><title>pod_read_unaligned in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">pod_read_unaligned</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">pod_<wbr>read_<wbr>unaligned</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">pod_<wbr>read_<wbr>unaligned</span>&nbsp;<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/bytemuck/checked.rs.html#448-453">Source</a> </span></div><pre class="rust item-decl"><code>pub fn pod_read_unaligned&lt;T: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(bytes: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; T</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads the slice into a <code>T</code> value.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<ul>
<li>This is like <a href="fn.try_pod_read_unaligned.html" title="fn bytemuck::checked::try_pod_read_unaligned"><code>try_pod_read_unaligned</code></a> but will panic on failure.</li>
</ul>
</div></details></section></div></main></body></html>

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="Try to cast `A` into `B`."><title>try_cast in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>cast</span>&nbsp;<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/bytemuck/checked.rs.html#311-321">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
a: A,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to cast <code>A</code> into <code>B</code>.</p>
<p>Note that for this particular type of cast, alignment isnt a factor. The
input value is semantically copied into the function and then returned to a
new memory location which will have whatever the required alignment of the
output type is.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the types dont have the same size this fails.</li>
<li>If <code>a</code> contains an invalid bit pattern for <code>B</code> this fails.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="Try to convert a `&#38;mut A` into `&#38;mut B`."><title>try_cast_mut in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>mut</span>&nbsp;<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/bytemuck/checked.rs.html#347-360">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_mut&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a> + <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut A</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut B</a>, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert a <code>&amp;mut A</code> into <code>&amp;mut B</code>.</p>
<p>As <a href="fn.try_cast_ref.html" title="fn bytemuck::checked::try_cast_ref"><code>try_cast_ref</code></a>, but <code>mut</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Try to convert a `&#38;A` into `&#38;B`."><title>try_cast_ref in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_ref</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>ref</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>ref</span>&nbsp;<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/bytemuck/checked.rs.html#331-341">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_ref&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;A</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;B</a>, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert a <code>&amp;A</code> into <code>&amp;B</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the reference isnt aligned in the new type</li>
<li>If the source type and target type arent the same size.</li>
<li>If <code>a</code> contains an invalid bit pattern for <code>B</code> this fails.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,19 @@
<!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="Try to convert `&#38;[A]` into `&#38;[B]` (possibly with a change in length)."><title>try_cast_slice in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>slice</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice</span>&nbsp;<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/bytemuck/checked.rs.html#378-390">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
a: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert <code>&amp;[A]</code> into <code>&amp;[B]</code> (possibly with a change in length).</p>
<ul>
<li><code>input.as_ptr() as usize == output.as_ptr() as usize</code></li>
<li><code>input.len() * size_of::&lt;A&gt;() == output.len() * size_of::&lt;B&gt;()</code></li>
</ul>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the target type has a greater alignment requirement and the input slice
isnt aligned.</li>
<li>If the target element type is a different size from the current element
type, and the output slice wouldnt be a whole number of elements when
accounting for the size change (eg: 3 <code>u16</code> values is 1.5 <code>u32</code> values, so
thats a failure).</li>
<li>If any element of the converted slice would contain an invalid bit pattern
for <code>B</code> this fails.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Try to convert `&#38;mut [A]` into `&#38;mut [B]` (possibly with a change in length)."><title>try_cast_slice_mut in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice_<wbr>mut</span>&nbsp;<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/bytemuck/checked.rs.html#397-412">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice_mut&lt;A: <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a> + <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>&gt;(
a: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code> (possibly with a change in
length).</p>
<p>As <a href="fn.try_cast_slice.html" title="fn bytemuck::checked::try_cast_slice"><code>try_cast_slice</code></a>, but <code>&amp;mut</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Re-interprets `&#38;[u8]` as `&#38;T`."><title>try_from_bytes in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_from_bytes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>from_<wbr>bytes</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>from_<wbr>bytes</span>&nbsp;<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/bytemuck/checked.rs.html#249-259">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_from_bytes&lt;T: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
s: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;T</a>, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the slice isnt aligned for the new type</li>
<li>If the slices length isnt exactly the size of the new type</li>
<li>If the slice contains an invalid bit pattern for <code>T</code></li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Re-interprets `&#38;mut [u8]` as `&#38;mut T`."><title>try_from_bytes_mut in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_from_bytes_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>from_<wbr>bytes_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>from_<wbr>bytes_<wbr>mut</span>&nbsp;<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/bytemuck/checked.rs.html#269-279">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_from_bytes_mut&lt;T: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a> + <a class="trait" href="../trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>&gt;(
s: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut T</a>, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the slice isnt aligned for the new type</li>
<li>If the slices length isnt exactly the size of the new type</li>
<li>If the slice contains an invalid bit pattern for <code>T</code></li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Reads from the bytes as if they were a `T`."><title>try_pod_read_unaligned in bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_pod_read_unaligned</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>pod_<wbr>read_<wbr>unaligned</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bytemuck::<wbr>checked</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a>::<wbr><a href="index.html">checked</a></div><h1>Function <span class="fn">try_<wbr>pod_<wbr>read_<wbr>unaligned</span>&nbsp;<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/bytemuck/checked.rs.html#287-297">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_pod_read_unaligned&lt;T: <a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>&gt;(
bytes: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">CheckedCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads from the bytes as if they were a <code>T</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the <code>bytes</code> length is not equal to <code>size_of::&lt;T&gt;()</code>.</li>
<li>If the slice contains an invalid bit pattern for <code>T</code></li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Checked versions of the casting functions exposed in crate root that support `CheckedBitPattern` types."><title>bytemuck::checked - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module checked</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module checked</a></h2><h3><a href="#enums">Module Items</a></h3><ul class="block"><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">bytemuck</a></div><h1>Module <span>checked</span>&nbsp;<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/bytemuck/checked.rs.html#1-533">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Checked versions of the casting functions exposed in crate root
that support <a href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern"><code>CheckedBitPattern</code></a> types.</p>
</div></details><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.CheckedCastError.html" title="enum bytemuck::checked::CheckedCastError">Checked<wbr>Cast<wbr>Error</a></dt><dd>The things that can go wrong when casting between <a href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern"><code>CheckedBitPattern</code></a> data
forms.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">Checked<wbr>BitPattern</a></dt><dd>A marker trait that allows types that have some invalid bit patterns to be
used in places that otherwise require <a href="../trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a> or <a href="../trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> types by
performing a runtime check on a perticular set of bits. This is particularly
useful for types like fieldless (C-style) enums, <a href="https://doc.rust-lang.org/1.93.1/core/primitive.char.html" title="primitive char"><code>char</code></a>, bool, and
structs containing them.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.cast.html" title="fn bytemuck::checked::cast">cast</a></dt><dd>Cast <code>A</code> into <code>B</code></dd><dt><a class="fn" href="fn.cast_mut.html" title="fn bytemuck::checked::cast_mut">cast_<wbr>mut</a></dt><dd>Cast <code>&amp;mut A</code> into <code>&amp;mut B</code>.</dd><dt><a class="fn" href="fn.cast_ref.html" title="fn bytemuck::checked::cast_ref">cast_<wbr>ref</a></dt><dd>Cast <code>&amp;A</code> into <code>&amp;B</code>.</dd><dt><a class="fn" href="fn.cast_slice.html" title="fn bytemuck::checked::cast_slice">cast_<wbr>slice</a></dt><dd>Cast <code>&amp;[A]</code> into <code>&amp;[B]</code>.</dd><dt><a class="fn" href="fn.cast_slice_mut.html" title="fn bytemuck::checked::cast_slice_mut">cast_<wbr>slice_<wbr>mut</a></dt><dd>Cast <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code>.</dd><dt><a class="fn" href="fn.from_bytes.html" title="fn bytemuck::checked::from_bytes">from_<wbr>bytes</a></dt><dd>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</dd><dt><a class="fn" href="fn.from_bytes_mut.html" title="fn bytemuck::checked::from_bytes_mut">from_<wbr>bytes_<wbr>mut</a></dt><dd>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</dd><dt><a class="fn" href="fn.pod_read_unaligned.html" title="fn bytemuck::checked::pod_read_unaligned">pod_<wbr>read_<wbr>unaligned</a></dt><dd>Reads the slice into a <code>T</code> value.</dd><dt><a class="fn" href="fn.try_cast.html" title="fn bytemuck::checked::try_cast">try_<wbr>cast</a></dt><dd>Try to cast <code>A</code> into <code>B</code>.</dd><dt><a class="fn" href="fn.try_cast_mut.html" title="fn bytemuck::checked::try_cast_mut">try_<wbr>cast_<wbr>mut</a></dt><dd>Try to convert a <code>&amp;mut A</code> into <code>&amp;mut B</code>.</dd><dt><a class="fn" href="fn.try_cast_ref.html" title="fn bytemuck::checked::try_cast_ref">try_<wbr>cast_<wbr>ref</a></dt><dd>Try to convert a <code>&amp;A</code> into <code>&amp;B</code>.</dd><dt><a class="fn" href="fn.try_cast_slice.html" title="fn bytemuck::checked::try_cast_slice">try_<wbr>cast_<wbr>slice</a></dt><dd>Try to convert <code>&amp;[A]</code> into <code>&amp;[B]</code> (possibly with a change in length).</dd><dt><a class="fn" href="fn.try_cast_slice_mut.html" title="fn bytemuck::checked::try_cast_slice_mut">try_<wbr>cast_<wbr>slice_<wbr>mut</a></dt><dd>Try to convert <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code> (possibly with a change in
length).</dd><dt><a class="fn" href="fn.try_from_bytes.html" title="fn bytemuck::checked::try_from_bytes">try_<wbr>from_<wbr>bytes</a></dt><dd>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</dd><dt><a class="fn" href="fn.try_from_bytes_mut.html" title="fn bytemuck::checked::try_from_bytes_mut">try_<wbr>from_<wbr>bytes_<wbr>mut</a></dt><dd>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</dd><dt><a class="fn" href="fn.try_pod_read_unaligned.html" title="fn bytemuck::checked::try_pod_read_unaligned">try_<wbr>pod_<wbr>read_<wbr>unaligned</a></dt><dd>Reads from the bytes as if they were a <code>T</code>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["CheckedCastError"],"fn":["cast","cast_mut","cast_ref","cast_slice","cast_slice_mut","from_bytes","from_bytes_mut","pod_read_unaligned","try_cast","try_cast_mut","try_cast_ref","try_cast_slice","try_cast_slice_mut","try_from_bytes","try_from_bytes_mut","try_pod_read_unaligned"],"trait":["CheckedBitPattern"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.Contiguous.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.Contiguous.html">../../bytemuck/trait.Contiguous.html</a>...</p>
<script>location.replace("../../bytemuck/trait.Contiguous.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `&#38;T` as `&#38;[u8]`."><title>bytes_of in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">bytes_of</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">bytes_<wbr>of</span>&nbsp;<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/bytemuck/lib.rs.html#280-282">Source</a> </span></div><pre class="rust item-decl"><code>pub fn bytes_of&lt;T: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>&gt;(t: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;T</a>) -&gt; &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;T</code> as <code>&amp;[u8]</code>.</p>
<p>Any ZST becomes an empty slice, and in that case the pointer value of that
empty slice might not match the pointer value of the input reference.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `&#38;mut T` as `&#38;mut [u8]`."><title>bytes_of_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">bytes_of_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">bytes_<wbr>of_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#289-291">Source</a> </span></div><pre class="rust item-decl"><code>pub fn bytes_of_mut&lt;T: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(t: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut T</a>) -&gt; &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;mut T</code> as <code>&amp;mut [u8]</code>.</p>
<p>Any ZST becomes an empty slice, and in that case the pointer value of that
empty slice might not match the pointer value of the input reference.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Cast `A` into `B`"><title>cast in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">cast</span>&nbsp;<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/bytemuck/lib.rs.html#373-375">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(a: A) -&gt; B</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>A</code> into <code>B</code></p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<ul>
<li>This is like <a href="fn.try_cast.html" title="fn bytemuck::try_cast"><code>try_cast</code></a>, but will panic on a size mismatch.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Cast `&#38;mut A` into `&#38;mut B`."><title>cast_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">cast_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#384-388">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_mut&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut A</a>,
) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut B</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;mut A</code> into <code>&amp;mut B</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_mut.html" title="fn bytemuck::try_cast_mut"><code>try_cast_mut</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Cast `&#38;A` into `&#38;B`."><title>cast_ref in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_ref</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>ref</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">cast_<wbr>ref</span>&nbsp;<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/bytemuck/lib.rs.html#397-399">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_ref&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;A</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;B</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;A</code> into <code>&amp;B</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_ref.html" title="fn bytemuck::try_cast_ref"><code>try_cast_ref</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Cast `&#38;[A]` into `&#38;[B]`."><title>cast_slice in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>slice</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">cast_<wbr>slice</span>&nbsp;<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/bytemuck/lib.rs.html#408-410">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(a: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;[A]</code> into <code>&amp;[B]</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_slice.html" title="fn bytemuck::try_cast_slice"><code>try_cast_slice</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Cast `&#38;mut [A]` into `&#38;mut [B]`."><title>cast_slice_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">cast_slice_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">cast_<wbr>slice_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">cast_<wbr>slice_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#419-426">Source</a> </span></div><pre class="rust item-decl"><code>pub fn cast_slice_mut&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
a: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cast <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is <a href="fn.try_cast_slice_mut.html" title="fn bytemuck::try_cast_slice_mut"><code>try_cast_slice_mut</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Fill all bytes of `slice` with zeroes (see `Zeroable`)."><title>fill_zeroes in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">fill_zeroes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">fill_<wbr>zeroes</span>&nbsp;<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/bytemuck/lib.rs.html#560-570">Source</a> </span></div><pre class="rust item-decl"><code>pub fn fill_zeroes&lt;T: <a class="trait" href="trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;(slice: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Fill all bytes of <code>slice</code> with zeroes (see <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>).</p>
<p>This is similar to <code>slice.fill(Zeroable::zeroed())</code>, but guarantees that any
padding bytes in <code>slice</code> are zeroed as well.</p>
<p>See also <a href="fn.write_zeroes.html" title="fn bytemuck::write_zeroes"><code>write_zeroes</code></a>, which zeroes all bytes of a single value rather
than a slice.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `&#38;[u8]` as `&#38;T`."><title>from_bytes in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">from_bytes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">from_<wbr>bytes</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">from_<wbr>bytes</span>&nbsp;<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/bytemuck/lib.rs.html#300-302">Source</a> </span></div><pre class="rust item-decl"><code>pub fn from_bytes&lt;T: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(s: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;T</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is like <a href="fn.try_from_bytes.html" title="fn bytemuck::try_from_bytes"><code>try_from_bytes</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Re-interprets `&#38;mut [u8]` as `&#38;mut T`."><title>from_bytes_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">from_bytes_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">from_<wbr>bytes_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">from_<wbr>bytes_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#311-313">Source</a> </span></div><pre class="rust item-decl"><code>pub fn from_bytes_mut&lt;T: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(s: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut T</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<p>This is like <a href="fn.try_from_bytes_mut.html" title="fn bytemuck::try_from_bytes_mut"><code>try_from_bytes_mut</code></a> but will panic on error.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="As `align_to`, but safe because of the `Pod` bound."><title>pod_align_to in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">pod_align_to</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">pod_<wbr>align_<wbr>to</span>&nbsp;<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/bytemuck/lib.rs.html#431-435">Source</a> </span></div><pre class="rust item-decl"><code>pub fn pod_align_to&lt;T: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, U: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
vals: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>,
) -&gt; (&amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[U]</a>, &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.align_to"><code>align_to</code></a>,
but safe because of the <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> bound.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="As `align_to_mut`, but safe because of the `Pod` bound."><title>pod_align_to_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">pod_align_to_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">pod_<wbr>align_<wbr>to_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#440-447">Source</a> </span></div><pre class="rust item-decl"><code>pub fn pod_align_to_mut&lt;T: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, U: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
vals: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>,
) -&gt; (&amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>, &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[U]</a>, &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[T]</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.align_to_mut"><code>align_to_mut</code></a>,
but safe because of the <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> bound.</p>
</div></details></section></div></main></body></html>

View File

@@ -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="Reads the slice into a `T` value."><title>pod_read_unaligned in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">pod_read_unaligned</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">pod_<wbr>read_<wbr>unaligned</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">pod_<wbr>read_<wbr>unaligned</span>&nbsp;<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/bytemuck/lib.rs.html#338-340">Source</a> </span></div><pre class="rust item-decl"><code>pub fn pod_read_unaligned&lt;T: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(bytes: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; T</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads the slice into a <code>T</code> value.</p>
<p>Unlike <a href="fn.from_bytes.html" title="fn bytemuck::from_bytes"><code>from_bytes</code></a>, the slice doesnt need to respect alignment of <code>T</code>,
only sizes must match.</p>
<h3 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h3>
<ul>
<li>This is like <code>try_pod_read_unaligned</code> but will panic on failure.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Try to cast `A` into `B`."><title>try_cast in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>cast</span>&nbsp;<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/bytemuck/lib.rs.html#460-464">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(a: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to cast <code>A</code> into <code>B</code>.</p>
<p>Note that for this particular type of cast, alignment isnt a factor. The
input value is semantically copied into the function and then returned to a
new memory location which will have whatever the required alignment of the
output type is.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the types dont have the same size this fails.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="Try to convert a `&#38;mut A` into `&#38;mut B`."><title>try_cast_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#483-490">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_mut&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut A</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut B</a>, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert a <code>&amp;mut A</code> into <code>&amp;mut B</code>.</p>
<p>As <a href="fn.try_cast_ref.html" title="fn bytemuck::try_cast_ref"><code>try_cast_ref</code></a>, but <code>mut</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Try to convert a `&#38;A` into `&#38;B`."><title>try_cast_ref in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_ref</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>ref</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>ref</span>&nbsp;<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/bytemuck/lib.rs.html#473-477">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_ref&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;A</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;B</a>, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert a <code>&amp;A</code> into <code>&amp;B</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the reference isnt aligned in the new type</li>
<li>If the source type and target type arent the same size.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,19 @@
<!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="Try to convert `&#38;[A]` into `&#38;[B]` (possibly with a change in length)."><title>try_cast_slice in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>cast_<wbr>slice</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice</span>&nbsp;<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/bytemuck/lib.rs.html#508-512">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a>, B: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
a: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert <code>&amp;[A]</code> into <code>&amp;[B]</code> (possibly with a change in length).</p>
<ul>
<li><code>input.as_ptr() as usize == output.as_ptr() as usize</code></li>
<li><code>input.len() * size_of::&lt;A&gt;() == output.len() * size_of::&lt;B&gt;()</code></li>
</ul>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the target type has a greater alignment requirement and the input slice
isnt aligned.</li>
<li>If the target element type is a different size from the current element
type, and the output slice wouldnt be a whole number of elements when
accounting for the size change (eg: 3 <code>u16</code> values is 1.5 <code>u32</code> values, so
thats a failure).</li>
<li>Similarly, you cant convert between a <a href="https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts">ZST</a>
and a non-ZST.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Try to convert `&#38;mut [A]` into `&#38;mut [B]` (possibly with a change in length)."><title>try_cast_slice_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_cast_slice_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>cast_<wbr>slice_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#519-526">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_cast_slice_mut&lt;A: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>, B: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
a: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[A]</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[B]</a>, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Try to convert <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code> (possibly with a change in
length).</p>
<p>As <a href="fn.try_cast_slice.html" title="fn bytemuck::try_cast_slice"><code>try_cast_slice</code></a>, but <code>&amp;mut</code>.</p>
</div></details></section></div></main></body></html>

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="Re-interprets `&#38;[u8]` as `&#38;T`."><title>try_from_bytes in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_from_bytes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>from_<wbr>bytes</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>from_<wbr>bytes</span>&nbsp;<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/bytemuck/lib.rs.html#349-351">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_from_bytes&lt;T: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(s: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;T</a>, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the slice isnt aligned for the new type</li>
<li>If the slices length isnt exactly the size of the new type</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Re-interprets `&#38;mut [u8]` as `&#38;mut T`."><title>try_from_bytes_mut in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_from_bytes_mut</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>from_<wbr>bytes_<wbr>mut</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>from_<wbr>bytes_<wbr>mut</span>&nbsp;<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/bytemuck/lib.rs.html#360-364">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_from_bytes_mut&lt;T: <a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a> + <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
s: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut T</a>, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the slice isnt aligned for the new type</li>
<li>If the slices length isnt exactly the size of the new type</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Reads from the bytes as if they were a `T`."><title>try_pod_read_unaligned in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">try_pod_read_unaligned</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>pod_<wbr>read_<wbr>unaligned</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#failure" title="Failure">Failure</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">try_<wbr>pod_<wbr>read_<wbr>unaligned</span>&nbsp;<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/bytemuck/lib.rs.html#323-327">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_pod_read_unaligned&lt;T: <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a>&gt;(
bytes: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCastError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads from the bytes as if they were a <code>T</code>.</p>
<p>Unlike <a href="fn.from_bytes.html" title="fn bytemuck::from_bytes"><code>from_bytes</code></a>, the slice doesnt need to respect alignment of <code>T</code>,
only sizes must match.</p>
<h3 id="failure"><a class="doc-anchor" href="#failure">§</a>Failure</h3>
<ul>
<li>If the <code>bytes</code> length is not equal to <code>size_of::&lt;T&gt;()</code>.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="Fill all bytes of `target` with zeroes (see `Zeroable`)."><title>write_zeroes in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">write_zeroes</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Function <span class="fn">write_<wbr>zeroes</span>&nbsp;<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/bytemuck/lib.rs.html#535-550">Source</a> </span></div><pre class="rust item-decl"><code>pub fn write_zeroes&lt;T: <a class="trait" href="trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>&gt;(target: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut T</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Fill all bytes of <code>target</code> with zeroes (see <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>).</p>
<p>This is similar to <code>*target = Zeroable::zeroed()</code>, but guarantees that any
padding bytes in <code>target</code> are zeroed as well.</p>
<p>See also <a href="fn.fill_zeroes.html" title="fn bytemuck::fill_zeroes"><code>fill_zeroes</code></a>, if you have a slice rather than a single value.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,77 @@
<!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="This crate gives small utilities for casting between plain data types."><title>bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">Crate bytemuck</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</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="#basics" title="Basics">Basics</a></li><li><a href="#failures" title="Failures">Failures</a></li><li><a href="#using-your-own-types" title="Using Your Own Types">Using Your Own Types</a></li><li><a href="#cargo-features" title="Cargo Features">Cargo Features</a></li><li><a href="#related-crates" title="Related Crates">Related Crates</a></li></ul><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>bytemuck</span>&nbsp;<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/bytemuck/lib.rs.html#1-578">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This crate gives small utilities for casting between plain data types.</p>
<h3 id="basics"><a class="doc-anchor" href="#basics">§</a>Basics</h3>
<p>Data comes in five basic forms in Rust, so we have five basic casting
functions:</p>
<ul>
<li><code>T</code> uses <a href="fn.cast.html" title="fn bytemuck::cast"><code>cast</code></a></li>
<li><code>&amp;T</code> uses <a href="fn.cast_ref.html" title="fn bytemuck::cast_ref"><code>cast_ref</code></a></li>
<li><code>&amp;mut T</code> uses <a href="fn.cast_mut.html" title="fn bytemuck::cast_mut"><code>cast_mut</code></a></li>
<li><code>&amp;[T]</code> uses <a href="fn.cast_slice.html" title="fn bytemuck::cast_slice"><code>cast_slice</code></a></li>
<li><code>&amp;mut [T]</code> uses <a href="fn.cast_slice_mut.html" title="fn bytemuck::cast_slice_mut"><code>cast_slice_mut</code></a></li>
</ul>
<p>Depending on the function, the <a href="trait.NoUninit.html" title="trait bytemuck::NoUninit"><code>NoUninit</code></a> and/or <a href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a> traits
are used to maintain memory safety.</p>
<p><strong>Historical Note:</strong> When the crate first started the <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> trait was used
instead, and so you may hear people refer to that, but it has the strongest
requirements and people eventually wanted the more fine-grained system, so
here we are. All types that impl <code>Pod</code> have a blanket impl to also support
<code>NoUninit</code> and <code>AnyBitPattern</code>. The traits unfortunately do not have a
perfectly clean hierarchy for semver reasons.</p>
<h3 id="failures"><a class="doc-anchor" href="#failures">§</a>Failures</h3>
<p>Some casts will never fail, and other casts might fail.</p>
<ul>
<li><code>cast::&lt;u32, f32&gt;</code> always works (and <a href="https://doc.rust-lang.org/1.93.1/core/primitive.f32.html#method.from_bits" title="associated function f32::from_bits"><code>f32::from_bits</code></a>).</li>
<li><code>cast_ref::&lt;[u8; 4], u32&gt;</code> might fail if the specific array reference
given at runtime doesnt have alignment 4.</li>
</ul>
<p>In addition to the “normal” forms of each function, which will panic on
invalid input, theres also <code>try_</code> versions which will return a <code>Result</code>.</p>
<p>If you would like to statically ensure that a cast will work at runtime you
can use the <code>must_cast</code> crate feature and the <code>must_</code> casting functions. A
“must cast” that cant be statically known to be valid will cause a
compilation error (and sometimes a very hard to read compilation error).</p>
<h3 id="using-your-own-types"><a class="doc-anchor" href="#using-your-own-types">§</a>Using Your Own Types</h3>
<p>All the functions listed above are guarded by the <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> trait, which is a
sub-trait of the <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a> trait.</p>
<p>If you enable the crates <code>derive</code> feature then these traits can be derived
on your own types. The derive macros will perform the necessary checks on
your type declaration, and trigger an error if your type does not qualify.</p>
<p>The derive macros might not cover all edge cases, and sometimes they will
error when actually everything is fine. As a last resort you can impl these
traits manually. However, these traits are <code>unsafe</code>, and you should
carefully read the requirements before using a manual implementation.</p>
<h3 id="cargo-features"><a class="doc-anchor" href="#cargo-features">§</a>Cargo Features</h3>
<p>The crate supports Rust 1.34 when no features are enabled, and so theres
cargo features for thing that you might consider “obvious”.</p>
<p>The cargo features <strong>do not</strong> promise any particular MSRV, and they may
increase their MSRV in new versions.</p>
<ul>
<li><code>derive</code>: Provide derive macros for the various traits.</li>
<li><code>extern_crate_alloc</code>: Provide utilities for <code>alloc</code> related types such as
Box and Vec.</li>
<li><code>zeroable_maybe_uninit</code> and <code>zeroable_atomics</code>: Provide more <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>
impls.</li>
<li><code>pod_saturating</code>: Provide more <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> and <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a> impls.</li>
<li><code>wasm_simd</code> and <code>aarch64_simd</code>: Support more SIMD types.</li>
<li><code>min_const_generics</code>: Provides appropriate impls for arrays of all lengths
instead of just for a select list of array lengths.</li>
<li><code>must_cast</code>: Provides the <code>must_</code> functions, which will compile error if
the requested cast cant be statically verified.</li>
<li><code>const_zeroed</code>: Provides a const version of the <code>zeroed</code> function.</li>
</ul>
<h3 id="related-crates"><a class="doc-anchor" href="#related-crates">§</a>Related Crates</h3>
<ul>
<li><a href="https://docs.rs/pack1"><code>pack1</code></a>, which contains <code>bytemuck</code>-compatible
packed little-endian, big-endian and native-endian integer and floating
point number types.</li>
</ul>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.CheckedBitPattern"><code>pub use checked::<a class="trait" href="checked/trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern">CheckedBitPattern</a>;</code></dt><dt><code>pub use <a class="mod" href="allocation/index.html" title="mod bytemuck::allocation">allocation</a>::*;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="allocation/index.html" title="mod bytemuck::allocation">allocation</a></dt><dd>Stuff to boost things in the <code>alloc</code> crate.</dd><dt><a class="mod" href="checked/index.html" title="mod bytemuck::checked">checked</a></dt><dd>Checked versions of the casting functions exposed in crate root
that support <a href="checked/trait.CheckedBitPattern.html" title="trait bytemuck::checked::CheckedBitPattern"><code>CheckedBitPattern</code></a> types.</dd></dl><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro.offset_of.html" title="macro bytemuck::offset_of">offset_<wbr>of</a></dt><dd>Find the offset in bytes of the given <code>$field</code> of <code>$Type</code>. Requires an
already initialized <code>$instance</code> value to work with.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.PodCastError.html" title="enum bytemuck::PodCastError">PodCast<wbr>Error</a></dt><dd>The things that can go wrong when casting between <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> data forms.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBit<wbr>Pattern</a></dt><dd>Marker trait for “plain old data” types that are valid for any bit pattern.</dd><dt><a class="trait" href="trait.Contiguous.html" title="trait bytemuck::Contiguous">Contiguous</a></dt><dd>A trait indicating that:</dd><dt><a class="trait" href="trait.NoUninit.html" title="trait bytemuck::NoUninit">NoUninit</a></dt><dd>Marker trait for “plain old data” types with no uninit (or padding) bytes.</dd><dt><a class="trait" href="trait.Pod.html" title="trait bytemuck::Pod">Pod</a></dt><dd>Marker trait for “plain old data”.</dd><dt><a class="trait" href="trait.PodInOption.html" title="trait bytemuck::PodInOption">PodIn<wbr>Option</a></dt><dd>Trait for types which are <a href="trait.Pod.html" title="trait bytemuck::Pod">Pod</a> when wrapped in
<a href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>.</dd><dt><a class="trait" href="trait.TransparentWrapper.html" title="trait bytemuck::TransparentWrapper">Transparent<wbr>Wrapper</a></dt><dd>A trait which indicates that a type is a <code>#[repr(transparent)]</code> wrapper
around the <code>Inner</code> value.</dd><dt><a class="trait" href="trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a></dt><dd>Trait for types that can be safely created with
<a href="https://doc.rust-lang.org/1.93.1/core/mem/fn.zeroed.html" title="fn core::mem::zeroed"><code>zeroed</code></a>.</dd><dt><a class="trait" href="trait.ZeroableInOption.html" title="trait bytemuck::ZeroableInOption">Zeroable<wbr>InOption</a></dt><dd>Trait for types which are <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a> when wrapped in
<a href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.bytes_of.html" title="fn bytemuck::bytes_of">bytes_<wbr>of</a></dt><dd>Re-interprets <code>&amp;T</code> as <code>&amp;[u8]</code>.</dd><dt><a class="fn" href="fn.bytes_of_mut.html" title="fn bytemuck::bytes_of_mut">bytes_<wbr>of_<wbr>mut</a></dt><dd>Re-interprets <code>&amp;mut T</code> as <code>&amp;mut [u8]</code>.</dd><dt><a class="fn" href="fn.cast.html" title="fn bytemuck::cast">cast</a></dt><dd>Cast <code>A</code> into <code>B</code></dd><dt><a class="fn" href="fn.cast_mut.html" title="fn bytemuck::cast_mut">cast_<wbr>mut</a></dt><dd>Cast <code>&amp;mut A</code> into <code>&amp;mut B</code>.</dd><dt><a class="fn" href="fn.cast_ref.html" title="fn bytemuck::cast_ref">cast_<wbr>ref</a></dt><dd>Cast <code>&amp;A</code> into <code>&amp;B</code>.</dd><dt><a class="fn" href="fn.cast_slice.html" title="fn bytemuck::cast_slice">cast_<wbr>slice</a></dt><dd>Cast <code>&amp;[A]</code> into <code>&amp;[B]</code>.</dd><dt><a class="fn" href="fn.cast_slice_mut.html" title="fn bytemuck::cast_slice_mut">cast_<wbr>slice_<wbr>mut</a></dt><dd>Cast <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code>.</dd><dt><a class="fn" href="fn.fill_zeroes.html" title="fn bytemuck::fill_zeroes">fill_<wbr>zeroes</a></dt><dd>Fill all bytes of <code>slice</code> with zeroes (see <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>).</dd><dt><a class="fn" href="fn.from_bytes.html" title="fn bytemuck::from_bytes">from_<wbr>bytes</a></dt><dd>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</dd><dt><a class="fn" href="fn.from_bytes_mut.html" title="fn bytemuck::from_bytes_mut">from_<wbr>bytes_<wbr>mut</a></dt><dd>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</dd><dt><a class="fn" href="fn.pod_align_to.html" title="fn bytemuck::pod_align_to">pod_<wbr>align_<wbr>to</a></dt><dd>As <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.align_to"><code>align_to</code></a>,
but safe because of the <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> bound.</dd><dt><a class="fn" href="fn.pod_align_to_mut.html" title="fn bytemuck::pod_align_to_mut">pod_<wbr>align_<wbr>to_<wbr>mut</a></dt><dd>As <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.align_to_mut"><code>align_to_mut</code></a>,
but safe because of the <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> bound.</dd><dt><a class="fn" href="fn.pod_read_unaligned.html" title="fn bytemuck::pod_read_unaligned">pod_<wbr>read_<wbr>unaligned</a></dt><dd>Reads the slice into a <code>T</code> value.</dd><dt><a class="fn" href="fn.try_cast.html" title="fn bytemuck::try_cast">try_<wbr>cast</a></dt><dd>Try to cast <code>A</code> into <code>B</code>.</dd><dt><a class="fn" href="fn.try_cast_mut.html" title="fn bytemuck::try_cast_mut">try_<wbr>cast_<wbr>mut</a></dt><dd>Try to convert a <code>&amp;mut A</code> into <code>&amp;mut B</code>.</dd><dt><a class="fn" href="fn.try_cast_ref.html" title="fn bytemuck::try_cast_ref">try_<wbr>cast_<wbr>ref</a></dt><dd>Try to convert a <code>&amp;A</code> into <code>&amp;B</code>.</dd><dt><a class="fn" href="fn.try_cast_slice.html" title="fn bytemuck::try_cast_slice">try_<wbr>cast_<wbr>slice</a></dt><dd>Try to convert <code>&amp;[A]</code> into <code>&amp;[B]</code> (possibly with a change in length).</dd><dt><a class="fn" href="fn.try_cast_slice_mut.html" title="fn bytemuck::try_cast_slice_mut">try_<wbr>cast_<wbr>slice_<wbr>mut</a></dt><dd>Try to convert <code>&amp;mut [A]</code> into <code>&amp;mut [B]</code> (possibly with a change in
length).</dd><dt><a class="fn" href="fn.try_from_bytes.html" title="fn bytemuck::try_from_bytes">try_<wbr>from_<wbr>bytes</a></dt><dd>Re-interprets <code>&amp;[u8]</code> as <code>&amp;T</code>.</dd><dt><a class="fn" href="fn.try_from_bytes_mut.html" title="fn bytemuck::try_from_bytes_mut">try_<wbr>from_<wbr>bytes_<wbr>mut</a></dt><dd>Re-interprets <code>&amp;mut [u8]</code> as <code>&amp;mut T</code>.</dd><dt><a class="fn" href="fn.try_pod_read_unaligned.html" title="fn bytemuck::try_pod_read_unaligned">try_<wbr>pod_<wbr>read_<wbr>unaligned</a></dt><dd>Reads from the bytes as if they were a <code>T</code>.</dd><dt><a class="fn" href="fn.write_zeroes.html" title="fn bytemuck::write_zeroes">write_<wbr>zeroes</a></dt><dd>Fill all bytes of <code>target</code> with zeroes (see <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>).</dd></dl></section></div></main></body></html>

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>

View File

@@ -0,0 +1,85 @@
<!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="Find the offset in bytes of the given `$field` of `$Type`. Requires an already initialized `$instance` value to work with."><title>offset_of in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">offset_of</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</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><ul><li><a href="#3-arg-usage" title="3-arg Usage">3-arg Usage</a></li><li><a href="#2-arg-usage" title="2-arg Usage">2-arg Usage</a></li></ul></li><li><a href="#usage-with-reprpacked-structs" title="Usage with `#[repr(packed)]` structs">Usage with <code>#[repr(packed)]</code> structs</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Macro <span class="macro">offset_<wbr>of</span>&nbsp;<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/bytemuck/offset_of.rs.html#115-135">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! offset_of {
($instance:expr, $Type:path, $field:tt) =&gt; { ... };
($Type:path, $field:tt) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Find the offset in bytes of the given <code>$field</code> of <code>$Type</code>. Requires an
already initialized <code>$instance</code> value to work with.</p>
<p>This is similar to the macro from <a href="https://docs.rs/memoffset"><code>memoffset</code></a>,
however it uses no <code>unsafe</code> code.</p>
<p>This macro has a 3-argument and 2-argument version.</p>
<ul>
<li>In the 3-arg version you specify an instance of the type, the type itself,
and the field name.</li>
<li>In the 2-arg version the macro will call the <a href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html#tymethod.default" title="associated function core::default::Default::default"><code>default</code></a>
method to make a temporary instance of the type for you.</li>
</ul>
<p>The output of this macro is the byte offset of the field (as a <code>usize</code>). The
calculations of the macro are fixed across the entire program, but if the
type used is <code>repr(Rust)</code> then theyre <em>not</em> fixed across compilations or
compilers.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3><h4 id="3-arg-usage"><a class="doc-anchor" href="#3-arg-usage">§</a>3-arg Usage</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// enums can't derive default, and for this example we don't pick one
</span><span class="kw">enum </span>MyExampleEnum {
A,
B,
C,
}
<span class="comment">// so now our struct here doesn't have Default
</span><span class="attr">#[repr(C)]
</span><span class="kw">struct </span>MyNotDefaultType {
<span class="kw">pub </span>counter: i32,
<span class="kw">pub </span>some_field: MyExampleEnum,
}
<span class="comment">// but we provide an instance of the type and it's all good.
</span><span class="kw">let </span>val = MyNotDefaultType { counter: <span class="number">5</span>, some_field: MyExampleEnum::A };
<span class="macro">assert_eq!</span>(<span class="macro">offset_of!</span>(val, MyNotDefaultType, some_field), <span class="number">4</span>);</code></pre></div><h4 id="2-arg-usage"><a class="doc-anchor" href="#2-arg-usage">§</a>2-arg Usage</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[derive(Default)]
#[repr(C)]
</span><span class="kw">struct </span>Vertex {
<span class="kw">pub </span>loc: [f32; <span class="number">3</span>],
<span class="kw">pub </span>color: [f32; <span class="number">3</span>],
}
<span class="comment">// if the type impls Default the macro can make its own default instance.
</span><span class="macro">assert_eq!</span>(<span class="macro">offset_of!</span>(Vertex, loc), <span class="number">0</span>);
<span class="macro">assert_eq!</span>(<span class="macro">offset_of!</span>(Vertex, color), <span class="number">12</span>);</code></pre></div><h2 id="usage-with-reprpacked-structs"><a class="doc-anchor" href="#usage-with-reprpacked-structs">§</a>Usage with <code>#[repr(packed)]</code> structs</h2>
<p>Attempting to compute the offset of a <code>#[repr(packed)]</code> struct with
<code>bytemuck::offset_of!</code> requires an <code>unsafe</code> block. We hope to relax this in
the future, but currently it is required to work around a soundness hole in
Rust (See <a href="https://github.com/rust-lang/rust/issues/27060">rust-lang/rust#27060</a>).</p>
<p style="background:rgba(255,181,77,0.16);padding:0.75em;">
<strong>Warning:</strong> This is only true for versions of bytemuck >
1.4.0. Previous versions of
<code style="background:rgba(41,24,0,0.1);">bytemuck::offset_of!</code>
will only emit a warning when used on the field of a packed struct in safe
code, which can lead to unsoundness.
</p>
<p>For example, the following will fail to compile:</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="attr">#[repr(C, packed)]
#[derive(Default)]
</span><span class="kw">struct </span>Example {
field: u32,
}
<span class="comment">// Doesn't compile:
</span><span class="kw">let </span>_offset = <span class="macro">bytemuck::offset_of!</span>(Example, field);</code></pre></div>
<p>While the error message this generates will mention the
<code>safe_packed_borrows</code> lint, the macro will still fail to compile even if
that lint is <code>#[allow]</code>ed:</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="comment">// Still doesn't compile:
</span><span class="attr">#[allow(safe_packed_borrows)]
</span>{
<span class="kw">let </span>_offset = <span class="macro">bytemuck::offset_of!</span>(Example, field);
}</code></pre></div>
<p>This <em>can</em> be worked around by using <code>unsafe</code>, but it is only sound to do so
if you can guarantee that taking a reference to the field is sound.</p>
<p>In practice, this means it only works for fields of align(1) types, or if
you know the fields offset in advance (defeating the point of <code>offset_of</code>)
and can prove that the structs alignment and the fields offset are enough
to prove the fields alignment.</p>
<p>Once the <code>raw_ref</code> macros are available, a future version of this crate will
use them to lift the limitations of packed structs. For the duration of the
<code>1.x</code> version of this crate that will be behind an on-by-default cargo
feature (to maintain minimum rust version support).</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.NoUninit.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.NoUninit.html">../../bytemuck/trait.NoUninit.html</a>...</p>
<script>location.replace("../../bytemuck/trait.NoUninit.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.Pod.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.Pod.html">../../bytemuck/trait.Pod.html</a>...</p>
<script>location.replace("../../bytemuck/trait.Pod.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.PodInOption.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.PodInOption.html">../../bytemuck/trait.PodInOption.html</a>...</p>
<script>location.replace("../../bytemuck/trait.PodInOption.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["PodCastError"],"fn":["bytes_of","bytes_of_mut","cast","cast_mut","cast_ref","cast_slice","cast_slice_mut","fill_zeroes","from_bytes","from_bytes_mut","pod_align_to","pod_align_to_mut","pod_read_unaligned","try_cast","try_cast_mut","try_cast_ref","try_cast_slice","try_cast_slice_mut","try_from_bytes","try_from_bytes_mut","try_pod_read_unaligned","write_zeroes"],"macro":["offset_of"],"mod":["allocation","checked"],"trait":["AnyBitPattern","Contiguous","NoUninit","Pod","PodInOption","TransparentWrapper","Zeroable","ZeroableInOption"]};

View File

@@ -0,0 +1,47 @@
<!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="Marker trait for “plain old data” types that are valid for any bit pattern."><title>AnyBitPattern in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">AnyBitPattern</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">AnyBit<wbr>Pattern</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#derive" title="Derive">Derive</a></li><li><a href="#safety" title="Safety">Safety</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 bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Trait <span class="trait">AnyBit<wbr>Pattern</span>&nbsp;<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/bytemuck/anybitpattern.rs.html#51-54">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe trait AnyBitPattern:
<a class="trait" href="trait.Zeroable.html" title="trait bytemuck::Zeroable">Zeroable</a>
+ <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>
+ <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>
+ 'static { }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marker trait for “plain old data” types that are valid for any bit pattern.</p>
<p>The requirements for this is very similar to <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a>, except that the type
can allow uninit (or padding) bytes. This limits what you can do with a type
of this kind, but also broadens the included types to <code>repr(C)</code> <code>struct</code>s
that contain padding as well as <code>union</code>s. Notably, you can only cast
<em>immutable</em> references and <em>owned</em> values into <a href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a> types, not
<em>mutable</em> references.</p>
<p><a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> is a subset of <a href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a>, meaning that any <code>T: Pod</code> is also
<a href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a> but any <code>T: AnyBitPattern</code> is not necessarily <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a>.</p>
<p><a href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a> is a subset of <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>, meaning that any <code>T: AnyBitPattern</code> is also <a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>, but any <code>T: Zeroable</code> is not
necessarily <a href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern"><code>AnyBitPattern</code></a></p>
<h2 id="derive"><a class="doc-anchor" href="#derive">§</a>Derive</h2>
<p>A <code>#[derive(AnyBitPattern)]</code> macro is provided under the <code>derive</code> feature
flag which will automatically validate the requirements of this trait and
implement the trait for you for both structs and enums. This is the
recommended method for implementing the trait, however its also possible to
do manually. If you implement it manually, you <em>must</em> carefully follow the
below safety rules.</p>
<ul>
<li>*NOTE: even <code>C-style</code>, fieldless enums are intentionally <strong>excluded</strong> from
this trait, since it is <strong>unsound</strong> for an enum to have a discriminant
value that is not one of its defined variants.</li>
</ul>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>Similar to <a href="trait.Pod.html" title="trait bytemuck::Pod"><code>Pod</code></a> except we disregard the rule about it must not contain
uninit bytes. Still, this is a quite strong guarantee about a type, so <em>be
careful</em> when implementing it manually.</p>
<ul>
<li>The type must be inhabited (eg: no
<a href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a>).</li>
<li>The type must be valid for any bit pattern of its backing memory.</li>
<li>Structs need to have all fields also be <code>AnyBitPattern</code>.</li>
<li>It is disallowed for types to contain pointer types, <code>Cell</code>, <code>UnsafeCell</code>,
atomics, and any other forms of interior mutability.</li>
<li>More precisely: A shared reference to the type must allow reads, and
<em>only</em> reads. RustBelts separation logic is based on the notion that a
type is allowed to define a sharing predicate, its own invariant that must
hold for shared references, and this predicate is the reasoning that allow
it to deal with atomic and cells etc. We require the sharing predicate to
be trivial and permit only read-only access.</li>
<li>Theres probably more, dont mess it up (I mean it).</li>
</ul>
</div></details><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.93.1/reference/items/traits.html#dyn-compatibility">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"><section id="impl-AnyBitPattern-for-T" class="impl"><a class="src rightside" href="../src/bytemuck/anybitpattern.rs.html#56">Source</a><a href="#impl-AnyBitPattern-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.Pod.html" title="trait bytemuck::Pod">Pod</a>&gt; <a class="trait" href="trait.AnyBitPattern.html" title="trait bytemuck::AnyBitPattern">AnyBitPattern</a> for T</h3></section></div><script src="../trait.impl/bytemuck/anybitpattern/trait.AnyBitPattern.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,146 @@
<!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 trait which indicates that a type is a `#[repr(transparent)]` wrapper around the `Inner` value."><title>TransparentWrapper in bytemuck - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytemuck" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">TransparentWrapper</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytemuck/index.html">bytemuck</a><span class="version">1.25.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Transparent<wbr>Wrapper</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a><ul><li><a href="#caveats" title="Caveats">Caveats</a></li></ul></li><li><a href="#examples" title="Examples">Examples</a><ul><li><a href="#basic" title="Basic">Basic</a></li><li><a href="#use-with-dynamically-sized-types" title="Use with dynamically sized types">Use with dynamically sized types</a></li><li><a href="#deriving" title="Deriving">Deriving</a></li></ul></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.peel" title="peel">peel</a></li><li><a href="#method.peel_mut" title="peel_mut">peel_mut</a></li><li><a href="#method.peel_ref" title="peel_ref">peel_ref</a></li><li><a href="#method.peel_slice" title="peel_slice">peel_slice</a></li><li><a href="#method.peel_slice_mut" title="peel_slice_mut">peel_slice_mut</a></li><li><a href="#method.wrap" title="wrap">wrap</a></li><li><a href="#method.wrap_mut" title="wrap_mut">wrap_mut</a></li><li><a href="#method.wrap_ref" title="wrap_ref">wrap_ref</a></li><li><a href="#method.wrap_slice" title="wrap_slice">wrap_slice</a></li><li><a href="#method.wrap_slice_mut" title="wrap_slice_mut">wrap_slice_mut</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-TransparentWrapper%3CT%3E-for-Wrapping%3CT%3E" title="Wrapping&#60;T&#62;">Wrapping&#60;T&#62;</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 bytemuck</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">bytemuck</a></div><h1>Trait <span class="trait">Transparent<wbr>Wrapper</span>&nbsp;<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/bytemuck/transparent.rs.html#124-303">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe trait TransparentWrapper&lt;Inner: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; {
// Provided methods
fn <a href="#method.wrap" class="fn">wrap</a>(s: Inner) -&gt; Self
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_ref" class="fn">wrap_ref</a>(s: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;Inner</a>) -&gt; &amp;Self { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_mut" class="fn">wrap_mut</a>(s: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut Inner</a>) -&gt; &amp;mut Self { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_slice" class="fn">wrap_slice</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a>) -&gt; &amp;[Self]
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.wrap_slice_mut" class="fn">wrap_slice_mut</a>(s: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a>) -&gt; &amp;mut [Self]
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.peel" class="fn">peel</a>(s: Self) -&gt; Inner
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_ref" class="fn">peel_ref</a>(s: &amp;Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;Inner</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_mut" class="fn">peel_mut</a>(s: &amp;mut Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut Inner</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_slice" class="fn">peel_slice</a>(s: &amp;[Self]) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.peel_slice_mut" class="fn">peel_slice_mut</a>(s: &amp;mut [Self]) -&gt; &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait which indicates that a type is a <code>#[repr(transparent)]</code> wrapper
around the <code>Inner</code> value.</p>
<p>This allows safely copy transmuting between the <code>Inner</code> type and the
<code>TransparentWrapper</code> type. Functions like <code>wrap_{}</code> convert from the inner
type to the wrapper type and <code>peel_{}</code> functions do the inverse conversion
from the wrapper type to the inner type. We deliberately do not call the
wrapper-removing methods “unwrap” because at this point that word is too
strongly tied to the Option/ Result methods.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>The safety contract of <code>TransparentWrapper</code> is relatively simple:</p>
<p>For a given <code>Wrapper</code> which implements <code>TransparentWrapper&lt;Inner&gt;</code>:</p>
<ol>
<li>
<p><code>Wrapper</code> must be a wrapper around <code>Inner</code> with an identical data
representations. This either means that it must be a
<code>#[repr(transparent)]</code> struct which contains a either a field of type
<code>Inner</code> (or a field of some other transparent wrapper for <code>Inner</code>) as
the only non-ZST field.</p>
</li>
<li>
<p>Any fields <em>other</em> than the <code>Inner</code> field must be trivially constructable
ZSTs, for example <code>PhantomData</code>, <code>PhantomPinned</code>, etc. (When deriving
<code>TransparentWrapper</code> on a type with ZST fields, the ZST fields must be
<a href="trait.Zeroable.html" title="trait bytemuck::Zeroable"><code>Zeroable</code></a>).</p>
</li>
<li>
<p>The <code>Wrapper</code> may not impose additional alignment requirements over
<code>Inner</code>.</p>
<ul>
<li>Note: this is currently guaranteed by <code>repr(transparent)</code>, but there
have been discussions of lifting it, so its stated here explicitly.</li>
</ul>
</li>
<li>
<p>All functions on <code>TransparentWrapper</code> <strong>may not</strong> be overridden.</p>
</li>
</ol>
<h3 id="caveats"><a class="doc-anchor" href="#caveats">§</a>Caveats</h3>
<p>If the wrapper imposes additional constraints upon the inner type which are
required for safety, its responsible for ensuring those still hold this
generally requires preventing access to instances of the inner type, as
implementing <code>TransparentWrapper&lt;U&gt; for T</code> means anybody can call
<code>T::cast_ref(any_instance_of_u)</code>.</p>
<p>For example, it would be invalid to implement TransparentWrapper for <code>str</code>
to implement <code>TransparentWrapper</code> around <code>[u8]</code> because of this.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2><h3 id="basic"><a class="doc-anchor" href="#basic">§</a>Basic</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytemuck::TransparentWrapper;
<span class="attr">#[repr(transparent)]
</span><span class="kw">struct </span>MyWrapper(SomeStruct);
<span class="kw">unsafe impl </span>TransparentWrapper&lt;SomeStruct&gt; <span class="kw">for </span>MyWrapper {}
<span class="comment">// interpret a reference to &amp;SomeStruct as a &amp;MyWrapper
</span><span class="kw">let </span>thing = SomeStruct::default();
<span class="kw">let </span>inner_ref: <span class="kw-2">&amp;</span>MyWrapper = MyWrapper::wrap_ref(<span class="kw-2">&amp;</span>thing);
<span class="comment">// Works with &amp;mut too.
</span><span class="kw">let </span><span class="kw-2">mut </span>mut_thing = SomeStruct::default();
<span class="kw">let </span>inner_mut: <span class="kw-2">&amp;mut </span>MyWrapper = MyWrapper::wrap_mut(<span class="kw-2">&amp;mut </span>mut_thing);
</code></pre></div><h3 id="use-with-dynamically-sized-types"><a class="doc-anchor" href="#use-with-dynamically-sized-types">§</a>Use with dynamically sized types</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bytemuck::TransparentWrapper;
<span class="attr">#[repr(transparent)]
</span><span class="kw">struct </span>Slice&lt;T&gt;([T]);
<span class="kw">unsafe impl</span>&lt;T&gt; TransparentWrapper&lt;[T]&gt; <span class="kw">for </span>Slice&lt;T&gt; {}
<span class="kw">let </span>s = Slice::wrap_ref(<span class="kw-2">&amp;</span>[<span class="number">1u32</span>, <span class="number">2</span>, <span class="number">3</span>]);
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>s.<span class="number">0</span>, <span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>]);
<span class="kw">let </span><span class="kw-2">mut </span>buf = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3u8</span>];
<span class="kw">let </span>sm = Slice::wrap_mut(<span class="kw-2">&amp;mut </span>buf);</code></pre></div><h3 id="deriving"><a class="doc-anchor" href="#deriving">§</a>Deriving</h3>
<p>When deriving, the non-wrapped fields must uphold all the normal
requirements, and must also be <code>Zeroable</code>.</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">// This example requires the `derive` feature.
</span><span class="kw">use </span>bytemuck::TransparentWrapper;
<span class="kw">use </span>std::marker::PhantomData;
<span class="attr">#[derive(TransparentWrapper)]
#[repr(transparent)]
#[transparent(usize)]
</span><span class="kw">struct </span>Wrapper&lt;T: <span class="question-mark">?</span>Sized&gt;(usize, PhantomData&lt;T&gt;); <span class="comment">// PhantomData&lt;T&gt; implements Zeroable for all T</span></code></pre></div>
<p>Here, an error will occur, because <code>MyZst</code> does not implement <code>Zeroable</code>.</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">// This example requires the `derive` feature.
</span><span class="kw">use </span>bytemuck::TransparentWrapper;
<span class="kw">struct </span>MyZst;
<span class="attr">#[derive(TransparentWrapper)]
#[repr(transparent)]
#[transparent(usize)]
</span><span class="kw">struct </span>Wrapper(usize, MyZst); <span class="comment">// MyZst does not implement Zeroable</span></code></pre></div></div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.wrap" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#127-137">Source</a><h4 class="code-header">fn <a href="#method.wrap" class="fn">wrap</a>(s: Inner) -&gt; Self<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert the inner type into the wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_ref" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#142-160">Source</a><h4 class="code-header">fn <a href="#method.wrap_ref" class="fn">wrap_ref</a>(s: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;Inner</a>) -&gt; &amp;Self</h4></section></summary><div class="docblock"><p>Convert a reference to the inner type into a reference to the wrapper
type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_mut" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#165-182">Source</a><h4 class="code-header">fn <a href="#method.wrap_mut" class="fn">wrap_mut</a>(s: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut Inner</a>) -&gt; &amp;mut Self</h4></section></summary><div class="docblock"><p>Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_slice" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#186-196">Source</a><h4 class="code-header">fn <a href="#method.wrap_slice" class="fn">wrap_slice</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a>) -&gt; &amp;[Self]<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert a slice to the inner type into a slice to the wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.wrap_slice_mut" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#201-213">Source</a><h4 class="code-header">fn <a href="#method.wrap_slice_mut" class="fn">wrap_slice_mut</a>(s: &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a>) -&gt; &amp;mut [Self]<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#217-227">Source</a><h4 class="code-header">fn <a href="#method.peel" class="fn">peel</a>(s: Self) -&gt; Inner<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert the wrapper type into the inner type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_ref" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#232-249">Source</a><h4 class="code-header">fn <a href="#method.peel_ref" class="fn">peel_ref</a>(s: &amp;Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;Inner</a></h4></section></summary><div class="docblock"><p>Convert a reference to the wrapper type into a reference to the inner
type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_mut" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#254-271">Source</a><h4 class="code-header">fn <a href="#method.peel_mut" class="fn">peel_mut</a>(s: &amp;mut Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.reference.html">&amp;mut Inner</a></h4></section></summary><div class="docblock"><p>Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_slice" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#275-285">Source</a><h4 class="code-header">fn <a href="#method.peel_slice" class="fn">peel_slice</a>(s: &amp;[Self]) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert a slice to the wrapped type into a slice to the inner type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_slice_mut" class="method"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#290-302">Source</a><h4 class="code-header">fn <a href="#method.peel_slice_mut" class="fn">peel_slice_mut</a>(s: &amp;mut [Self]) -&gt; &amp;mut <a class="primitive" href="https://doc.rust-lang.org/1.93.1/core/primitive.slice.html">[Inner]</a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Inner: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.</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.93.1/reference/items/traits.html#dyn-compatibility">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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><section id="impl-TransparentWrapper%3CT%3E-for-Wrapping%3CT%3E" class="impl"><a class="src rightside" href="../src/bytemuck/transparent.rs.html#305">Source</a><a href="#impl-TransparentWrapper%3CT%3E-for-Wrapping%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.TransparentWrapper.html" title="trait bytemuck::TransparentWrapper">TransparentWrapper</a>&lt;T&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/num/wrapping/struct.Wrapping.html" title="struct core::num::wrapping::Wrapping">Wrapping</a>&lt;T&gt;</h3></section><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/bytemuck/transparent/trait.TransparentWrapper.js" data-ignore-extern-crates="core" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.TransparentWrapper.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.TransparentWrapper.html">../../bytemuck/trait.TransparentWrapper.html</a>...</p>
<script>location.replace("../../bytemuck/trait.TransparentWrapper.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.Zeroable.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.Zeroable.html">../../bytemuck/trait.Zeroable.html</a>...</p>
<script>location.replace("../../bytemuck/trait.Zeroable.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../bytemuck/trait.ZeroableInOption.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../bytemuck/trait.ZeroableInOption.html">../../bytemuck/trait.ZeroableInOption.html</a>...</p>
<script>location.replace("../../bytemuck/trait.ZeroableInOption.html" + location.search + location.hash);</script>
</body>
</html>