18 lines
10 KiB
HTML
18 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="Storage layouts for ECS data."><title>bevy_ecs::storage - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="bevy_ecs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="icon" href="https://bevyengine.org/assets/icon.png"></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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../bevy_ecs/index.html"><img src="https://bevyengine.org/assets/icon.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../bevy_ecs/index.html"><img src="https://bevyengine.org/assets/icon.png" alt="logo"></a><h2><a href="../../bevy_ecs/index.html">bevy_<wbr>ecs</a><span class="version">0.15.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module storage</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#fetching-storages" title="Fetching Storages">Fetching Storages</a></li><li><a href="#safety" title="Safety">Safety</a></li></ul><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></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate bevy_<wbr>ecs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">bevy_ecs</a></span><h1>Module <span>storage</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/bevy_ecs/storage/mod.rs.html#1-45">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Storage layouts for ECS data.</p>
|
|
<p>This module implements the low-level collections that store data in a <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a>. These all offer minimal and often
|
|
unsafe APIs, and have been made <code>pub</code> primarily for debugging and monitoring purposes.</p>
|
|
<h2 id="fetching-storages"><a class="doc-anchor" href="#fetching-storages">§</a>Fetching Storages</h2>
|
|
<p>Each of the below data stores can be fetched via <a href="struct.Storages.html" title="struct bevy_ecs::storage::Storages"><code>Storages</code></a>, which can be fetched from a
|
|
<a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a> via <a href="../world/struct.World.html#method.storages" title="method bevy_ecs::world::World::storages"><code>World::storages</code></a>. It exposes a top level container for each class of storage within
|
|
ECS:</p>
|
|
<ul>
|
|
<li><a href="struct.Tables.html" title="struct bevy_ecs::storage::Tables"><code>Tables</code></a> - columnar contiguous blocks of memory, optimized for fast iteration.</li>
|
|
<li><a href="struct.SparseSets.html" title="struct bevy_ecs::storage::SparseSets"><code>SparseSets</code></a> - sparse <code>HashMap</code>-like mappings from entities to components, optimized for random
|
|
lookup and regular insertion/removal of components.</li>
|
|
<li><a href="struct.Resources.html" title="struct bevy_ecs::storage::Resources"><code>Resources</code></a> - singleton storage for the resources in the world</li>
|
|
</ul>
|
|
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
|
|
<p>To avoid trivially unsound use of the APIs in this module, it is explicitly impossible to get a mutable
|
|
reference to <a href="struct.Storages.html" title="struct bevy_ecs::storage::Storages"><code>Storages</code></a> from <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a>, and none of the types publicly expose a mutable interface.</p>
|
|
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Column.html" title="struct bevy_ecs::storage::Column">Column</a></div><div class="desc docblock-short">A type-erased contiguous container for data of a homogeneous type.</div></li><li><div class="item-name"><a class="struct" href="struct.ComponentSparseSet.html" title="struct bevy_ecs::storage::ComponentSparseSet">Component<wbr>Sparse<wbr>Set</a></div><div class="desc docblock-short">A sparse data structure of <a href="../component/trait.Component.html" title="trait bevy_ecs::component::Component"><code>Component</code></a>s.</div></li><li><div class="item-name"><a class="struct" href="struct.ResourceData.html" title="struct bevy_ecs::storage::ResourceData">Resource<wbr>Data</a></div><div class="desc docblock-short">The type-erased backing storage and metadata for a single resource within a <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Resources.html" title="struct bevy_ecs::storage::Resources">Resources</a></div><div class="desc docblock-short">The backing store for all <a href="../system/trait.Resource.html" title="trait bevy_ecs::system::Resource"><code>Resource</code></a>s stored in the <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.SparseSet.html" title="struct bevy_ecs::storage::SparseSet">Sparse<wbr>Set</a></div><div class="desc docblock-short">A data structure that blends dense and sparse storage</div></li><li><div class="item-name"><a class="struct" href="struct.SparseSets.html" title="struct bevy_ecs::storage::SparseSets">Sparse<wbr>Sets</a></div><div class="desc docblock-short">A collection of <a href="struct.ComponentSparseSet.html" title="struct bevy_ecs::storage::ComponentSparseSet"><code>ComponentSparseSet</code></a> storages, indexed by <a href="../component/struct.ComponentId.html" title="struct bevy_ecs::component::ComponentId"><code>ComponentId</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.Storages.html" title="struct bevy_ecs::storage::Storages">Storages</a></div><div class="desc docblock-short">The raw data stores of a <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.Table.html" title="struct bevy_ecs::storage::Table">Table</a></div><div class="desc docblock-short">A column-oriented <a href="https://en.wikipedia.org/wiki/AoS_and_SoA#Structure_of_arrays">structure-of-arrays</a> based storage for <a href="../component/trait.Component.html" title="trait bevy_ecs::component::Component"><code>Component</code></a>s of entities
|
|
in a <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.TableId.html" title="struct bevy_ecs::storage::TableId">TableId</a></div><div class="desc docblock-short">An opaque unique ID for a <a href="struct.Table.html" title="struct bevy_ecs::storage::Table"><code>Table</code></a> within a <a href="../world/struct.World.html" title="struct bevy_ecs::world::World"><code>World</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.TableRow.html" title="struct bevy_ecs::storage::TableRow">Table<wbr>Row</a></div><div class="desc docblock-short">A opaque newtype for rows in <a href="struct.Table.html" title="struct bevy_ecs::storage::Table"><code>Table</code></a>s. Specifies a single row in a specific table.</div></li><li><div class="item-name"><a class="struct" href="struct.Tables.html" title="struct bevy_ecs::storage::Tables">Tables</a></div><div class="desc docblock-short">A collection of <a href="struct.Table.html" title="struct bevy_ecs::storage::Table"><code>Table</code></a> storages, indexed by <a href="struct.TableId.html" title="struct bevy_ecs::storage::TableId"><code>TableId</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.ThinColumn.html" title="struct bevy_ecs::storage::ThinColumn">Thin<wbr>Column</a></div><div class="desc docblock-short">Very similar to a normal <a href="struct.Column.html" title="struct bevy_ecs::storage::Column"><code>Column</code></a>, but with the capacities and lengths cut out for performance reasons.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.SparseSetIndex.html" title="trait bevy_ecs::storage::SparseSetIndex">Sparse<wbr>SetIndex</a></div><div class="desc docblock-short">Represents something that can be stored in a <a href="struct.SparseSet.html" title="struct bevy_ecs::storage::SparseSet"><code>SparseSet</code></a> as an integer.</div></li></ul></section></div></main></body></html> |