This commit is contained in:
dabreegster 2021-07-11 20:50:44 +00:00
parent d8466dc124
commit 4e30294b95
11 changed files with 39 additions and 27 deletions

View File

@ -1,6 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in game::pregame::built_info - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b46195c1bf7e0216/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = r&quot;Sun, 11 Jul 2021 20:27:45 +0000&quot;;</pre><div class="docblock"><p>The build time in RFC2822, UTC.</p>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b46195c1bf7e0216/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = r&quot;Sun, 11 Jul 2021 20:49:38 +0000&quot;;</pre><div class="docblock"><p>The build time in RFC2822, UTC.</p>
</div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script></body></html>

View File

@ -1,7 +1,7 @@
<!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 `command` mod in crate `map_gui`."><meta name="keywords" content="rust, rustlang, rust-lang, command"><title>map_gui::tools::command - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module command</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a></p><div id="sidebar-vars" data-name="command" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a class="mod" href="">command</a><button id="copy-path" onclick="copy_path(this)"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/map_gui/tools/command.rs.html#1-171" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a class="mod" href="">command</a><button id="copy-path" onclick="copy_path(this)"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/map_gui/tools/command.rs.html#1-176" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.RunCommand.html" title="map_gui::tools::command::RunCommand struct">RunCommand</a></td><td class="docblock-short"><p>Executes a command and displays STDOUT and STDERR in a loading screen window. Only works on
native, of course.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="map_gui" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
panel: Panel,
on_load: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;&gt;&gt;,
}</pre></div><h2 id="fields" class="fields small-section-header">
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><span id="structfield.on_load" class="structfield small-section-header"><a href="#structfield.on_load" class="anchor field"></a><code>on_load: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;&gt;&gt;</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><h3 id="impl" class="impl"><code class="in-band">impl&lt;A:&nbsp;<a class="trait" href="../../trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static&gt; <a class="struct" href="struct.ImportCity.html" title="struct map_gui::tools::importer::ImportCity">ImportCity</a>&lt;A&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#21-85" title="goto source code">[src]</a></h3></summary><div class="impl-items"><h4 id="method.new_state" class="method"><code>pub fn <a href="#method.new_state" class="fnname">new_state</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;on_load: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;&gt;<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn State&lt;A&gt;&gt;</code><a href="#method.new_state" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#22-84" title="goto source code">[src]</a></h4></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><h3 id="impl-State%3CA%3E" class="impl"><code class="in-band">impl&lt;A:&nbsp;<a class="trait" href="../../trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static&gt; State&lt;A&gt; for <a class="struct" href="struct.ImportCity.html" title="struct map_gui::tools::importer::ImportCity">ImportCity</a>&lt;A&gt;</code><a href="#impl-State%3CA%3E" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#87-150" title="goto source code">[src]</a></h3></summary><div class="impl-items"><h4 id="method.event" class="method hidden trait-impl"><code>fn <a href="#tymethod.event" class="fnname">event</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;</code><a href="#method.event" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#88-145" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><span id="structfield.on_load" class="structfield small-section-header"><a href="#structfield.on_load" class="anchor field"></a><code>on_load: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;&gt;&gt;</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><h3 id="impl" class="impl"><code class="in-band">impl&lt;A:&nbsp;<a class="trait" href="../../trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static&gt; <a class="struct" href="struct.ImportCity.html" title="struct map_gui::tools::importer::ImportCity">ImportCity</a>&lt;A&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#21-85" title="goto source code">[src]</a></h3></summary><div class="impl-items"><h4 id="method.new_state" class="method"><code>pub fn <a href="#method.new_state" class="fnname">new_state</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;on_load: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;&gt;<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn State&lt;A&gt;&gt;</code><a href="#method.new_state" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#22-84" title="goto source code">[src]</a></h4></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><h3 id="impl-State%3CA%3E" class="impl"><code class="in-band">impl&lt;A:&nbsp;<a class="trait" href="../../trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static&gt; State&lt;A&gt; for <a class="struct" href="struct.ImportCity.html" title="struct map_gui::tools::importer::ImportCity">ImportCity</a>&lt;A&gt;</code><a href="#impl-State%3CA%3E" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#87-150" title="goto source code">[src]</a></h3></summary><div class="impl-items"><h4 id="method.event" class="method hidden trait-impl"><code>fn <a href="#tymethod.event" class="fnname">event</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, _: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;</code><a href="#method.event" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#88-145" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
</div><h4 id="method.draw" class="method hidden trait-impl"><code>fn <a href="#tymethod.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, _: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>A)</code><a href="#method.draw" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/importer.rs.html#147-149" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
</div><h4 id="method.draw_baselayer" class="method hidden trait-impl"><code>pub fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</code><a href="#method.draw_baselayer" class="anchor"></a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
</div><h4 id="method.on_destroy" class="method hidden trait-impl"><code>pub fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>A)</code><a href="#method.on_destroy" class="anchor"></a></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2149,7 +2149,7 @@
<span class="kw">fn</span> <span class="ident">reimport_map</span>(<span class="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&amp;</span><span class="ident">App</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Box</span><span class="op">&lt;</span><span class="kw">dyn</span> <span class="ident">State</span><span class="op">&lt;</span><span class="ident">App</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="ident">RunCommand::new_state</span>(
<span class="ident">ctx</span>,
<span class="ident">app</span>,
<span class="bool-val">false</span>,
<span class="macro">vec!</span>[
<span class="ident">find_exe</span>(<span class="string">&quot;importer&quot;</span>),
<span class="string">&quot;--map&quot;</span>.<span class="ident">to_string</span>(),

View File

@ -178,7 +178,7 @@
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;rustdoc 1.53.0 (53cb7b09b 2021-06-17)&quot;</span>;
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The build time in RFC2822, UTC.&quot;#</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">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;Sun, 11 Jul 2021 20:27:45 +0000&quot;</span>;
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;Sun, 11 Jul 2021 20:49:38 +0000&quot;</span>;
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The target architecture, given by `CARGO_CFG_TARGET_ARCH`.&quot;#</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">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;x86_64&quot;</span>;

View File

@ -139,7 +139,7 @@
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">path</span>)) <span class="op">=</span> <span class="ident">maybe_path</span> {
<span class="ident">Transition::Replace</span>(<span class="ident">RunCommand::new_state</span>(
<span class="ident">ctx</span>,
<span class="ident">app</span>,
<span class="bool-val">true</span>,
<span class="macro">vec!</span>[
<span class="ident">find_exe</span>(<span class="string">&quot;import_grid2demand&quot;</span>),
<span class="macro">format!</span>(<span class="string">&quot;--map={}&quot;</span>, <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_name</span>().<span class="ident">path</span>()),

View File

@ -172,6 +172,11 @@
<span id="169">169</span>
<span id="170">170</span>
<span id="171">171</span>
<span id="172">172</span>
<span id="173">173</span>
<span id="174">174</span>
<span id="175">175</span>
<span id="176">176</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">std::collections::VecDeque</span>;
<span class="kw">use</span> <span class="ident">std::time::Duration</span>;
@ -195,6 +200,7 @@
<span class="ident">max_capacity</span>: <span class="ident">usize</span>,
<span class="ident">started</span>: <span class="ident">Instant</span>,
<span class="ident">last_drawn</span>: <span class="ident">Instant</span>,
<span class="ident">show_success_popup</span>: <span class="ident">bool</span>,
<span class="comment">// Wrapped in an Option just to make calling from event() work. The bool is success, and the</span>
<span class="comment">// strings are the last lines of output.</span>
<span class="ident">on_load</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Box</span><span class="op">&lt;</span><span class="kw">dyn</span> <span class="ident">FnOnce</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">A</span>, <span class="ident">bool</span>, <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Transition</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span><span class="op">&gt;</span><span class="op">&gt;</span>,
@ -203,7 +209,7 @@
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">A</span>: <span class="ident">AppLike</span> <span class="op">+</span> <span class="lifetime">&#39;static</span><span class="op">&gt;</span> <span class="ident">RunCommand</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new_state</span>(
<span class="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>,
<span class="kw">_</span>: <span class="kw-2">&amp;</span><span class="ident">A</span>,
<span class="ident">show_success_popup</span>: <span class="ident">bool</span>,
<span class="ident">args</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>,
<span class="ident">on_load</span>: <span class="ident">Box</span><span class="op">&lt;</span><span class="kw">dyn</span> <span class="ident">FnOnce</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">A</span>, <span class="ident">bool</span>, <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Transition</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span><span class="op">&gt;</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Box</span><span class="op">&lt;</span><span class="kw">dyn</span> <span class="ident">State</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span><span class="op">&gt;</span> {
@ -232,6 +238,7 @@
<span class="ident">max_capacity</span>,
<span class="ident">started</span>: <span class="ident">Instant::now</span>(),
<span class="ident">last_drawn</span>: <span class="ident">Instant::now</span>(),
<span class="ident">show_success_popup</span>,
<span class="ident">on_load</span>: <span class="prelude-val">Some</span>(<span class="ident">on_load</span>),
})
}
@ -325,15 +332,18 @@
<span class="kw">if</span> <span class="op">!</span><span class="ident">success</span> {
<span class="ident">lines</span>.<span class="ident">push</span>(<span class="macro">format!</span>(<span class="string">&quot;Command failed: {:?}&quot;</span>, <span class="ident">status</span>));
}
<span class="kw">return</span> <span class="ident">Transition::Multi</span>(<span class="macro">vec!</span>[
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">transitions</span> <span class="op">=</span> <span class="macro">vec!</span>[
<span class="ident">Transition::Pop</span>,
(<span class="self">self</span>.<span class="ident">on_load</span>.<span class="ident">take</span>().<span class="ident">unwrap</span>())(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">success</span>, <span class="ident">lines</span>.<span class="ident">clone</span>()),
<span class="ident">Transition::Push</span>(<span class="ident">PopupMsg::new_state</span>(
];
<span class="kw">if</span> <span class="op">!</span><span class="ident">success</span> <span class="op">|</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">show_success_popup</span> {
<span class="ident">transitions</span>.<span class="ident">push</span>(<span class="ident">Transition::Push</span>(<span class="ident">PopupMsg::new_state</span>(
<span class="ident">ctx</span>,
<span class="kw">if</span> <span class="ident">success</span> { <span class="string">&quot;Success!&quot;</span> } <span class="kw">else</span> { <span class="string">&quot;Failure!&quot;</span> },
<span class="ident">lines</span>,
)),
]);
)));
}
<span class="kw">return</span> <span class="ident">Transition::Multi</span>(<span class="ident">transitions</span>);
}
<span class="ident">Transition::Keep</span>

View File

@ -260,7 +260,7 @@
}
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">A</span>: <span class="ident">AppLike</span> <span class="op">+</span> <span class="lifetime">&#39;static</span><span class="op">&gt;</span> <span class="ident">State</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">ImportCity</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span> {
<span class="kw">fn</span> <span class="ident">event</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">A</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Transition</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span> {
<span class="kw">fn</span> <span class="ident">event</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="kw">_</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">A</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Transition</span><span class="op">&lt;</span><span class="ident">A</span><span class="op">&gt;</span> {
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">event</span>(<span class="ident">ctx</span>) {
<span class="ident">Outcome::Clicked</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="kw">match</span> <span class="ident">x</span>.<span class="ident">as_ref</span>() {
<span class="string">&quot;close&quot;</span> <span class="op">=</span><span class="op">&gt;</span> <span class="ident">Transition::Pop</span>,
@ -281,7 +281,7 @@
<span class="kw">match</span> <span class="ident">grab_geojson_from_clipboard</span>() {
<span class="prelude-val">Ok</span>(()) <span class="op">=</span><span class="op">&gt;</span> <span class="ident">Transition::Push</span>(<span class="kw">crate</span><span class="ident">::tools::RunCommand::new_state</span>(
<span class="ident">ctx</span>,
<span class="ident">app</span>,
<span class="bool-val">true</span>,
<span class="ident">args</span>,
<span class="ident">Box::new</span>(<span class="op">|</span><span class="kw">_</span>, <span class="kw">_</span>, <span class="ident">success</span>, <span class="kw-2">mut</span> <span class="ident">lines</span><span class="op">|</span> {
<span class="kw">if</span> <span class="ident">success</span> {