Files
GopherGate/target/doc/bytemuck/allocation/index.html
2026-02-26 12:00:21 -05:00

11 lines
10 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Stuff to boost things in the `alloc` crate."><title>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 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 allocation</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 allocation</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</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>allocation</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#1-980">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Stuff to boost things in the <code>alloc</code> crate.</p>
<ul>
<li>
<p>You must enable the <code>extern_crate_alloc</code> feature of <code>bytemuck</code> or you will
not be able to use this module! This is generally done by adding the
feature to the dependency in Cargo.toml like so:</p>
<p><code>bytemuck = { version = "VERSION_YOU_ARE_USING", features = ["extern_crate_alloc"]}</code></p>
</li>
</ul>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.BoxBytes.html" title="struct bytemuck::allocation::BoxBytes">BoxBytes</a></dt><dd>As <code>Box&lt;[u8]&gt;</code>, but remembers the original alignment.</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.TransparentWrapperAlloc.html" title="trait bytemuck::allocation::TransparentWrapperAlloc">Transparent<wbr>Wrapper<wbr>Alloc</a></dt><dd>An extension trait for <code>TransparentWrapper</code> and alloc types.</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.box_bytes_of.html" title="fn bytemuck::allocation::box_bytes_of">box_<wbr>bytes_<wbr>of</a></dt><dd>Re-interprets <code>Box&lt;T&gt;</code> as <code>BoxBytes</code>.</dd><dt><a class="fn" href="fn.cast_arc.html" title="fn bytemuck::allocation::cast_arc">cast_<wbr>arc</a></dt><dd>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.</dd><dt><a class="fn" href="fn.cast_box.html" title="fn bytemuck::allocation::cast_box">cast_<wbr>box</a></dt><dd>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.</dd><dt><a class="fn" href="fn.cast_rc.html" title="fn bytemuck::allocation::cast_rc">cast_rc</a></dt><dd>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.</dd><dt><a class="fn" href="fn.cast_slice_arc.html" title="fn bytemuck::allocation::cast_slice_arc">cast_<wbr>slice_<wbr>arc</a></dt><dd>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.</dd><dt><a class="fn" href="fn.cast_slice_box.html" title="fn bytemuck::allocation::cast_slice_box">cast_<wbr>slice_<wbr>box</a></dt><dd>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.</dd><dt><a class="fn" href="fn.cast_slice_rc.html" title="fn bytemuck::allocation::cast_slice_rc">cast_<wbr>slice_<wbr>rc</a></dt><dd>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.</dd><dt><a class="fn" href="fn.cast_vec.html" title="fn bytemuck::allocation::cast_vec">cast_<wbr>vec</a></dt><dd>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.</dd><dt><a class="fn" href="fn.from_box_bytes.html" title="fn bytemuck::allocation::from_box_bytes">from_<wbr>box_<wbr>bytes</a></dt><dd>Re-interprets <code>BoxBytes</code> as <code>Box&lt;T&gt;</code>.</dd><dt><a class="fn" href="fn.pod_collect_to_vec.html" title="fn bytemuck::allocation::pod_collect_to_vec">pod_<wbr>collect_<wbr>to_<wbr>vec</a></dt><dd>This “collects” a slice of pod data into a vec of a different pod type.</dd><dt><a class="fn" href="fn.try_cast_arc.html" title="fn bytemuck::allocation::try_cast_arc">try_<wbr>cast_<wbr>arc</a></dt><dd>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>.</dd><dt><a class="fn" href="fn.try_cast_box.html" title="fn bytemuck::allocation::try_cast_box">try_<wbr>cast_<wbr>box</a></dt><dd>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>.</dd><dt><a class="fn" href="fn.try_cast_rc.html" title="fn bytemuck::allocation::try_cast_rc">try_<wbr>cast_<wbr>rc</a></dt><dd>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>.</dd><dt><a class="fn" href="fn.try_cast_slice_arc.html" title="fn bytemuck::allocation::try_cast_slice_arc">try_<wbr>cast_<wbr>slice_<wbr>arc</a></dt><dd>Attempts to cast the content type of a <code>Arc&lt;[T]&gt;</code>.</dd><dt><a class="fn" href="fn.try_cast_slice_box.html" title="fn bytemuck::allocation::try_cast_slice_box">try_<wbr>cast_<wbr>slice_<wbr>box</a></dt><dd>Attempts to cast the content type of a <code>Box&lt;[T]&gt;</code>.</dd><dt><a class="fn" href="fn.try_cast_slice_rc.html" title="fn bytemuck::allocation::try_cast_slice_rc">try_<wbr>cast_<wbr>slice_<wbr>rc</a></dt><dd>Attempts to cast the content type of a <code>Rc&lt;[T]&gt;</code>.</dd><dt><a class="fn" href="fn.try_cast_vec.html" title="fn bytemuck::allocation::try_cast_vec">try_<wbr>cast_<wbr>vec</a></dt><dd>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>.</dd><dt><a class="fn" href="fn.try_from_box_bytes.html" title="fn bytemuck::allocation::try_from_box_bytes">try_<wbr>from_<wbr>box_<wbr>bytes</a></dt><dd>Re-interprets <code>BoxBytes</code> as <code>Box&lt;T&gt;</code>.</dd><dt><a class="fn" href="fn.try_zeroed_box.html" title="fn bytemuck::allocation::try_zeroed_box">try_<wbr>zeroed_<wbr>box</a></dt><dd>Allocates a <code>Box&lt;T&gt;</code> with all of the contents being zeroed out.</dd><dt><a class="fn" href="fn.try_zeroed_slice_box.html" title="fn bytemuck::allocation::try_zeroed_slice_box">try_<wbr>zeroed_<wbr>slice_<wbr>box</a></dt><dd>Allocates a <code>Box&lt;[T]&gt;</code> with all contents being zeroed out.</dd><dt><a class="fn" href="fn.try_zeroed_vec.html" title="fn bytemuck::allocation::try_zeroed_vec">try_<wbr>zeroed_<wbr>vec</a></dt><dd>Allocates a <code>Vec&lt;T&gt;</code> of length and capacity exactly equal to <code>length</code> and
all elements zeroed.</dd><dt><a class="fn" href="fn.zeroed_box.html" title="fn bytemuck::allocation::zeroed_box">zeroed_<wbr>box</a></dt><dd>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.</dd><dt><a class="fn" href="fn.zeroed_slice_box.html" title="fn bytemuck::allocation::zeroed_slice_box">zeroed_<wbr>slice_<wbr>box</a></dt><dd>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.</dd><dt><a class="fn" href="fn.zeroed_vec.html" title="fn bytemuck::allocation::zeroed_vec">zeroed_<wbr>vec</a></dt><dd>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</dd></dl></section></div></main></body></html>