mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-21 07:15:32 +01:00
19 lines
No EOL
7.6 KiB
HTML
19 lines
No EOL
7.6 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="Trait defining how data for a `LinearMap` is stored."><title>LinearMapStorage in heapless::linear_map - 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-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.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-6dc2a7f3.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="#">LinearMapStorage</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../heapless/index.html">heapless</a><span class="version">0.9.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Linear<wbr>MapStorage</a></h2><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 heapless::<wbr>linear_<wbr>map</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">heapless</a>::<wbr><a href="index.html">linear_map</a></div><h1>Trait <span class="trait">Linear<wbr>MapStorage</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/heapless/linear_map.rs.html#43">Source</a> </span></div><pre class="rust item-decl"><code>pub trait LinearMapStorage<K, V>: LinearMapStorageSealed<K, V> { }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait defining how data for a <a href="type.LinearMap.html" title="type heapless::linear_map::LinearMap"><code>LinearMap</code></a> is stored.</p>
|
||
<p>There’s two implementations available:</p>
|
||
<ul>
|
||
<li><a href="type.OwnedStorage.html" title="type heapless::linear_map::OwnedStorage"><code>OwnedStorage</code></a>: stores the data in an array whose size is known at compile time.</li>
|
||
<li><a href="type.ViewStorage.html" title="type heapless::linear_map::ViewStorage"><code>ViewStorage</code></a>: stores the data in an unsized slice</li>
|
||
</ul>
|
||
<p>This allows <a href="type.LinearMap.html" title="type heapless::linear_map::LinearMap"><code>LinearMap</code></a> to be generic over either sized or unsized storage. The
|
||
<a href="index.html" title="mod heapless::linear_map"><code>linear_map</code></a> module contains a <a href="struct.LinearMapInner.html" title="struct heapless::linear_map::LinearMapInner"><code>LinearMapInner</code></a> struct that’s generic on
|
||
<a href="trait.LinearMapStorage.html" title="trait heapless::linear_map::LinearMapStorage"><code>LinearMapStorage</code></a>, and two type aliases for convenience:</p>
|
||
<ul>
|
||
<li><a href="type.LinearMap.html" title="type heapless::linear_map::LinearMap"><code>LinearMap<N></code></a> = <code>LinearMapInner<OwnedStorage<u8, N>></code></li>
|
||
<li><a href="type.LinearMapView.html" title="type heapless::linear_map::LinearMapView"><code>LinearMapView<T></code></a> = <code>LinearMapInner<ViewStorage<u8>></code></li>
|
||
</ul>
|
||
<p><code>LinearMap</code> can be unsized into <code>StrinsgView</code>, either by unsizing coercions such as <code>&mut LinearMap -> &mut LinearMapView</code> or <code>Box<LinearMap> -> Box<LinearMapView></code>, or
|
||
explicitly with <a href="struct.LinearMapInner.html#method.as_view" title="method heapless::linear_map::LinearMapInner::as_view"><code>.as_view()</code></a> or
|
||
<a href="struct.LinearMapInner.html#method.as_mut_view" title="method heapless::linear_map::LinearMapInner::as_mut_view"><code>.as_mut_view()</code></a>.</p>
|
||
<p>This trait is sealed, so you cannot implement it for your own types. You can only use
|
||
the implementations provided by this crate.</p>
|
||
</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.91.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-LinearMapStorage%3CK,+V%3E-for-VecStorageInner%3C%5BMaybeUninit%3C(K,+V)%3E%5D%3E" class="impl"><a class="src rightside" href="../../src/heapless/linear_map.rs.html#71">Source</a><a href="#impl-LinearMapStorage%3CK,+V%3E-for-VecStorageInner%3C%5BMaybeUninit%3C(K,+V)%3E%5D%3E" class="anchor">§</a><h3 class="code-header">impl<K, V> <a class="trait" href="trait.LinearMapStorage.html" title="trait heapless::linear_map::LinearMapStorage">LinearMapStorage</a><K, V> for <a class="type" href="../vec/type.ViewVecStorage.html" title="type heapless::vec::ViewVecStorage">ViewVecStorage</a><<a class="primitive" href="https://doc.rust-lang.org/1.91.1/core/primitive.tuple.html">(K, V)</a>></h3></section><section id="impl-LinearMapStorage%3CK,+V%3E-for-VecStorageInner%3C%5BMaybeUninit%3C(K,+V)%3E;+N%5D%3E" class="impl"><a class="src rightside" href="../../src/heapless/linear_map.rs.html#55">Source</a><a href="#impl-LinearMapStorage%3CK,+V%3E-for-VecStorageInner%3C%5BMaybeUninit%3C(K,+V)%3E;+N%5D%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, const N: <a class="primitive" href="https://doc.rust-lang.org/1.91.1/core/primitive.usize.html">usize</a>> <a class="trait" href="trait.LinearMapStorage.html" title="trait heapless::linear_map::LinearMapStorage">LinearMapStorage</a><K, V> for <a class="type" href="../vec/type.OwnedVecStorage.html" title="type heapless::vec::OwnedVecStorage">OwnedVecStorage</a><<a class="primitive" href="https://doc.rust-lang.org/1.91.1/core/primitive.tuple.html">(K, V)</a>, N></h3></section></div><script src="../../trait.impl/heapless/linear_map/storage/trait.LinearMapStorage.js" async></script></section></div></main></body></html> |