<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `SimCallback` trait in crate `sim`."><metaname="keywords"content="rust, rustlang, rust-lang, SimCallback"><title>sim::SimCallback - Rust</title><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../dark.css"><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><scriptsrc="../storage.js"></script><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="shortcut icon"href="../favicon.ico"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu">☰</div><ahref='../sim/index.html'><divclass='logo-container'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass='location'>Trait SimCallback</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#required-methods">Required Methods</a><divclass="sidebar-links"><ahref="#tymethod.run">run</a></div><aclass="sidebar-title"href="#implementations">Methods</a><divclass="sidebar-links"><ahref="#method.downcast">downcast</a><ahref="#method.downcast_mut">downcast_mut</a><ahref="#method.downcast_rc">downcast_rc</a><ahref="#method.downcast_ref">downcast_ref</a><ahref="#method.is">is</a></div><aclass="sidebar-title"href="#implementors">Implementors</a></div><pclass='location'><ahref='index.html'>sim</a></p><script>window.sidebarCurrent={name:'SimCallback',ty:'trait',relpath:''};</script><scriptdefersrc="sidebar-items.js"></script></div></nav><divclass="theme-picker"><buttonid="theme-picker"aria-label="Pick another theme!"><imgsrc="../brush.svg"width="18"alt="Pick another theme!"></button><divid="theme-choices"></div></div><scriptsrc="../theme.js"></script><navclass="sub"><formclass="search-form"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input"name="search"disabledautocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"></div><aid="settings-menu"href="../settings.html"><imgsrc="../wheel.svg"width="18"alt="Change settings"></a></div></form></nav><sectionid="main"class="content"><h1class='fqn'><spanclass='out-of-band'><spanid='render-detail'><aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass='inner'>−</span>]</a></span><aclass='srclink'href='../src/sim/sim/mod.rs.html#1032-1035'title='goto source code'>[src]</a></span><spanclass='in-band'>Trait <ahref='index.html'>sim</a>::<wbr><aclass="trait"href=''>SimCallback</a></span></h1><divclass="docblock type-decl hidden-by-usual-hider"><preclass='rust trait'>pub trait SimCallback: Downcast {
<h2id='required-methods'class='small-section-header'>Required methods<ahref='#required-methods'class='anchor'></a></h2><divclass='methods'><h3id='tymethod.run'class='method'><code>fn <ahref='#tymethod.run'class='fnname'>run</a>(&mut self, sim: &<aclass="struct"href="../sim/struct.Sim.html"title="struct sim::Sim">Sim</a>, map: &<aclass="struct"href="../map_model/struct.Map.html"title="struct map_model::Map">Map</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3></div><spanclass='loading-content'>Loading content...</span><h2id='implementations'class='small-section-header'>Implementations<ahref='#implementations'class='anchor'></a></h2><h3id='impl'class='impl'><codeclass='in-band'>impl dyn <aclass="trait"href="../sim/sim/trait.SimCallback.html"title="trait sim::sim::SimCallback">SimCallback</a></code><ahref='#impl'class='anchor'></a></h3><divclass='impl-items'><h4id='method.is'class="method"><code>pub fn <ahref='#method.is'class='fnname'>is</a><__T: <aclass="trait"href="../sim/sim/trait.SimCallback.html"title="trait sim::sim::SimCallback">SimCallback</a>>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><divclass='docblock'><p>Returns true if the trait object wraps an object of type <code>__T</code>.</p>
</div><h4id='method.downcast'class="method"><code>pub fn <ahref='#method.downcast'class='fnname'>downcast</a><__T: <aclass="trait"href="../sim/sim/trait.SimCallback.html"title="trait sim::sim::SimCallback">SimCallback</a>>(<br> self: <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><Self><br>) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><__T>, <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><Self>></code></h4><divclass='docblock'><p>Returns a boxed object from a boxed trait object if the underlying object is of type
</div><h4id='method.downcast_rc'class="method"><code>pub fn <ahref='#method.downcast_rc'class='fnname'>downcast_rc</a><__T: <aclass="trait"href="../sim/sim/trait.SimCallback.html"title="trait sim::sim::SimCallback">SimCallback</a>>(<br> self: <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html"title="struct alloc::rc::Rc">Rc</a><Self><br>) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html"title="struct alloc::rc::Rc">Rc</a><__T>, <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html"title="struct alloc::rc::Rc">Rc</a><Self>></code></h4><divclass='docblock'><p>Returns an <code>Rc</code>-ed object from an <code>Rc</code>-ed trait object if the underlying object is of
</div><h4id='method.downcast_ref'class="method"><code>pub fn <ahref='#method.downcast_ref'class='fnname'>downcast_ref</a><__T: <aclass="trait"href="../sim/sim/trait.SimCallback.html"title="trait sim::sim::SimCallback">SimCallback</a>>(&self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>__T></code></h4><divclass='docblock'><p>Returns a reference to the object within the trait object if it is of type <code>__T</code>, or
</div><h4id='method.downcast_mut'class="method"><code>pub fn <ahref='#method.downcast_mut'class='fnname'>downcast_mut</a><__T: <aclass="trait"href="../sim/sim/trait.SimCallback.html"title="trait sim::sim::SimCallback">SimCallback</a>>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__T></code></h4><divclass='docblock'><p>Returns a mutable reference to the object within the trait object if it is of type