mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 07:52:05 +03:00
deploy: 2917361417
This commit is contained in:
parent
ae222dbda8
commit
20ce3c304d
@ -45,11 +45,11 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.other_event" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A) -> Transition<A></h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didn’t occur and <code>panel_changed</code> didn’t return transition, then
|
||||
call this to handle all other events. <a href="#method.other_event">Read more</a></p>
|
||||
</div></details><div id="method.draw_baselayer-66" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-66" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-SimpleState%3CApp%3E-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#260-304" title="goto source code">[src]</a></div><a href="#impl-SimpleState%3CApp%3E-1" class="anchor"></a><h3 class="code-header in-band">impl SimpleState<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../debug/blockfinder/struct.OneBlock.html" title="struct game::debug::blockfinder::OneBlock">OneBlock</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#261-294" title="goto source code">[src]</a></div><a href="#method.on_click-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">on_click</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.str.html">str</a>, <br> _: &Panel<br>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
</div></details><div id="method.draw_baselayer-66" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-66" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-SimpleState%3CApp%3E-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#262-306" title="goto source code">[src]</a></div><a href="#impl-SimpleState%3CApp%3E-1" class="anchor"></a><h3 class="code-header in-band">impl SimpleState<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../debug/blockfinder/struct.OneBlock.html" title="struct game::debug::blockfinder::OneBlock">OneBlock</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#263-296" title="goto source code">[src]</a></div><a href="#method.on_click-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">on_click</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.str.html">str</a>, <br> _: &Panel<br>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
the fallback case can just use <code>unreachable!()</code>. <a href="#tymethod.on_click">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#296-299" title="goto source code">[src]</a></div><a href="#method.other_event-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a><br>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didn’t occur and <code>panel_changed</code> didn’t return transition, then
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#298-301" title="goto source code">[src]</a></div><a href="#method.other_event-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a><br>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didn’t occur and <code>panel_changed</code> didn’t return transition, then
|
||||
call this to handle all other events. <a href="#method.other_event">Read more</a></p>
|
||||
</div></details><div id="method.draw-68" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#301-303" title="goto source code">[src]</a></div><a href="#method.draw-68" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, _: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click_custom-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_click_custom-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_click_custom" class="fnname">on_click_custom</a>(<br> &mut self, <br> _ctx: &mut EventCtx<'_>, <br> _app: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A, <br> _action: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../abstutil/clone/trait.CloneableAny.html" title="trait abstutil::clone::CloneableAny">CloneableAny</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <br> _panel: &Panel<br>) -> Transition<A></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked.</p>
|
||||
</div></details><div id="method.draw-68" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#303-305" title="goto source code">[src]</a></div><a href="#method.draw-68" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, _: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click_custom-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_click_custom-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_click_custom" class="fnname">on_click_custom</a>(<br> &mut self, <br> _ctx: &mut EventCtx<'_>, <br> _app: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A, <br> _action: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../abstutil/clone/trait.CloneableAny.html" title="trait abstutil::clone::CloneableAny">CloneableAny</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <br> _panel: &Panel<br>) -> Transition<A></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.panel_changed-2" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.panel_changed-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A, <br> &mut Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></h4></div></summary><div class='docblock'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p>
|
||||
@ -381,8 +381,8 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-60" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#216-244" title="goto source code">[src]</a></div><a href="#method.draw-60" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-59" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#246-250" title="goto source code">[src]</a></div><a href="#method.on_destroy-59" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, _: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-59" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-59" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-6" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#113-235" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-6" class="anchor"></a><h3 class="code-header in-band">impl State<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../debug/blockfinder/struct.Blockfinder.html" title="struct game::debug::blockfinder::Blockfinder">Blockfinder</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-6" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#114-229" title="goto source code">[src]</a></div><a href="#method.event-6" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-7" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#231-234" title="goto source code">[src]</a></div><a href="#method.draw-7" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, _: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-6" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#113-237" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-6" class="anchor"></a><h3 class="code-header in-band">impl State<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../debug/blockfinder/struct.Blockfinder.html" title="struct game::debug::blockfinder::Blockfinder">Blockfinder</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-6" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#114-231" title="goto source code">[src]</a></div><a href="#method.event-6" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-7" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#233-236" title="goto source code">[src]</a></div><a href="#method.draw-7" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, _: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-6" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-6" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_destroy-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-60" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#286-294" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-60" class="anchor"></a><h3 class="code-header in-band">impl State<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../sandbox/struct.BackToMainMenu.html" title="struct game::sandbox::BackToMainMenu">BackToMainMenu</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-60" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#287-291" title="goto source code">[src]</a></div><a href="#method.event-60" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<!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 `make_panel` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, make_panel"><title>make_panel in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></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]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="make_panel" data-ty="fn" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="fn" href="#">make_panel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#306-332" title="goto source code">[src]</a></span></h1><pre class="rust fn"><code>fn make_panel(ctx: &mut EventCtx<'_>) -> Panel</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
<!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 `make_panel` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, make_panel"><title>make_panel in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></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]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="make_panel" data-ty="fn" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="fn" href="#">make_panel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#308-342" title="goto source code">[src]</a></span></h1><pre class="rust fn"><code>fn make_panel(ctx: &mut EventCtx<'_>) -> Panel</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
<script src="../../../main.js"></script>
|
||||
</body></html>
|
@ -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 `blockfinder` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, blockfinder"><title>game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></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="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module blockfinder</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="blockfinder" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a class="mod" href="#">blockfinder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#1-332" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<!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 `blockfinder` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, blockfinder"><title>game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></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="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module blockfinder</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="blockfinder" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a class="mod" href="#">blockfinder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#1-342" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.Blockfinder.html" title="game::debug::blockfinder::Blockfinder struct">Blockfinder</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.Obj.html" title="game::debug::blockfinder::Obj struct">Obj</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.OneBlock.html" title="game::debug::blockfinder::OneBlock struct">OneBlock</a></div><div class="item-right docblock-short"></div></div><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2>
|
||||
<div class="item-table"><div class="item-left module-item"><a class="constant" href="constant.COLORS.html" title="game::debug::blockfinder::COLORS constant">COLORS</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="constant" href="constant.MODIFIED.html" title="game::debug::blockfinder::MODIFIED constant">MODIFIED</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="constant" href="constant.TO_MERGE.html" title="game::debug::blockfinder::TO_MERGE constant">TO_MERGE</a></div><div class="item-right docblock-short"></div></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<div class="item-table"><div class="item-left module-item"><a class="fn" href="fn.make_panel.html" title="game::debug::blockfinder::make_panel fn">make_panel</a></div><div class="item-right docblock-short"></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
|
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="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in game::pregame::built_info - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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-1cadd2d85de266ec/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.str.html">str</a> = r"Tue, 02 Nov 2021 00:05:21 +0000";</code></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
<!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="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in game::pregame::built_info - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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-1cadd2d85de266ec/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.str.html">str</a> = r"Tue, 02 Nov 2021 00:19:37 +0000";</code></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
<script src="../../../main.js"></script>
|
||||
</body></html>
|
@ -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 `block` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, block"><title>map_model::objects::block - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></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="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module block</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="block" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">objects</a>::<wbr><a class="mod" href="#">block</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/objects/block.rs.html#1-470" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<!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 `block` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, block"><title>map_model::objects::block - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></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="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module block</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="block" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">objects</a>::<wbr><a class="mod" href="#">block</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/objects/block.rs.html#1-477" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.Block.html" title="map_model::objects::block::Block struct">Block</a></div><div class="item-right docblock-short"><p>A block is defined by a perimeter that traces along the sides of roads. Inside the perimeter,
|
||||
the block may contain buildings and interior roads. In the simple case, a block represents a
|
||||
single “city block”, with no interior roads. It may also cover a “neighborhood”, where the
|
||||
|
@ -6,7 +6,7 @@ the block may contain buildings and interior roads. In the simple case, a block
|
||||
single “city block”, with no interior roads. It may also cover a “neighborhood”, where the
|
||||
perimeter contains some “major” and the interior consists only of “minor” roads.</p>
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.perimeter" class="structfield small-section-header"><a href="#structfield.perimeter" class="anchor field"></a><code>perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></code></span><span id="structfield.polygon" class="structfield small-section-header"><a href="#structfield.polygon" class="anchor field"></a><code>polygon: <a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a></code></span><div class="docblock"><p>The polygon covers the interior of the block.</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#381-470" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#382-469" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#388-477" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#389-476" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
@ -2,7 +2,7 @@
|
||||
pub roads: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../road/struct.RoadSideID.html" title="struct map_model::objects::road::RoadSideID">RoadSideID</a>>,
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A sequence of roads in order, beginning and ending at the same place. No “crossings” – tracing
|
||||
along this sequence should geometrically yield a simple polygon.</p>
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.roads" class="structfield small-section-header"><a href="#structfield.roads" class="anchor field"></a><code>roads: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../road/struct.RoadSideID.html" title="struct map_model::objects::road::RoadSideID">RoadSideID</a>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#32-379" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#36-77" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="../lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.roads" class="structfield small-section-header"><a href="#structfield.roads" class="anchor field"></a><code>roads: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../road/struct.RoadSideID.html" title="struct map_model::objects::road::RoadSideID">RoadSideID</a>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#32-386" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#36-77" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="../lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
|
||||
block, with no interior roads. This will fail if a map boundary is reached. The results are
|
||||
unusual when crossing the entrance to a tunnel or bridge.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.find_all_single_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#81-106" title="goto source code">[src]</a></div><a href="#method.find_all_single_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_all_single_blocks" class="fnname">find_all_single_blocks</a>(map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>This calculates all single block perimeters for the entire map. The resulting list does not
|
||||
@ -15,17 +15,17 @@ before returning.</p>
|
||||
blocks are adjacent, but the merge wouldn’t create an interior “hole”.</p>
|
||||
<p>Note this may modify both perimeters and still return <code>false</code>. The modification is just to
|
||||
rotate the order of the road loop; this doesn’t logically change the perimeter.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#211-240" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Try to merge all given perimeters. If successful, only one perimeter will be returned.
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#211-247" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Try to merge all given perimeters. If successful, only one perimeter will be returned.
|
||||
Perimeters are never “destroyed” – if not merged, they’ll appear in the results. If
|
||||
<code>stepwise_debug</code> is true, returns after performing just one merge.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.collapse_deadends" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#244-264" title="goto source code">[src]</a></div><a href="#method.collapse_deadends" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.collapse_deadends" class="fnname">collapse_deadends</a>(&mut self)</h4></div></summary><div class="docblock"><p>If the perimeter follows any dead-end roads, “collapse” them and instead make the perimeter
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.collapse_deadends" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#251-271" title="goto source code">[src]</a></div><a href="#method.collapse_deadends" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.collapse_deadends" class="fnname">collapse_deadends</a>(&mut self)</h4></div></summary><div class="docblock"><p>If the perimeter follows any dead-end roads, “collapse” them and instead make the perimeter
|
||||
contain the dead-end.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.partition_by_predicate" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#269-329" title="goto source code">[src]</a></div><a href="#method.partition_by_predicate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.partition_by_predicate" class="fnname">partition_by_predicate</a><F: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, <br> predicate: F<br>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>></h4></div></summary><div class="docblock"><p>Consider the perimeters as a graph, with adjacency determined by sharing any road in common.
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.partition_by_predicate" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#276-336" title="goto source code">[src]</a></div><a href="#method.partition_by_predicate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.partition_by_predicate" class="fnname">partition_by_predicate</a><F: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, <br> predicate: F<br>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>></h4></div></summary><div class="docblock"><p>Consider the perimeters as a graph, with adjacency determined by sharing any road in common.
|
||||
Partition adjacent perimeters, subject to the predicate. Each partition should produce a
|
||||
single result with <code>merge_all</code>.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.calculate_coloring" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#333-367" title="goto source code">[src]</a></div><a href="#method.calculate_coloring" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.calculate_coloring" class="fnname">calculate_coloring</a>(<br> input: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">&[</a><a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a>>></h4></div></summary><div class="docblock"><p>Assign each perimeter one of <code>num_colors</code>, such that no two adjacent perimeters share the
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.calculate_coloring" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#340-374" title="goto source code">[src]</a></div><a href="#method.calculate_coloring" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.calculate_coloring" class="fnname">calculate_coloring</a>(<br> input: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">&[</a><a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a>>></h4></div></summary><div class="docblock"><p>Assign each perimeter one of <code>num_colors</code>, such that no two adjacent perimeters share the
|
||||
same color. May fail. The resulting colors are expressed as <code>[0, num_colors)</code>.</p>
|
||||
</div></details><div id="method.to_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#369-371" title="goto source code">[src]</a></div><a href="#method.to_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.to_block" class="fnname">to_block</a>(self, map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div><div id="method.debug" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#373-378" title="goto source code">[src]</a></div><a href="#method.debug" class="anchor"></a><h4 class="code-header">fn <a href="#method.debug" class="fnname">debug</a>(&self)</h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><div id="method.to_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#376-378" title="goto source code">[src]</a></div><a href="#method.to_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.to_block" class="fnname">to_block</a>(self, map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div><div id="method.debug" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#380-385" title="goto source code">[src]</a></div><a href="#method.debug" class="anchor"></a><h4 class="code-header">fn <a href="#method.debug" class="fnname">debug</a>(&self)</h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
@ -6,7 +6,7 @@ the block may contain buildings and interior roads. In the simple case, a block
|
||||
single “city block”, with no interior roads. It may also cover a “neighborhood”, where the
|
||||
perimeter contains some “major” and the interior consists only of “minor” roads.</p>
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.perimeter" class="structfield small-section-header"><a href="#structfield.perimeter" class="anchor field"></a><code>perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></code></span><span id="structfield.polygon" class="structfield small-section-header"><a href="#structfield.polygon" class="anchor field"></a><code>polygon: <a class="struct" href="../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a></code></span><div class="docblock"><p>The polygon covers the interior of the block.</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#381-470" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#382-469" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#388-477" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#389-476" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
@ -2,7 +2,7 @@
|
||||
pub roads: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/road/struct.RoadSideID.html" title="struct map_model::objects::road::RoadSideID">RoadSideID</a>>,
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A sequence of roads in order, beginning and ending at the same place. No “crossings” – tracing
|
||||
along this sequence should geometrically yield a simple polygon.</p>
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.roads" class="structfield small-section-header"><a href="#structfield.roads" class="anchor field"></a><code>roads: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/road/struct.RoadSideID.html" title="struct map_model::objects::road::RoadSideID">RoadSideID</a>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#32-379" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#36-77" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="objects/lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.roads" class="structfield small-section-header"><a href="#structfield.roads" class="anchor field"></a><code>roads: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/road/struct.RoadSideID.html" title="struct map_model::objects::road::RoadSideID">RoadSideID</a>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#32-386" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#36-77" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="objects/lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
|
||||
block, with no interior roads. This will fail if a map boundary is reached. The results are
|
||||
unusual when crossing the entrance to a tunnel or bridge.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.find_all_single_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#81-106" title="goto source code">[src]</a></div><a href="#method.find_all_single_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_all_single_blocks" class="fnname">find_all_single_blocks</a>(map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>This calculates all single block perimeters for the entire map. The resulting list does not
|
||||
@ -15,17 +15,17 @@ before returning.</p>
|
||||
blocks are adjacent, but the merge wouldn’t create an interior “hole”.</p>
|
||||
<p>Note this may modify both perimeters and still return <code>false</code>. The modification is just to
|
||||
rotate the order of the road loop; this doesn’t logically change the perimeter.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#211-240" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Try to merge all given perimeters. If successful, only one perimeter will be returned.
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#211-247" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>></h4></div></summary><div class="docblock"><p>Try to merge all given perimeters. If successful, only one perimeter will be returned.
|
||||
Perimeters are never “destroyed” – if not merged, they’ll appear in the results. If
|
||||
<code>stepwise_debug</code> is true, returns after performing just one merge.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.collapse_deadends" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#244-264" title="goto source code">[src]</a></div><a href="#method.collapse_deadends" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.collapse_deadends" class="fnname">collapse_deadends</a>(&mut self)</h4></div></summary><div class="docblock"><p>If the perimeter follows any dead-end roads, “collapse” them and instead make the perimeter
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.collapse_deadends" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#251-271" title="goto source code">[src]</a></div><a href="#method.collapse_deadends" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.collapse_deadends" class="fnname">collapse_deadends</a>(&mut self)</h4></div></summary><div class="docblock"><p>If the perimeter follows any dead-end roads, “collapse” them and instead make the perimeter
|
||||
contain the dead-end.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.partition_by_predicate" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#269-329" title="goto source code">[src]</a></div><a href="#method.partition_by_predicate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.partition_by_predicate" class="fnname">partition_by_predicate</a><F: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, <br> predicate: F<br>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>></h4></div></summary><div class="docblock"><p>Consider the perimeters as a graph, with adjacency determined by sharing any road in common.
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.partition_by_predicate" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#276-336" title="goto source code">[src]</a></div><a href="#method.partition_by_predicate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.partition_by_predicate" class="fnname">partition_by_predicate</a><F: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>, <br> predicate: F<br>) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>>></h4></div></summary><div class="docblock"><p>Consider the perimeters as a graph, with adjacency determined by sharing any road in common.
|
||||
Partition adjacent perimeters, subject to the predicate. Each partition should produce a
|
||||
single result with <code>merge_all</code>.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.calculate_coloring" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#333-367" title="goto source code">[src]</a></div><a href="#method.calculate_coloring" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.calculate_coloring" class="fnname">calculate_coloring</a>(<br> input: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">&[</a><a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a>>></h4></div></summary><div class="docblock"><p>Assign each perimeter one of <code>num_colors</code>, such that no two adjacent perimeters share the
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.calculate_coloring" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#340-374" title="goto source code">[src]</a></div><a href="#method.calculate_coloring" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.calculate_coloring" class="fnname">calculate_coloring</a>(<br> input: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">&[</a><a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.usize.html">usize</a>>></h4></div></summary><div class="docblock"><p>Assign each perimeter one of <code>num_colors</code>, such that no two adjacent perimeters share the
|
||||
same color. May fail. The resulting colors are expressed as <code>[0, num_colors)</code>.</p>
|
||||
</div></details><div id="method.to_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#369-371" title="goto source code">[src]</a></div><a href="#method.to_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.to_block" class="fnname">to_block</a>(self, map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div><div id="method.debug" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#373-378" title="goto source code">[src]</a></div><a href="#method.debug" class="anchor"></a><h4 class="code-header">fn <a href="#method.debug" class="fnname">debug</a>(&self)</h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><div id="method.to_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#376-378" title="goto source code">[src]</a></div><a href="#method.to_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.to_block" class="fnname">to_block</a>(self, map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>></h4></div><div id="method.debug" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#380-385" title="goto source code">[src]</a></div><a href="#method.debug" class="anchor"></a><h4 class="code-header">fn <a href="#method.debug" class="fnname">debug</a>(&self)</h4></div></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#27" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.56.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.56.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.56.1/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.56.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
@ -330,6 +330,16 @@
|
||||
<span id="330">330</span>
|
||||
<span id="331">331</span>
|
||||
<span id="332">332</span>
|
||||
<span id="333">333</span>
|
||||
<span id="334">334</span>
|
||||
<span id="335">335</span>
|
||||
<span id="336">336</span>
|
||||
<span id="337">337</span>
|
||||
<span id="338">338</span>
|
||||
<span id="339">339</span>
|
||||
<span id="340">340</span>
|
||||
<span id="341">341</span>
|
||||
<span id="342">342</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">BTreeSet</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="ident">abstutil::Timer</span>;
|
||||
@ -488,7 +498,7 @@
|
||||
<span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="ident">MODIFIED</span>, <span class="ident">block</span>);
|
||||
}
|
||||
}
|
||||
<span class="string">"Auto-merge all neighborhoods"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="string">"Classify neighborhoods"</span> <span class="op">|</span> <span class="string">"Auto-merge all neighborhoods"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">perimeters</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Perimeter</span><span class="op">></span> <span class="op">=</span> <span class="ident">std::mem::take</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">blocks</span>)
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">b</span>)<span class="op">|</span> <span class="ident">b</span>.<span class="ident">perimeter</span>)
|
||||
@ -510,8 +520,7 @@
|
||||
<span class="self">self</span>.<span class="ident">world</span> <span class="op">=</span> <span class="ident">World::bounded</span>(<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_bounds</span>());
|
||||
<span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">clear</span>();
|
||||
|
||||
<span class="comment">// TODO Fix all the crashes, then enable!</span>
|
||||
<span class="kw">if</span> <span class="bool-val">true</span> {
|
||||
<span class="kw">if</span> <span class="ident">x</span> <span class="op">=</span><span class="op">=</span> <span class="string">"Auto-merge all neighborhoods"</span> {
|
||||
<span class="comment">// Actually merge the partitions</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">merged</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
<span class="kw">for</span> <span class="ident">perimeters</span> <span class="kw">in</span> <span class="ident">partitions</span> {
|
||||
@ -533,6 +542,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="string">"Reset"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">return</span> <span class="ident">Transition::Replace</span>(<span class="ident">Blockfinder::new_state</span>(<span class="ident">ctx</span>, <span class="ident">app</span>));
|
||||
}
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">unreachable!</span>(),
|
||||
}
|
||||
}
|
||||
@ -653,11 +665,19 @@
|
||||
.<span class="ident">text</span>(<span class="string">"Collapse dead-ends"</span>)
|
||||
.<span class="ident">hotkey</span>(<span class="ident">Key::C</span>)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_outline</span>
|
||||
.<span class="ident">text</span>(<span class="string">"Classify neighborhoods"</span>)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_outline</span>
|
||||
.<span class="ident">text</span>(<span class="string">"Auto-merge all neighborhoods"</span>)
|
||||
.<span class="ident">hotkey</span>(<span class="ident">Key::A</span>)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_solid_destructive</span>
|
||||
.<span class="ident">text</span>(<span class="string">"Reset"</span>)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
]))
|
||||
.<span class="ident">aligned</span>(<span class="ident">HorizontalAlignment::Left</span>, <span class="ident">VerticalAlignment::Top</span>)
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>)
|
||||
|
@ -174,7 +174,7 @@
|
||||
<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">r"rustdoc 1.56.1 (59eed8a2a 2021-11-01)"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The build time in RFC2822, UTC."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">r"Tue, 02 Nov 2021 00:05:21 +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">r"Tue, 02 Nov 2021 00:19:37 +0000"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">r"x86_64"</span>;
|
||||
|
@ -468,6 +468,13 @@
|
||||
<span id="468">468</span>
|
||||
<span id="469">469</span>
|
||||
<span id="470">470</span>
|
||||
<span id="471">471</span>
|
||||
<span id="472">472</span>
|
||||
<span id="473">473</span>
|
||||
<span id="474">474</span>
|
||||
<span id="475">475</span>
|
||||
<span id="476">476</span>
|
||||
<span id="477">477</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">BTreeSet</span>, <span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="ident">anyhow::Result</span>;
|
||||
@ -679,15 +686,16 @@
|
||||
<span class="doccomment">/// Perimeters are never "destroyed" -- if not merged, they'll appear in the results. If</span>
|
||||
<span class="doccomment">/// `stepwise_debug` is true, returns after performing just one merge.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">merge_all</span>(<span class="kw-2">mut</span> <span class="ident">input</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Perimeter</span><span class="op">></span>, <span class="ident">stepwise_debug</span>: <span class="ident">bool</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">Perimeter</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">results</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Perimeter</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
|
||||
<span class="comment">// Internal dead-ends break merging, so first collapse of those. Do this before even</span>
|
||||
<span class="comment">// looking for neighbors, since find_common_roads doesn't understand dead-ends.</span>
|
||||
<span class="kw">for</span> <span class="ident">p</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">input</span> {
|
||||
<span class="ident">p</span>.<span class="ident">collapse_deadends</span>();
|
||||
}
|
||||
|
||||
<span class="kw">loop</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">debug</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">results</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Perimeter</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
<span class="kw">let</span> <span class="ident">num_input</span> <span class="op">=</span> <span class="ident">input</span>.<span class="ident">len</span>();
|
||||
<span class="lifetime">'INPUT</span>: <span class="kw">for</span> <span class="kw-2">mut</span> <span class="ident">perimeter</span> <span class="kw">in</span> <span class="ident">input</span> {
|
||||
<span class="kw">if</span> <span class="ident">debug</span> {
|
||||
<span class="ident">results</span>.<span class="ident">push</span>(<span class="ident">perimeter</span>);
|
||||
@ -705,8 +713,14 @@
|
||||
<span class="comment">// No match</span>
|
||||
<span class="ident">results</span>.<span class="ident">push</span>(<span class="ident">perimeter</span>);
|
||||
}
|
||||
<span class="comment">// TODO Do we need to repeat in a fixpoint?</span>
|
||||
<span class="ident">results</span>
|
||||
|
||||
<span class="comment">// Should we try merging again?</span>
|
||||
<span class="kw">if</span> <span class="ident">results</span>.<span class="ident">len</span>() <span class="op">></span> <span class="number">1</span> <span class="op">&&</span> <span class="ident">results</span>.<span class="ident">len</span>() <span class="op"><</span> <span class="ident">num_input</span> <span class="op">&&</span> <span class="op">!</span><span class="ident">stepwise_debug</span> {
|
||||
<span class="ident">input</span> <span class="op">=</span> <span class="ident">results</span>;
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
<span class="kw">return</span> <span class="ident">results</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// If the perimeter follows any dead-end roads, "collapse" them and instead make the perimeter</span>
|
||||
|
Loading…
Reference in New Issue
Block a user