mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
deploy: af07de5d8e
This commit is contained in:
parent
47d336e9d8
commit
7e3cc4caf4
@ -1,5 +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="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Tue, 19 Jan 2021 19:17:04 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Tue, 19 Jan 2021 19:43:09 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></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
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
@ -1,4 +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="API documentation for the Rust `deserialize_nodemap` fn in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, deserialize_nodemap"><title>map_model::pathfind::node_map::deserialize_nodemap - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a href="index.html">node_map</a></p><script>window.sidebarCurrent = {name: "deserialize_nodemap", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/pathfind/node_map.rs.html#52-71" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a href="index.html">node_map</a>::<wbr><a class="fn" href="">deserialize_nodemap</a></span></h1><pre class="rust fn">pub fn deserialize_nodemap<'de, D: <a class="trait" href="https://docs.rs/serde/1.0.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, T: <a class="trait" href="https://docs.rs/serde/1.0.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://docs.rs/serde/1.0.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a>>(<br> d: D<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../map_model/pathfind/node_map/struct.NodeMap.html" title="struct map_model::pathfind::node_map::NodeMap">NodeMap</a><T>, D::<a class="type" href="https://docs.rs/serde/1.0.118/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "map_model";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/pathfind/node_map.rs.html#60-78" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a href="index.html">node_map</a>::<wbr><a class="fn" href="">deserialize_nodemap</a></span></h1><pre class="rust fn">pub fn deserialize_nodemap<'de, D: <a class="trait" href="https://docs.rs/serde/1.0.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, T: <a class="trait" href="https://docs.rs/serde/1.0.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://docs.rs/serde/1.0.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a>>(<br> d: D<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../../map_model/pathfind/node_map/struct.NodeMap.html" title="struct map_model::pathfind::node_map::NodeMap">NodeMap</a><T>, D::<a class="type" href="https://docs.rs/serde/1.0.118/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "map_model";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,7 +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="API documentation for the Rust `node_map` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, node_map"><title>map_model::pathfind::node_map - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module node_map</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a></p><script>window.sidebarCurrent = {name: "node_map", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/pathfind/node_map.rs.html#1-71" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a class="mod" href="">node_map</a></span></h1><div class="docblock"><p>Some helpers for working with fast_paths.</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/pathfind/node_map.rs.html#1-78" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a class="mod" href="">node_map</a></span></h1><div class="docblock"><p>Some helpers for working with fast_paths.</p>
|
||||
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.NodeMap.html" title="map_model::pathfind::node_map::NodeMap struct">NodeMap</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.InnerNodeMap.html" title="map_model::pathfind::node_map::InnerNodeMap struct">InnerNodeMap</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.NodeMap.html" title="map_model::pathfind::node_map::NodeMap struct">NodeMap</a></td><td class="docblock-short"><p>A bidirectional mapping between fast_paths NodeId and some custom ID type.</p>
|
||||
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.deserialize_nodemap.html" title="map_model::pathfind::node_map::deserialize_nodemap fn">deserialize_nodemap</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "map_model";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1 +1 @@
|
||||
initSidebarItems({"fn":[["deserialize_nodemap",""]],"struct":[["NodeMap",""]]});
|
||||
initSidebarItems({"fn":[["deserialize_nodemap",""]],"struct":[["InnerNodeMap",""],["NodeMap","A bidirectional mapping between fast_paths NodeId and some custom ID type."]]});
|
18
rustdoc/map_model/pathfind/node_map/struct.InnerNodeMap.html
Normal file
18
rustdoc/map_model/pathfind/node_map/struct.InnerNodeMap.html
Normal file
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
@ -122,7 +122,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.49.0 (e1884a8e3 2020-12-29)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Tue, 19 Jan 2021 19:17:04 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Tue, 19 Jan 2021 19:43:09 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -72,6 +72,13 @@
|
||||
<span id="69">69</span>
|
||||
<span id="70">70</span>
|
||||
<span id="71">71</span>
|
||||
<span id="72">72</span>
|
||||
<span id="73">73</span>
|
||||
<span id="74">74</span>
|
||||
<span id="75">75</span>
|
||||
<span id="76">76</span>
|
||||
<span id="77">77</span>
|
||||
<span id="78">78</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="doccomment">//! Some helpers for working with fast_paths.</span>
|
||||
|
||||
@ -81,9 +88,12 @@
|
||||
<span class="kw">use</span> <span class="ident">fast_paths</span>::{<span class="ident">NodeId</span>, <span class="ident">ShortestPath</span>};
|
||||
<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Deserializer</span>, <span class="ident">Serialize</span>};
|
||||
|
||||
<span class="doccomment">/// A bidirectional mapping between fast_paths NodeId and some custom ID type.</span>
|
||||
<span class="comment">// TODO Upstream this in fast_paths when this is more solid.</span>
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">NodeMap</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Copy</span> <span class="op">+</span> <span class="ident">Ord</span> <span class="op">+</span> <span class="ident">Debug</span> <span class="op">+</span> <span class="ident">Serialize</span><span class="op">></span> {
|
||||
<span class="comment">// These two fields are redundant and large, so don't serialize the bigger one, to cut down</span>
|
||||
<span class="comment">// file size.</span>
|
||||
<span class="attribute">#[<span class="ident">serde</span>(<span class="ident">skip_serializing</span>)]</span>
|
||||
<span class="ident">node_to_id</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">T</span>, <span class="ident">NodeId</span><span class="op">></span>,
|
||||
<span class="ident">id_to_node</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>,
|
||||
@ -123,7 +133,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// TODO Still can't figure out how to derive Deserialize on NodeMap directly.</span>
|
||||
<span class="comment">// A serialized NodeMap has this form in JSON. Use this to deserialize.</span>
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
|
||||
<span class="kw">struct</span> <span class="ident">InnerNodeMap</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">Copy</span> <span class="op">+</span> <span class="ident">Ord</span> <span class="op">+</span> <span class="ident">Debug</span><span class="op">></span> {
|
||||
<span class="ident">id_to_node</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>,
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">deserialize_nodemap</span><span class="op"><</span>
|
||||
<span class="lifetime">'de</span>,
|
||||
<span class="ident">D</span>: <span class="ident">Deserializer</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
@ -131,9 +146,8 @@
|
||||
<span class="op">></span>(
|
||||
<span class="ident">d</span>: <span class="ident">D</span>,
|
||||
) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">NodeMap</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>, <span class="ident">D</span>::<span class="ident">Error</span><span class="op">></span> {
|
||||
<span class="comment">// TODO I'm offline and can't look up hw to use Deserializer twice in sequence. Since the two</span>
|
||||
<span class="comment">// fields are redundant, just serialize one of them.</span>
|
||||
<span class="kw">let</span> <span class="ident">id_to_node</span> <span class="op">=</span> <span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span><span class="op">></span>::<span class="ident">deserialize</span>(<span class="ident">d</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="ident">inner</span> <span class="op">=</span> <span class="op"><</span><span class="ident">InnerNodeMap</span><span class="op"><</span><span class="ident">T</span><span class="op">></span><span class="op">></span>::<span class="ident">deserialize</span>(<span class="ident">d</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="ident">id_to_node</span> <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">id_to_node</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">node_to_id</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, <span class="ident">node</span>) <span class="kw">in</span> <span class="ident">id_to_node</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
|
||||
<span class="ident">node_to_id</span>.<span class="ident">insert</span>(<span class="kw-2">*</span><span class="ident">node</span>, <span class="ident">id</span>);
|
||||
|
Loading…
Reference in New Issue
Block a user