mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-23 22:42:32 +03:00
deploy: a0ff011aef
This commit is contained in:
parent
2a84cc99f5
commit
fda4c7dd67
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,8 +4,8 @@
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../ltn/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module partition</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section><div id="sidebar-vars" data-name="partition" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../ltn/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">ltn</a>::<wbr><a class="mod" href="#">partition</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></h1><span class="out-of-band"><a class="srclink" href="../../src/ltn/partition.rs.html#1-411">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">ltn</a>::<wbr><a class="mod" href="#">partition</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></h1><span class="out-of-band"><a class="srclink" href="../../src/ltn/partition.rs.html#1-431">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BlockID.html" title="ltn::partition::BlockID struct">BlockID</a></div><div class="item-right docblock-short"><p>Identifies a single / unmerged block, which never changes</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.NeighborhoodID.html" title="ltn::partition::NeighborhoodID struct">NeighborhoodID</a></div><div class="item-right docblock-short"><p>An opaque ID, won’t be contiguous as we adjust boundaries</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Partitioning.html" title="ltn::partition::Partitioning struct">Partitioning</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="ltn" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.61.0 (fe5b13d68 2022-05-18)" ></div>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.NeighborhoodInfo.html" title="ltn::partition::NeighborhoodInfo struct">NeighborhoodInfo</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Partitioning.html" title="ltn::partition::Partitioning struct">Partitioning</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="ltn" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.61.0 (fe5b13d68 2022-05-18)" ></div>
|
||||
</body></html>
|
@ -1 +1 @@
|
||||
initSidebarItems({"struct":[["BlockID","Identifies a single / unmerged block, which never changes"],["NeighborhoodID","An opaque ID, won’t be contiguous as we adjust boundaries"],["Partitioning",""]]});
|
||||
initSidebarItems({"struct":[["BlockID","Identifies a single / unmerged block, which never changes"],["NeighborhoodID","An opaque ID, won’t be contiguous as we adjust boundaries"],["NeighborhoodInfo",""],["Partitioning",""]]});
|
44
rustdoc/ltn/partition/struct.NeighborhoodInfo.html
Normal file
44
rustdoc/ltn/partition/struct.NeighborhoodInfo.html
Normal file
@ -0,0 +1,44 @@
|
||||
<!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 `NeighborhoodInfo` struct in crate `ltn`."><meta name="keywords" content="rust, rustlang, rust-lang, NeighborhoodInfo"><title>NeighborhoodInfo in ltn::partition - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.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"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../ltn/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../ltn/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">NeighborhoodInfo</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><ul><li><a href="#structfield.block">block</a></li><li><a href="#structfield.color">color</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Clone">Clone</a></li><li><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a></li><li><a href="#impl-Serialize">Serialize</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-DeserializeOwned">DeserializeOwned</a></li><li><a href="#impl-Downcast">Downcast</a></li><li><a href="#impl-DowncastSync">DowncastSync</a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Instrument">Instrument</a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-Same%3CT%3E">Same<T></a></li><li><a href="#impl-ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li><li><a href="#impl-VZip%3CV%3E">VZip<V></a></li></ul></div></section><h2 class="location"><a href="index.html">In ltn::partition</a></h2><div id="sidebar-vars" data-name="NeighborhoodInfo" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../ltn/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../index.html">ltn</a>::<wbr><a href="index.html">partition</a>::<wbr><a class="struct" href="#">NeighborhoodInfo</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></h1><span class="out-of-band"><a class="srclink" href="../../src/ltn/partition.rs.html#42-45">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct NeighborhoodInfo {
|
||||
pub block: <a class="struct" href="../../map_model/objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>,
|
||||
pub color: Color,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.block" class="structfield small-section-header"><a href="#structfield.block" class="anchor field"></a><code>block: <a class="struct" href="../../map_model/objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></code></span><span id="structfield.color" class="structfield small-section-header"><a href="#structfield.color" class="anchor field"></a><code>color: Color</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#47-54">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section></summary><div class="impl-items"><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#48-53">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">fn <a href="#method.new" class="fnname">new</a>(block: <a class="struct" href="../../map_model/objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>) -> Self</h4></section></div></details></div><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><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#41">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#41">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span 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.61.0/src/core/clone.rs.html#134-136">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/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.61.0/std/primitive.reference.html">&</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deserialize%3C%27de%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#41">source</a></span><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><h3 class="code-header in-band">impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deserialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#41">source</a></span><a href="#method.deserialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html#tymethod.deserialize" class="fnname">deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></h4></section></summary><div class='docblock'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Serialize" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#41">source</a></span><a href="#impl-Serialize" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.serialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/ltn/partition.rs.html#41">source</a></span><a href="#method.serialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html#tymethod.serialize" class="fnname">serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></h4></section></summary><div class='docblock'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html#tymethod.serialize">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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.NeighborhoodInfo.html" title="struct ltn::partition::NeighborhoodInfo">NeighborhoodInfo</a></h3></section></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"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/any.rs.html#132-136">source</a></span><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.61.0/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.61.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/any.rs.html#133">source</a></span><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/borrow.rs.html#209-214">source</a></span><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.61.0/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.61.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/borrow.rs.html#211">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.61.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/borrow.rs.html#219">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.61.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Downcast" class="impl has-srclink"><a href="#impl-Downcast" class="anchor"></a><h3 class="code-header in-band">impl<T> Downcast for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_any" class="method trait-impl has-srclink"><a href="#method.into_any" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into_any</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T, <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></h4></section></summary><div class='docblock'><p>Convert <code>Box<dyn Trait></code> (where <code>Trait: Downcast</code>) to <code>Box<dyn Any></code>. <code>Box<dyn Any></code> can
|
||||
then be further <code>downcast</code> into <code>Box<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <a href="#tymethod.into_any">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_any_rc" class="method trait-impl has-srclink"><a href="#method.into_any_rc" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into_any_rc</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a><T>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static></h4></section></summary><div class='docblock'><p>Convert <code>Rc<Trait></code> (where <code>Trait: Downcast</code>) to <code>Rc<Any></code>. <code>Rc<Any></code> can then be
|
||||
further <code>downcast</code> into <code>Rc<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <a href="#tymethod.into_any_rc">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_any" class="method trait-impl has-srclink"><a href="#method.as_any" class="anchor"></a><h4 class="code-header">fn <a class="fnname">as_any</a>(&self) -> &(dyn <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static)</h4></section></summary><div class='docblock'><p>Convert <code>&Trait</code> (where <code>Trait: Downcast</code>) to <code>&Any</code>. This is needed since Rust cannot
|
||||
generate <code>&Any</code>’s vtable from <code>&Trait</code>’s. <a href="#tymethod.as_any">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_any_mut" class="method trait-impl has-srclink"><a href="#method.as_any_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">as_any_mut</a>(&mut self) -> &mut (dyn <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static)</h4></section></summary><div class='docblock'><p>Convert <code>&mut Trait</code> (where <code>Trait: Downcast</code>) to <code>&Any</code>. This is needed since Rust cannot
|
||||
generate <code>&mut Any</code>’s vtable from <code>&mut Trait</code>’s. <a href="#tymethod.as_any_mut">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-DowncastSync" class="impl has-srclink"><a href="#impl-DowncastSync" class="anchor"></a><h3 class="code-header in-band">impl<T> DowncastSync for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_any_arc" class="method trait-impl has-srclink"><a href="#method.into_any_arc" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into_any_arc</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><T>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static></h4></section></summary><div class='docblock'><p>Convert <code>Arc<Trait></code> (where <code>Trait: Downcast</code>) to <code>Arc<Any></code>. <code>Arc<Any></code> can then be
|
||||
further <code>downcast</code> into <code>Arc<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <a href="#tymethod.into_any_arc">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#559">source</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Instrument" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://docs.rs/tracing/0.1.26/src/tracing/instrument.rs.html#155">source</a></span><a href="#impl-Instrument" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://docs.rs/tracing/0.1.26/src/tracing/instrument.rs.html#38">source</a></span><a href="#method.instrument" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.26/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.26/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><div class='docblock'><p>Instruments this type with the provided <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://docs.rs/tracing/0.1.26/src/tracing/instrument.rs.html#74">source</a></span><a href="#method.in_current_span" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.26/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><div class='docblock'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#549">source</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||||
<p>That is, this conversion is whatever the implementation of
|
||||
<code><a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.From.html" title="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Same%3CT%3E" class="impl has-srclink"><a href="#impl-Same%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> Same<T> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output" class="type trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'><p>Should always be <code>Self</code></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/alloc/borrow.rs.html#84-96">source</a></span><a href="#impl-ToOwned" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.61.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="type trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.61.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/alloc/borrow.rs.html#89">source</a></span><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.61.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/alloc/borrow.rs.html#93">source</a></span><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.reference.html">&mut </a>T)</h4></section></summary><div class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</div></div><div class='docblock'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.61.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#604">source</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/convert/mod.rs.html#589">source</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.61.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E" class="impl has-srclink"><a href="#impl-VZip%3CV%3E" class="anchor"></a><h3 class="code-header in-band">impl<V, T> VZip<V> for T <span class="where fmt-newline">where<br> V: MultiLane<T>, </span></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl has-srclink"><a href="#method.vzip" class="anchor"></a><h4 class="code-header">fn <a class="fnname">vzip</a>(self) -> V</h4></section></div></details><section id="impl-DeserializeOwned" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://docs.rs/serde/1.0.126/src/serde/de/mod.rs.html#603">source</a></span><a href="#impl-DeserializeOwned" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></h3></section></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="ltn" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.61.0 (fe5b13d68 2022-05-18)" ></div>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,6 +4,6 @@
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In map_gui::tools::title_screen::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><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../map_gui/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</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></h1><span class="out-of-band"><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-4f1d52d4453364c7/out/built.rs.html#78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.str.html">str</a> = r"Thu, 26 May 2022 14:06:48 +0000";</code></pre></div><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>
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</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></h1><span class="out-of-band"><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-4f1d52d4453364c7/out/built.rs.html#78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.str.html">str</a> = r"Fri, 27 May 2022 12:49:09 +0000";</code></pre></div><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></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="map_gui" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.61.0 (fe5b13d68 2022-05-18)" ></div>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../map_model/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module block</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section><div id="sidebar-vars" data-name="block" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../map_model/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<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></h1><span class="out-of-band"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#1-676">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<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></h1><span class="out-of-band"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#1-677">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><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
|
||||
|
@ -10,45 +10,45 @@
|
||||
}</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.61.0/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><span id="structfield.interior" class="structfield small-section-header"><a href="#structfield.interior" class="anchor field"></a><code>interior: <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/collections/btree/set/struct.BTreeSet.html" title="struct alloc::collections::btree::set::BTreeSet">BTreeSet</a><<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>></code></span><div class="docblock"><p>These roads exist entirely within the perimeter</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#37-666">source</a></span><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></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.single_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#42-92">source</a></span><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(<br> map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="../lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>, <br> skip: &<a class="struct" href="https://doc.rust-lang.org/1.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>><br>) -> <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></section></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#37-667">source</a></span><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></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.single_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#42-92">source</a></span><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(<br> map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="../lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>, <br> skip: &<a class="struct" href="https://doc.rust-lang.org/1.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>><br>) -> <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></section></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, and so <code>skip</code> is used to avoid
|
||||
tracing there.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_all_single_blocks" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#96-123">source</a></span><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.61.0/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>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>This calculates all single block perimeters for the entire map. The resulting list does not
|
||||
cover roads near the map boundary.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_roads_to_skip_tracing" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#129-139">source</a></span><a href="#method.find_roads_to_skip_tracing" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_roads_to_skip_tracing" class="fnname">find_roads_to_skip_tracing</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.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>></h4></section></summary><div class="docblock"><p>Blockfinding is specialized for the LTN tool, so non-driveable roads (cycleways and light
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_roads_to_skip_tracing" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#129-140">source</a></span><a href="#method.find_roads_to_skip_tracing" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_roads_to_skip_tracing" class="fnname">find_roads_to_skip_tracing</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.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>></h4></section></summary><div class="docblock"><p>Blockfinding is specialized for the LTN tool, so non-driveable roads (cycleways and light
|
||||
rail) are considered invisible and can’t be on a perimeter. Previously, there were also
|
||||
some heuristics here to try to skip certain bridges/tunnels that break the planarity of
|
||||
blocks.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.undo_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#143-145">source</a></span><a href="#method.undo_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.undo_invariant" class="fnname">undo_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>A perimeter has the first and last road matching up, but that’s confusing to
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.undo_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#144-146">source</a></span><a href="#method.undo_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.undo_invariant" class="fnname">undo_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>A perimeter has the first and last road matching up, but that’s confusing to
|
||||
work with. Temporarily undo that.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.restore_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#149-151">source</a></span><a href="#method.restore_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.restore_invariant" class="fnname">restore_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>Restore the first=last invariant. Methods may temporarily break this, but must restore it
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.restore_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#150-152">source</a></span><a href="#method.restore_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.restore_invariant" class="fnname">restore_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>Restore the first=last invariant. Methods may temporarily break this, but must restore it
|
||||
before returning.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_to_merge" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#162-301">source</a></span><a href="#method.try_to_merge" class="anchor"></a><h4 class="code-header">fn <a href="#method.try_to_merge" class="fnname">try_to_merge</a>(<br> &mut self, <br> map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, <br> other: &mut <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>, <br> debug_failures: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Try to merge two blocks. Returns true if this is successful, which will only be when the
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_to_merge" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#163-302">source</a></span><a href="#method.try_to_merge" class="anchor"></a><h4 class="code-header">fn <a href="#method.try_to_merge" class="fnname">try_to_merge</a>(<br> &mut self, <br> map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, <br> other: &mut <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>, <br> debug_failures: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Try to merge two blocks. Returns true if this is successful, which will only be when the
|
||||
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>
|
||||
<p>TODO Due to https://github.com/a-b-street/abstreet/issues/841, it seems like rotation
|
||||
sometimes breaks <code>to_block</code>, so for now, always revert to the original upon failure.</p>
|
||||
</div></details><section id="method.check_continuity" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#303-312">source</a></span><a href="#method.check_continuity" class="anchor"></a><h4 class="code-header">fn <a href="#method.check_continuity" class="fnname">check_continuity</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="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.unit.html">()</a>></h4></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reverse_to_fix_winding_order" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#319-353">source</a></span><a href="#method.reverse_to_fix_winding_order" class="anchor"></a><h4 class="code-header">fn <a href="#method.reverse_to_fix_winding_order" class="fnname">reverse_to_fix_winding_order</a>(&self, map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Should we reverse one perimeter to match the winding order?</p>
|
||||
</div></details><section id="method.check_continuity" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#304-313">source</a></span><a href="#method.check_continuity" class="anchor"></a><h4 class="code-header">fn <a href="#method.check_continuity" class="fnname">check_continuity</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="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.unit.html">()</a>></h4></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reverse_to_fix_winding_order" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#320-354">source</a></span><a href="#method.reverse_to_fix_winding_order" class="anchor"></a><h4 class="code-header">fn <a href="#method.reverse_to_fix_winding_order" class="fnname">reverse_to_fix_winding_order</a>(&self, map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Should we reverse one perimeter to match the winding order?</p>
|
||||
<p>This is only meant to be called in the middle of try_to_merge. It assumes both perimeters
|
||||
have already been rotated so the common roads are at the end. The invariant of first=last
|
||||
is not true.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.merge_all" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#358-404">source</a></span><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(<br> map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, <br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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> stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/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>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.merge_all" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#359-405">source</a></span><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(<br> map: &<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, <br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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> stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/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>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.collapse_deadends" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#408-442">source</a></span><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></section></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><section id="method.collapse_deadends" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#409-443">source</a></span><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></section></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><section id="method.partition_by_predicate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#447-507">source</a></span><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.61.0/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.61.0/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/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>>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.partition_by_predicate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#448-508">source</a></span><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.61.0/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.61.0/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/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>>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.calculate_coloring" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#511-545">source</a></span><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.61.0/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.61.0/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a>>></h4></section></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><section id="method.calculate_coloring" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#512-546">source</a></span><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.61.0/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.61.0/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a>>></h4></section></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><section id="method.to_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#547-649">source</a></span><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></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.contains" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#652-657">source</a></span><a href="#method.contains" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.contains" class="fnname">contains</a>(&self, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this perimeter completely enclose the other?</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flip_side_of_road" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#660-665">source</a></span><a href="#method.flip_side_of_road" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.flip_side_of_road" class="fnname">flip_side_of_road</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Shrinks or expands the perimeter by tracing the opposite side of the road.</p>
|
||||
</div></details><section id="method.to_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#548-650">source</a></span><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></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.contains" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#653-658">source</a></span><a href="#method.contains" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.contains" class="fnname">contains</a>(&self, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this perimeter completely enclose the other?</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flip_side_of_road" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#661-666">source</a></span><a href="#method.flip_side_of_road" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.flip_side_of_road" class="fnname">flip_side_of_road</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Shrinks or expands the perimeter by tracing the opposite side of the road.</p>
|
||||
</div></details></div></details></div><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><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#30">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#30">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/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></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span 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.61.0/src/core/clone.rs.html#134-136">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/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.61.0/std/primitive.reference.html">&</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#668-676">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#669-675">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.61.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#669-677">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#670-676">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.61.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deserialize%3C%27de%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#30">source</a></span><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><h3 class="code-header in-band">impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deserialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#30">source</a></span><a href="#method.deserialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html#tymethod.deserialize" class="fnname">deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></h4></section></summary><div class='docblock'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Serialize" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#30">source</a></span><a href="#impl-Serialize" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.serialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#30">source</a></span><a href="#method.serialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html#tymethod.serialize" class="fnname">serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></h4></section></summary><div class='docblock'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html#tymethod.serialize">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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section></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"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/any.rs.html#132-136">source</a></span><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.61.0/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.61.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/any.rs.html#133">source</a></span><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../map_model/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module road</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div></section><div id="sidebar-vars" data-name="road" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../map_model/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<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="#">road</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></h1><span class="out-of-band"><a class="srclink" href="../../../src/map_model/objects/road.rs.html#1-653">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<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="#">road</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></h1><span class="out-of-band"><a class="srclink" href="../../../src/map_model/objects/road.rs.html#1-666">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DirectedRoadID.html" title="map_model::objects::road::DirectedRoadID struct">DirectedRoadID</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Road.html" title="map_model::objects::road::Road struct">Road</a></div><div class="item-right docblock-short"><p>A Road represents a segment between exactly two Intersections. It contains Lanes as children.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RoadID.html" title="map_model::objects::road::RoadID struct">RoadID</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RoadSideID.html" title="map_model::objects::road::RoadSideID struct">RoadSideID</a></div><div class="item-right docblock-short"></div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.SideOfRoad.html" title="map_model::objects::road::SideOfRoad enum">SideOfRoad</a></div><div class="item-right docblock-short"><p>See https://wiki.openstreetmap.org/wiki/Forward_%26_backward,<em>left</em>%26_right.</p>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -10,45 +10,45 @@
|
||||
}</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.61.0/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><span id="structfield.interior" class="structfield small-section-header"><a href="#structfield.interior" class="anchor field"></a><code>interior: <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/collections/btree/set/struct.BTreeSet.html" title="struct alloc::collections::btree::set::BTreeSet">BTreeSet</a><<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>></code></span><div class="docblock"><p>These roads exist entirely within the perimeter</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#37-666">source</a></span><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></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.single_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#42-92">source</a></span><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(<br> map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="objects/lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>, <br> skip: &<a class="struct" href="https://doc.rust-lang.org/1.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>><br>) -> <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></section></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#37-667">source</a></span><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></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.single_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#42-92">source</a></span><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(<br> map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="objects/lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>, <br> skip: &<a class="struct" href="https://doc.rust-lang.org/1.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>><br>) -> <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></section></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, and so <code>skip</code> is used to avoid
|
||||
tracing there.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_all_single_blocks" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#96-123">source</a></span><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.61.0/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>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>This calculates all single block perimeters for the entire map. The resulting list does not
|
||||
cover roads near the map boundary.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_roads_to_skip_tracing" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#129-139">source</a></span><a href="#method.find_roads_to_skip_tracing" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_roads_to_skip_tracing" class="fnname">find_roads_to_skip_tracing</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.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>></h4></section></summary><div class="docblock"><p>Blockfinding is specialized for the LTN tool, so non-driveable roads (cycleways and light
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_roads_to_skip_tracing" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#129-140">source</a></span><a href="#method.find_roads_to_skip_tracing" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_roads_to_skip_tracing" class="fnname">find_roads_to_skip_tracing</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.61.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>></h4></section></summary><div class="docblock"><p>Blockfinding is specialized for the LTN tool, so non-driveable roads (cycleways and light
|
||||
rail) are considered invisible and can’t be on a perimeter. Previously, there were also
|
||||
some heuristics here to try to skip certain bridges/tunnels that break the planarity of
|
||||
blocks.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.undo_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#143-145">source</a></span><a href="#method.undo_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.undo_invariant" class="fnname">undo_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>A perimeter has the first and last road matching up, but that’s confusing to
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.undo_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#144-146">source</a></span><a href="#method.undo_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.undo_invariant" class="fnname">undo_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>A perimeter has the first and last road matching up, but that’s confusing to
|
||||
work with. Temporarily undo that.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.restore_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#149-151">source</a></span><a href="#method.restore_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.restore_invariant" class="fnname">restore_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>Restore the first=last invariant. Methods may temporarily break this, but must restore it
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.restore_invariant" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#150-152">source</a></span><a href="#method.restore_invariant" class="anchor"></a><h4 class="code-header">fn <a href="#method.restore_invariant" class="fnname">restore_invariant</a>(&mut self)</h4></section></summary><div class="docblock"><p>Restore the first=last invariant. Methods may temporarily break this, but must restore it
|
||||
before returning.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_to_merge" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#162-301">source</a></span><a href="#method.try_to_merge" class="anchor"></a><h4 class="code-header">fn <a href="#method.try_to_merge" class="fnname">try_to_merge</a>(<br> &mut self, <br> map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, <br> other: &mut <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>, <br> debug_failures: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Try to merge two blocks. Returns true if this is successful, which will only be when the
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_to_merge" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#163-302">source</a></span><a href="#method.try_to_merge" class="anchor"></a><h4 class="code-header">fn <a href="#method.try_to_merge" class="fnname">try_to_merge</a>(<br> &mut self, <br> map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, <br> other: &mut <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>, <br> debug_failures: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Try to merge two blocks. Returns true if this is successful, which will only be when the
|
||||
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>
|
||||
<p>TODO Due to https://github.com/a-b-street/abstreet/issues/841, it seems like rotation
|
||||
sometimes breaks <code>to_block</code>, so for now, always revert to the original upon failure.</p>
|
||||
</div></details><section id="method.check_continuity" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#303-312">source</a></span><a href="#method.check_continuity" class="anchor"></a><h4 class="code-header">fn <a href="#method.check_continuity" class="fnname">check_continuity</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="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.unit.html">()</a>></h4></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reverse_to_fix_winding_order" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#319-353">source</a></span><a href="#method.reverse_to_fix_winding_order" class="anchor"></a><h4 class="code-header">fn <a href="#method.reverse_to_fix_winding_order" class="fnname">reverse_to_fix_winding_order</a>(&self, map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Should we reverse one perimeter to match the winding order?</p>
|
||||
</div></details><section id="method.check_continuity" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#304-313">source</a></span><a href="#method.check_continuity" class="anchor"></a><h4 class="code-header">fn <a href="#method.check_continuity" class="fnname">check_continuity</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="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.unit.html">()</a>></h4></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reverse_to_fix_winding_order" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#320-354">source</a></span><a href="#method.reverse_to_fix_winding_order" class="anchor"></a><h4 class="code-header">fn <a href="#method.reverse_to_fix_winding_order" class="fnname">reverse_to_fix_winding_order</a>(&self, map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Should we reverse one perimeter to match the winding order?</p>
|
||||
<p>This is only meant to be called in the middle of try_to_merge. It assumes both perimeters
|
||||
have already been rotated so the common roads are at the end. The invariant of first=last
|
||||
is not true.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.merge_all" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#358-404">source</a></span><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(<br> map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, <br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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> stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/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>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.merge_all" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#359-405">source</a></span><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(<br> map: &<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, <br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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> stepwise_debug: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a>, <br> use_expensive_blockfinding: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/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>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.collapse_deadends" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#408-442">source</a></span><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></section></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><section id="method.collapse_deadends" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#409-443">source</a></span><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></section></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><section id="method.partition_by_predicate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#447-507">source</a></span><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.61.0/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.61.0/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/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>>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.partition_by_predicate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#448-508">source</a></span><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.61.0/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.61.0/std/primitive.bool.html">bool</a>>(<br> input: <a class="struct" href="https://doc.rust-lang.org/1.61.0/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.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/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>>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A></span><code class="content"><span class="where fmt-newline">impl<A> <a class="trait" href="https://doc.rust-lang.org/1.61.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.u8.html">u8</a>, A> <span class="where fmt-newline">where<br> A: <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/alloc/trait.Allocator.html" title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></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><section id="method.calculate_coloring" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#511-545">source</a></span><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.61.0/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.61.0/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a>>></h4></section></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><section id="method.calculate_coloring" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#512-546">source</a></span><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.61.0/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.61.0/std/primitive.slice.html">]</a>, <br> num_colors: <a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.61.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.61.0/std/primitive.usize.html">usize</a>>></h4></section></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><section id="method.to_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#547-649">source</a></span><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></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.contains" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#652-657">source</a></span><a href="#method.contains" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.contains" class="fnname">contains</a>(&self, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this perimeter completely enclose the other?</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flip_side_of_road" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#660-665">source</a></span><a href="#method.flip_side_of_road" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.flip_side_of_road" class="fnname">flip_side_of_road</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Shrinks or expands the perimeter by tracing the opposite side of the road.</p>
|
||||
</div></details><section id="method.to_block" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#548-650">source</a></span><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></section><details class="rustdoc-toggle method-toggle" open><summary><section id="method.contains" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#653-658">source</a></span><a href="#method.contains" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.contains" class="fnname">contains</a>(&self, other: &<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.61.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this perimeter completely enclose the other?</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flip_side_of_road" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#661-666">source</a></span><a href="#method.flip_side_of_road" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.flip_side_of_road" class="fnname">flip_side_of_road</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Shrinks or expands the perimeter by tracing the opposite side of the road.</p>
|
||||
</div></details></div></details></div><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><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#30">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#30">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/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></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span 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.61.0/src/core/clone.rs.html#134-136">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/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.61.0/std/primitive.reference.html">&</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.61.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#668-676">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#669-675">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.61.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#669-677">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#670-676">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.61.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.61.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deserialize%3C%27de%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#30">source</a></span><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><h3 class="code-header in-band">impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deserialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#30">source</a></span><a href="#method.deserialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html#tymethod.deserialize" class="fnname">deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></h4></section></summary><div class='docblock'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.126/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Serialize" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#30">source</a></span><a href="#impl-Serialize" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.serialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#30">source</a></span><a href="#method.serialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html#tymethod.serialize" class="fnname">serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/1.61.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="associatedtype" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></h4></section></summary><div class='docblock'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.126/serde/ser/trait.Serialize.html#tymethod.serialize">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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.61.0/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></section></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"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/any.rs.html#132-136">source</a></span><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.61.0/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.61.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.61.0/src/core/any.rs.html#133">source</a></span><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.61.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.61.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -576,13 +576,13 @@
|
||||
<span class="kw">fn</span> <span class="ident">make_world</span>(<span class="ident">ctx</span>: <span class="kw-2">&mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>, <span class="ident">timer</span>: <span class="kw-2">&mut</span> <span class="ident">Timer</span>) -> <span class="ident">World</span><span class="op"><</span><span class="ident">NeighborhoodID</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">world</span> <span class="op">=</span> <span class="ident">World::bounded</span>(<span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_bounds</span>());
|
||||
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>;
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, (<span class="ident">block</span>, <span class="ident">color</span>)) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>() {
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, <span class="ident">info</span>) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>() {
|
||||
<span class="kw">match</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">draw_neighborhood_style</span> {
|
||||
<span class="ident">Style::SimpleColoring</span> => {
|
||||
<span class="ident">world</span>
|
||||
.<span class="ident">add</span>(<span class="kw-2">*</span><span class="ident">id</span>)
|
||||
.<span class="ident">hitbox</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">draw_color</span>(<span class="kw-2">*</span><span class="ident">color</span>)
|
||||
.<span class="ident">hitbox</span>(<span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">draw_color</span>(<span class="ident">info</span>.<span class="ident">color</span>)
|
||||
.<span class="ident">hover_outline</span>(<span class="ident">colors::OUTLINE</span>, <span class="ident">Distance::meters</span>(<span class="number">5.0</span>))
|
||||
.<span class="ident">clickable</span>()
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>);
|
||||
@ -595,8 +595,8 @@
|
||||
<span class="kw">let</span> <span class="ident">hovered_batch</span> <span class="op">=</span> <span class="ident">render_cells</span>.<span class="ident">draw</span>();
|
||||
<span class="ident">world</span>
|
||||
.<span class="ident">add</span>(<span class="kw-2">*</span><span class="ident">id</span>)
|
||||
.<span class="ident">hitbox</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">draw_color</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>))
|
||||
.<span class="ident">hitbox</span>(<span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">draw_color</span>(<span class="ident">info</span>.<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>))
|
||||
.<span class="ident">draw_hovered</span>(<span class="ident">hovered_batch</span>)
|
||||
.<span class="ident">clickable</span>()
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>);
|
||||
@ -614,7 +614,7 @@
|
||||
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">cs</span>.<span class="ident">good_to_bad_red</span>.<span class="ident">eval</span>(<span class="ident">pct</span>);
|
||||
<span class="ident">world</span>
|
||||
.<span class="ident">add</span>(<span class="kw-2">*</span><span class="ident">id</span>)
|
||||
.<span class="ident">hitbox</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">hitbox</span>(<span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">draw_color</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>))
|
||||
.<span class="ident">hover_outline</span>(<span class="ident">colors::OUTLINE</span>, <span class="ident">Distance::meters</span>(<span class="number">5.0</span>))
|
||||
.<span class="ident">clickable</span>()
|
||||
@ -623,7 +623,7 @@
|
||||
<span class="ident">Style::Shortcuts</span> => {
|
||||
<span class="ident">world</span>
|
||||
.<span class="ident">add</span>(<span class="kw-2">*</span><span class="ident">id</span>)
|
||||
.<span class="ident">hitbox</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">hitbox</span>(<span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
|
||||
<span class="comment">// Slight lie, because draw_over_roads has to be drawn after the World</span>
|
||||
.<span class="ident">drawn_in_master_batch</span>()
|
||||
.<span class="ident">hover_outline</span>(<span class="ident">colors::OUTLINE</span>, <span class="ident">Distance::meters</span>(<span class="number">5.0</span>))
|
||||
@ -663,8 +663,8 @@
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">seen_roads</span> <span class="op">=</span> <span class="ident">HashSet::new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">seen_borders</span> <span class="op">=</span> <span class="ident">HashSet::new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">ToggleZoomed::builder</span>();
|
||||
<span class="kw">for</span> (<span class="ident">block</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>().<span class="ident">values</span>() {
|
||||
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">roads</span> {
|
||||
<span class="kw">for</span> <span class="ident">info</span> <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>().<span class="ident">values</span>() {
|
||||
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">roads</span> {
|
||||
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">id</span>.<span class="ident">road</span>;
|
||||
<span class="kw">if</span> <span class="ident">seen_roads</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">r</span>) {
|
||||
<span class="kw">continue</span>;
|
||||
|
@ -146,16 +146,16 @@
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">features</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
|
||||
<span class="comment">// All neighborhood boundaries</span>
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, (<span class="ident">block</span>, <span class="ident">color</span>)) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>() {
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, <span class="ident">info</span>) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>() {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">feature</span> <span class="op">=</span> <span class="ident">Feature</span> {
|
||||
<span class="ident">bbox</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">geometry</span>: <span class="prelude-val">Some</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">to_geojson</span>(<span class="prelude-val">None</span>)),
|
||||
<span class="ident">geometry</span>: <span class="prelude-val">Some</span>(<span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">to_geojson</span>(<span class="prelude-val">None</span>)),
|
||||
<span class="ident">id</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">properties</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">foreign_members</span>: <span class="prelude-val">None</span>,
|
||||
};
|
||||
<span class="ident">feature</span>.<span class="ident">set_property</span>(<span class="string">"type"</span>, <span class="string">"neighborhood"</span>);
|
||||
<span class="ident">feature</span>.<span class="ident">set_property</span>(<span class="string">"fill"</span>, <span class="ident">color</span>.<span class="ident">as_hex</span>());
|
||||
<span class="ident">feature</span>.<span class="ident">set_property</span>(<span class="string">"fill"</span>, <span class="ident">info</span>.<span class="ident">color</span>.<span class="ident">as_hex</span>());
|
||||
<span class="comment">// Cells should cover these up</span>
|
||||
<span class="ident">feature</span>.<span class="ident">set_property</span>(<span class="string">"fill-opacity"</span>, <span class="number">0.0</span>);
|
||||
<span class="ident">features</span>.<span class="ident">push</span>(<span class="ident">feature</span>);
|
||||
|
@ -380,7 +380,7 @@
|
||||
.<span class="ident">partitioning</span>
|
||||
.<span class="ident">all_neighborhoods</span>()
|
||||
.<span class="ident">iter</span>()
|
||||
.<span class="ident">find</span>(<span class="op">|</span>(<span class="kw">_</span>, (<span class="ident">block</span>, <span class="kw">_</span>))<span class="op">|</span> <span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">interior</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">r</span>))
|
||||
.<span class="ident">find</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">info</span>)<span class="op">|</span> <span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">interior</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">r</span>))
|
||||
.<span class="ident">expect</span>(<span class="string">"Can't find neighborhood containing Gregory Street"</span>);
|
||||
<span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">consultation</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">neighborhood</span>);
|
||||
|
||||
|
@ -414,6 +414,26 @@
|
||||
<span id="409">409</span>
|
||||
<span id="410">410</span>
|
||||
<span id="411">411</span>
|
||||
<span id="412">412</span>
|
||||
<span id="413">413</span>
|
||||
<span id="414">414</span>
|
||||
<span id="415">415</span>
|
||||
<span id="416">416</span>
|
||||
<span id="417">417</span>
|
||||
<span id="418">418</span>
|
||||
<span id="419">419</span>
|
||||
<span id="420">420</span>
|
||||
<span id="421">421</span>
|
||||
<span id="422">422</span>
|
||||
<span id="423">423</span>
|
||||
<span id="424">424</span>
|
||||
<span id="425">425</span>
|
||||
<span id="426">426</span>
|
||||
<span id="427">427</span>
|
||||
<span id="428">428</span>
|
||||
<span id="429">429</span>
|
||||
<span id="430">430</span>
|
||||
<span id="431">431</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">anyhow::Result</span>;
|
||||
@ -422,7 +442,7 @@
|
||||
<span class="kw">use</span> <span class="ident">abstio::MapName</span>;
|
||||
<span class="kw">use</span> <span class="ident">abstutil::Timer</span>;
|
||||
<span class="kw">use</span> <span class="ident">map_model::osm::RoadRank</span>;
|
||||
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">Block</span>, <span class="ident">Map</span>, <span class="ident">Perimeter</span>, <span class="ident">RoadID</span>, <span class="ident">RoadSideID</span>};
|
||||
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">Block</span>, <span class="ident">Map</span>, <span class="ident">PathConstraints</span>, <span class="ident">Perimeter</span>, <span class="ident">RoadID</span>, <span class="ident">RoadSideID</span>};
|
||||
<span class="kw">use</span> <span class="ident">widgetry::Color</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::{<span class="ident">colors</span>, <span class="ident">App</span>};
|
||||
@ -442,7 +462,7 @@
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Partitioning</span> {
|
||||
<span class="kw">pub</span> <span class="ident">map</span>: <span class="ident">MapName</span>,
|
||||
<span class="ident">neighborhoods</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">NeighborhoodID</span>, (<span class="ident">Block</span>, <span class="ident">Color</span>)<span class="op">></span>,
|
||||
<span class="ident">neighborhoods</span>: <span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">NeighborhoodID</span>, <span class="ident">NeighborhoodInfo</span><span class="op">></span>,
|
||||
<span class="comment">// The single / unmerged blocks never change</span>
|
||||
<span class="ident">single_blocks</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Block</span><span class="op">></span>,
|
||||
|
||||
@ -454,6 +474,21 @@
|
||||
<span class="ident">use_expensive_blockfinding</span>: <span class="ident">bool</span>,
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">NeighborhoodInfo</span> {
|
||||
<span class="kw">pub</span> <span class="ident">block</span>: <span class="ident">Block</span>,
|
||||
<span class="kw">pub</span> <span class="ident">color</span>: <span class="ident">Color</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">NeighborhoodInfo</span> {
|
||||
<span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">block</span>: <span class="ident">Block</span>) -> <span class="self">Self</span> {
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">block</span>,
|
||||
<span class="ident">color</span>: <span class="ident">Color::CLEAR</span>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Partitioning</span> {
|
||||
<span class="doccomment">/// Only valid before the LTN tool has been activated this session</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">empty</span>() -> <span class="ident">Partitioning</span> {
|
||||
@ -528,7 +563,10 @@
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">neighborhoods</span> <span class="op">=</span> <span class="ident">BTreeMap::new</span>();
|
||||
<span class="kw">for</span> <span class="ident">block</span> <span class="kw">in</span> <span class="ident">blocks</span> {
|
||||
<span class="ident">neighborhoods</span>.<span class="ident">insert</span>(<span class="ident">NeighborhoodID</span>(<span class="ident">neighborhoods</span>.<span class="ident">len</span>()), (<span class="ident">block</span>, <span class="ident">Color::CLEAR</span>));
|
||||
<span class="ident">neighborhoods</span>.<span class="ident">insert</span>(
|
||||
<span class="ident">NeighborhoodID</span>(<span class="ident">neighborhoods</span>.<span class="ident">len</span>()),
|
||||
<span class="ident">NeighborhoodInfo::new</span>(<span class="ident">block</span>),
|
||||
);
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">neighborhood_id_counter</span> <span class="op">=</span> <span class="ident">neighborhoods</span>.<span class="ident">len</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">Partitioning</span> {
|
||||
@ -573,15 +611,16 @@
|
||||
<span class="kw">let</span> <span class="ident">perims</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="self">self</span>
|
||||
.<span class="ident">neighborhoods</span>
|
||||
.<span class="ident">values</span>()
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">pair</span><span class="op">|</span> <span class="ident">pair</span>.<span class="number">0</span>.<span class="ident">perimeter</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">info</span><span class="op">|</span> <span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">collect</span>();
|
||||
<span class="kw">let</span> <span class="ident">colors</span> <span class="op">=</span> <span class="ident">Perimeter::calculate_coloring</span>(<span class="kw-2">&</span><span class="ident">perims</span>, <span class="ident">colors::NEIGHBORHOODS</span>.<span class="ident">len</span>())
|
||||
.<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="op">|</span> (<span class="number">0</span>..<span class="ident">perims</span>.<span class="ident">len</span>()).<span class="ident">collect</span>());
|
||||
<span class="kw">let</span> <span class="ident">orig_coloring</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Color</span><span class="op">></span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">values</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">pair</span><span class="op">|</span> <span class="ident">pair</span>.<span class="number">1</span>).<span class="ident">collect</span>();
|
||||
<span class="kw">for</span> (<span class="ident">pair</span>, <span class="ident">color_idx</span>) <span class="kw">in</span> <span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">values_mut</span>().<span class="ident">zip</span>(<span class="ident">colors</span>.<span class="ident">into_iter</span>()) {
|
||||
<span class="ident">pair</span>.<span class="number">1</span> <span class="op">=</span> <span class="ident">colors::NEIGHBORHOODS</span>[<span class="ident">color_idx</span> <span class="op">%</span> <span class="ident">colors::NEIGHBORHOODS</span>.<span class="ident">len</span>()];
|
||||
<span class="kw">let</span> <span class="ident">orig_coloring</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Color</span><span class="op">></span> <span class="op">=</span>
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">values</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">info</span><span class="op">|</span> <span class="ident">info</span>.<span class="ident">color</span>).<span class="ident">collect</span>();
|
||||
<span class="kw">for</span> (<span class="ident">info</span>, <span class="ident">color_idx</span>) <span class="kw">in</span> <span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">values_mut</span>().<span class="ident">zip</span>(<span class="ident">colors</span>.<span class="ident">into_iter</span>()) {
|
||||
<span class="ident">info</span>.<span class="ident">color</span> <span class="op">=</span> <span class="ident">colors::NEIGHBORHOODS</span>[<span class="ident">color_idx</span> <span class="op">%</span> <span class="ident">colors::NEIGHBORHOODS</span>.<span class="ident">len</span>()];
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">new_coloring</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Color</span><span class="op">></span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">values</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">pair</span><span class="op">|</span> <span class="ident">pair</span>.<span class="number">1</span>).<span class="ident">collect</span>();
|
||||
<span class="kw">let</span> <span class="ident">new_coloring</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Color</span><span class="op">></span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">values</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">info</span><span class="op">|</span> <span class="ident">info</span>.<span class="ident">color</span>).<span class="ident">collect</span>();
|
||||
<span class="ident">orig_coloring</span> <span class="op">!</span><span class="op">=</span> <span class="ident">new_coloring</span>
|
||||
}
|
||||
|
||||
@ -630,7 +669,7 @@
|
||||
.<span class="ident">collect</span>();
|
||||
<span class="kw">if</span> <span class="ident">old_owner_blocks</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="comment">// We're deleting the old neighborhood!</span>
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">get_mut</span>(<span class="kw-2">&</span><span class="ident">new_owner</span>).<span class="ident">unwrap</span>().<span class="number">0</span> <span class="op">=</span> <span class="ident">new_neighborhood_block</span>;
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">get_mut</span>(<span class="kw-2">&</span><span class="ident">new_owner</span>).<span class="ident">unwrap</span>().<span class="ident">block</span> <span class="op">=</span> <span class="ident">new_neighborhood_block</span>;
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">old_owner</span>).<span class="ident">unwrap</span>();
|
||||
<span class="self">self</span>.<span class="ident">block_to_neighborhood</span>.<span class="ident">insert</span>(<span class="ident">id</span>, <span class="ident">new_owner</span>);
|
||||
<span class="comment">// Tell the caller to recreate this SelectBoundary state, switching to the neighborhood</span>
|
||||
@ -643,14 +682,15 @@
|
||||
<span class="comment">// as the old_owner (so the UI for trimming a neighborhood is less jarring), and create new</span>
|
||||
<span class="comment">// neighborhoods for the others.</span>
|
||||
<span class="ident">old_neighborhood_blocks</span>.<span class="ident">sort_by_key</span>(<span class="op">|</span><span class="ident">block</span><span class="op">|</span> <span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">interior</span>.<span class="ident">len</span>());
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">get_mut</span>(<span class="kw-2">&</span><span class="ident">old_owner</span>).<span class="ident">unwrap</span>().<span class="number">0</span> <span class="op">=</span> <span class="ident">old_neighborhood_blocks</span>.<span class="ident">pop</span>().<span class="ident">unwrap</span>();
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">get_mut</span>(<span class="kw-2">&</span><span class="ident">old_owner</span>).<span class="ident">unwrap</span>().<span class="ident">block</span> <span class="op">=</span>
|
||||
<span class="ident">old_neighborhood_blocks</span>.<span class="ident">pop</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">new_splits</span> <span class="op">=</span> <span class="op">!</span><span class="ident">old_neighborhood_blocks</span>.<span class="ident">is_empty</span>();
|
||||
<span class="kw">for</span> <span class="ident">split_piece</span> <span class="kw">in</span> <span class="ident">old_neighborhood_blocks</span> {
|
||||
<span class="kw">let</span> <span class="ident">new_neighborhood</span> <span class="op">=</span> <span class="ident">NeighborhoodID</span>(<span class="self">self</span>.<span class="ident">neighborhood_id_counter</span>);
|
||||
<span class="self">self</span>.<span class="ident">neighborhood_id_counter</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// Temporary color</span>
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>
|
||||
.<span class="ident">insert</span>(<span class="ident">new_neighborhood</span>, (<span class="ident">split_piece</span>, <span class="ident">Color::CLEAR</span>));
|
||||
.<span class="ident">insert</span>(<span class="ident">new_neighborhood</span>, <span class="ident">NeighborhoodInfo::new</span>(<span class="ident">split_piece</span>));
|
||||
}
|
||||
<span class="kw">if</span> <span class="ident">new_splits</span> {
|
||||
<span class="comment">// We need to update the owner of all single blocks in these new pieces</span>
|
||||
@ -660,7 +700,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">get_mut</span>(<span class="kw-2">&</span><span class="ident">new_owner</span>).<span class="ident">unwrap</span>().<span class="number">0</span> <span class="op">=</span> <span class="ident">new_neighborhood_block</span>;
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>.<span class="ident">get_mut</span>(<span class="kw-2">&</span><span class="ident">new_owner</span>).<span class="ident">unwrap</span>().<span class="ident">block</span> <span class="op">=</span> <span class="ident">new_neighborhood_block</span>;
|
||||
<span class="self">self</span>.<span class="ident">block_to_neighborhood</span>.<span class="ident">insert</span>(<span class="ident">id</span>, <span class="ident">new_owner</span>);
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>)
|
||||
}
|
||||
@ -677,7 +717,7 @@
|
||||
<span class="comment">// TODO This can get unintuitive -- if we remove a block bordering two other</span>
|
||||
<span class="comment">// neighborhoods, which one should we donate to?</span>
|
||||
<span class="kw">let</span> <span class="ident">current_perim_set</span>: <span class="ident">BTreeSet</span><span class="op"><</span><span class="ident">RoadSideID</span><span class="op">></span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">neighborhoods</span>[<span class="kw-2">&</span><span class="ident">old_owner</span>]
|
||||
.<span class="number">0</span>
|
||||
.<span class="ident">block</span>
|
||||
.<span class="ident">perimeter</span>
|
||||
.<span class="ident">roads</span>
|
||||
.<span class="ident">iter</span>()
|
||||
@ -693,7 +733,7 @@
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">new_owner</span>, <span class="kw">_</span>)) <span class="op">=</span> <span class="self">self</span>
|
||||
.<span class="ident">neighborhoods</span>
|
||||
.<span class="ident">iter</span>()
|
||||
.<span class="ident">find</span>(<span class="op">|</span>(<span class="kw">_</span>, (<span class="ident">block</span>, <span class="kw">_</span>))<span class="op">|</span> <span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">roads</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">other_side</span>))
|
||||
.<span class="ident">find</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">info</span>)<span class="op">|</span> <span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">roads</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">other_side</span>))
|
||||
{
|
||||
<span class="kw">let</span> <span class="ident">new_owner</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">new_owner</span>;
|
||||
<span class="kw">return</span> <span class="self">self</span>.<span class="ident">transfer_block</span>(<span class="ident">map</span>, <span class="ident">id</span>, <span class="ident">old_owner</span>, <span class="ident">new_owner</span>);
|
||||
@ -706,7 +746,7 @@
|
||||
<span class="self">self</span>.<span class="ident">neighborhood_id_counter</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// Temporary color</span>
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>
|
||||
.<span class="ident">insert</span>(<span class="ident">new_owner</span>, (<span class="self">self</span>.<span class="ident">get_block</span>(<span class="ident">id</span>).<span class="ident">clone</span>(), <span class="ident">Color::CLEAR</span>));
|
||||
.<span class="ident">insert</span>(<span class="ident">new_owner</span>, <span class="ident">NeighborhoodInfo::new</span>(<span class="self">self</span>.<span class="ident">get_block</span>(<span class="ident">id</span>).<span class="ident">clone</span>()));
|
||||
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">transfer_block</span>(<span class="ident">map</span>, <span class="ident">id</span>, <span class="ident">old_owner</span>, <span class="ident">new_owner</span>);
|
||||
<span class="kw">if</span> <span class="ident">result</span>.<span class="ident">is_err</span>() {
|
||||
<span class="comment">// Revert the change above!</span>
|
||||
@ -719,7 +759,7 @@
|
||||
<span class="comment">// Read-only</span>
|
||||
<span class="kw">impl</span> <span class="ident">Partitioning</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">neighborhood_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">NeighborhoodID</span>) -> <span class="kw-2">&</span><span class="ident">Block</span> {
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhoods</span>[<span class="kw-2">&</span><span class="ident">id</span>].<span class="number">0</span>
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhoods</span>[<span class="kw-2">&</span><span class="ident">id</span>].<span class="ident">block</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">neighborhood_area_km2</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">NeighborhoodID</span>) -> <span class="ident">String</span> {
|
||||
@ -729,10 +769,10 @@
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">neighborhood_color</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">NeighborhoodID</span>) -> <span class="ident">Color</span> {
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>[<span class="kw-2">&</span><span class="ident">id</span>].<span class="number">1</span>
|
||||
<span class="self">self</span>.<span class="ident">neighborhoods</span>[<span class="kw-2">&</span><span class="ident">id</span>].<span class="ident">color</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">all_neighborhoods</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="kw-2">&</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">NeighborhoodID</span>, (<span class="ident">Block</span>, <span class="ident">Color</span>)<span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">all_neighborhoods</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="kw-2">&</span><span class="ident">BTreeMap</span><span class="op"><</span><span class="ident">NeighborhoodID</span>, <span class="ident">NeighborhoodInfo</span><span class="op">></span> {
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhoods</span>
|
||||
}
|
||||
|
||||
@ -740,8 +780,8 @@
|
||||
<span class="kw">fn</span> <span class="ident">neighborhood_containing</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">find_block</span>: <span class="ident">BlockID</span>) -> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">NeighborhoodID</span><span class="op">></span> {
|
||||
<span class="comment">// TODO We could probably build this mapping up when we do Perimeter::merge_all</span>
|
||||
<span class="kw">let</span> <span class="ident">find_block</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_block</span>(<span class="ident">find_block</span>);
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, (<span class="ident">block</span>, <span class="kw">_</span>)) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhoods</span> {
|
||||
<span class="kw">if</span> <span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">find_block</span>.<span class="ident">perimeter</span>) {
|
||||
<span class="kw">for</span> (<span class="ident">id</span>, <span class="ident">info</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhoods</span> {
|
||||
<span class="kw">if</span> <span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">find_block</span>.<span class="ident">perimeter</span>) {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">id</span>);
|
||||
}
|
||||
}
|
||||
|
@ -512,8 +512,8 @@
|
||||
|
||||
<span class="comment">// Fade all neighborhood interiors, so it's very clear when a route cuts through</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">GeomBatch::new</span>();
|
||||
<span class="kw">for</span> (<span class="ident">block</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>().<span class="ident">values</span>() {
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">app</span>.<span class="ident">cs</span>.<span class="ident">fade_map_dark</span>, <span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>());
|
||||
<span class="kw">for</span> <span class="ident">info</span> <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">partitioning</span>.<span class="ident">all_neighborhoods</span>().<span class="ident">values</span>() {
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">app</span>.<span class="ident">cs</span>.<span class="ident">fade_map_dark</span>, <span class="ident">info</span>.<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>());
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">world</span> <span class="op">=</span> <span class="ident">World::bounded</span>(<span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_bounds</span>());
|
||||
|
@ -179,7 +179,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.61.0 (fe5b13d68 2022-05-18)"</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"Thu, 26 May 2022 14:06:48 +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"Fri, 27 May 2022 12:49:09 +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>;
|
||||
|
@ -679,6 +679,7 @@
|
||||
<span id="674">674</span>
|
||||
<span id="675">675</span>
|
||||
<span id="676">676</span>
|
||||
<span id="677">677</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">std::fmt</span>;
|
||||
|
||||
@ -810,6 +811,7 @@
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">find_roads_to_skip_tracing</span>(<span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) -> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">RoadID</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">skip</span> <span class="op">=</span> <span class="ident">HashSet::new</span>();
|
||||
<span class="kw">for</span> <span class="ident">r</span> <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">all_roads</span>() {
|
||||
<span class="comment">// TODO Redundant</span>
|
||||
<span class="kw">if</span> <span class="ident">r</span>.<span class="ident">is_light_rail</span>() {
|
||||
<span class="ident">skip</span>.<span class="ident">insert</span>(<span class="ident">r</span>.<span class="ident">id</span>);
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">PathConstraints::Car</span>.<span class="ident">can_use_road</span>(<span class="ident">r</span>, <span class="ident">map</span>) {
|
||||
|
@ -656,6 +656,19 @@
|
||||
<span id="651">651</span>
|
||||
<span id="652">652</span>
|
||||
<span id="653">653</span>
|
||||
<span id="654">654</span>
|
||||
<span id="655">655</span>
|
||||
<span id="656">656</span>
|
||||
<span id="657">657</span>
|
||||
<span id="658">658</span>
|
||||
<span id="659">659</span>
|
||||
<span id="660">660</span>
|
||||
<span id="661">661</span>
|
||||
<span id="662">662</span>
|
||||
<span id="663">663</span>
|
||||
<span id="664">664</span>
|
||||
<span id="665">665</span>
|
||||
<span id="666">666</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections::BTreeSet</span>;
|
||||
<span class="kw">use</span> <span class="ident">std::fmt</span>;
|
||||
|
||||
@ -701,6 +714,19 @@
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">both_sides</span>(<span class="self">self</span>) -> [<span class="ident">RoadSideID</span>; <span class="number">2</span>] {
|
||||
[
|
||||
<span class="ident">RoadSideID</span> {
|
||||
<span class="ident">road</span>: <span class="self">self</span>,
|
||||
<span class="ident">side</span>: <span class="ident">SideOfRoad::Right</span>,
|
||||
},
|
||||
<span class="ident">RoadSideID</span> {
|
||||
<span class="ident">road</span>: <span class="self">self</span>,
|
||||
<span class="ident">side</span>: <span class="ident">SideOfRoad::Left</span>,
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">Eq</span>, <span class="ident">Hash</span>, <span class="ident">PartialEq</span>, <span class="ident">PartialOrd</span>, <span class="ident">Ord</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
|
||||
|
Loading…
Reference in New Issue
Block a user