<linkrel="alternate icon"type="image/png"href="../favicon-32x32.png"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[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='../widgetry/index.html'><divclass='logo-container rust-logo'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass="location">Struct Image</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#fields">Fields</a><divclass="sidebar-links"><ahref="#structfield.bg_color">bg_color</a><ahref="#structfield.color">color</a><ahref="#structfield.content_mode">content_mode</a><ahref="#structfield.corner_rounding">corner_rounding</a><ahref="#structfield.dims">dims</a><ahref="#structfield.padding">padding</a><ahref="#structfield.source">source</a><ahref="#structfield.tooltip">tooltip</a></div><aclass="sidebar-title"href="#implementations">Methods</a><divclass="sidebar-links"><ahref="#method.bg_color">bg_color</a><ahref="#method.build_batch">build_batch</a><ahref="#method.color">color</a><ahref="#method.content_mode">content_mode</a><ahref="#method.corner_rounding">corner_rounding</a><ahref="#method.dims">dims</a><ahref="#method.empty">empty</a><ahref="#method.from_batch">from_batch</a><ahref="#method.from_bytes">from_bytes</a><ahref="#method.from_path">from_path</a><ahref="#method.into_widget">into_widget</a><ahref="#method.merged_image_style">merged_image_style</a><ahref="#method.padding">padding</a><ahref="#method.source">source</a><ahref="#method.source_batch">source_batch</a><ahref="#method.source_bytes">source_bytes</a><ahref="#method.source_path">source_path</a><ahref="#method.tooltip">tooltip</a><ahref="#method.untinted">untinted</a></div><aclass="sidebar-title"href="#trait-implementations">Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-Clone">Clone</a><ahref="#impl-Debug">Debug</a><ahref="#impl-Default">Default</a></div><aclass="sidebar-title"href="#synthetic-implementations">Auto Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-RefUnwindSafe">RefUnwindSafe</a><ahref="#impl-Send">Send</a><ahref="#impl-Sync">Sync</a><ahref="#impl-Unpin">Unpin</a><ahref="#impl-UnwindSafe">UnwindSafe</a></div><aclass="sidebar-title"href="#blanket-implementations">Blanket Implementations</a><divclass="sidebar-links"><ahref="#impl-Any">Any</a><ahref="#impl-Borrow%3CT%3E">Borrow<T></a><ahref="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><ahref="#impl-Downcast">Downcast</a><ahref="#impl-DowncastSync">DowncastSync</a><ahref="#impl-From%3CT%3E">From<T></a><ahref="#impl-Into%3CU%3E">Into<U></a><ahref="#impl-Same%3CT%3E">Same<T></a><ahref="#impl-ToOwned">ToOwned</a><ahref="#impl-TryFrom%3CU%3E">TryFrom<U></a><ahref="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><pclass="location"><ahref="index.html">widgetry</a></p><script>window.sidebarCurrent={name:"Image",ty:"struct",relpath:""};</script><scriptdefersrc="sidebar-items.js"></script></div></nav><divclass="theme-picker"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"><imgsrc="../brush.svg"width="18"alt="Pick another theme!"></button><divid="theme-choices"role="menu"></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><buttontype="button"class="help-button">?</button>
}</pre></div><divclass="docblock"><p>A stylable UI component builder which presents vector graphics from an <ahref="../widgetry/widgets/image/enum.ImageSource.html"title="ImageSource"><code>ImageSource</code></a>.</p>
several similar images using a builder pattern.</p>
</div><h4id="method.from_path"class="method"><code>pub fn <ahref="#method.from_path"class="fnname">from_path</a>(filename: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#65-70"title="goto source code">[src]</a></h4><divclass="docblock"><p>Create an SVG <code>Image</code>, read from <code>filename</code>, which is colored to match <code>Style.icon_fg</code></p>
</div><h4id="method.untinted"class="method"><code>pub fn <ahref="#method.untinted"class="fnname">untinted</a>(filename: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#76-78"title="goto source code">[src]</a></h4><divclass="docblock"><p>Create an SVG <code>Image</code>, read from <code>filename</code>.</p>
<li><code>label</code>: a label to describe the bytes for debugging purposes</li>
<li><code>bytes</code>: UTF-8 encoded bytes of the SVG</li>
</ul>
</div><h4id="method.from_batch"class="method"><code>pub fn <ahref="#method.from_batch"class="fnname">from_batch</a>(batch: <aclass="struct"href="../widgetry/geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>, bounds: <aclass="struct"href="../geom/bounds/struct.Bounds.html"title="struct geom::bounds::Bounds">Bounds</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#97-102"title="goto source code">[src]</a></h4><divclass="docblock"><p>Create a new <code>Image</code> from a <ahref="../widgetry/geom/struct.GeomBatch.html"title="GeomBatch"><code>GeomBatch</code></a>.</p>
</div><h4id="method.source"class="method"><code>pub fn <ahref="#method.source"class="fnname">source</a>(self, source: <aclass="enum"href="../widgetry/widgets/image/enum.ImageSource.html"title="enum widgetry::widgets::image::ImageSource">ImageSource</a><'a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#107-110"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a new source for the <code>Image</code>'s data.</p>
<p>This will replace any previously set source.</p>
</div><h4id="method.source_path"class="method"><code>pub fn <ahref="#method.source_path"class="fnname">source_path</a>(self, path: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#115-117"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the path to an SVG file for the image.</p>
<p>This will replace any image source previously set.</p>
</div><h4id="method.source_bytes"class="method"><code>pub fn <ahref="#method.source_bytes"class="fnname">source_bytes</a>(self, labeled_bytes: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#127-133"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the bytes for the image.</p>
<p>This will replace any image source previously set.</p>
<ul>
<li><code>labeled_bytes</code>: is a (<code>label</code>, <code>bytes</code>) tuple you can generate with
<li><code>label</code>: a label to describe the bytes for debugging purposes</li>
<li><code>bytes</code>: UTF-8 encoded bytes of the SVG</li>
</ul>
</div><h4id="method.source_batch"class="method"><code>pub fn <ahref="#method.source_batch"class="fnname">source_batch</a>(self, batch: <aclass="struct"href="../widgetry/geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>, bounds: <aclass="struct"href="../geom/bounds/struct.Bounds.html"title="struct geom::bounds::Bounds">Bounds</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#141-143"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the GeomBatch for the button.</p>
<p>This will replace any image source previously set.</p>
<p>This method is useful when doing more complex transforms. For example, to re-write more than
one color for your image, do so externally and pass in the resultant GeomBatch here.</p>
</div><h4id="method.tooltip"class="method"><code>pub fn <ahref="#method.tooltip"class="fnname">tooltip</a>(self, tooltip: <aclass="struct"href="../widgetry/text/struct.Text.html"title="struct widgetry::text::Text">Text</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#146-149"title="goto source code">[src]</a></h4><divclass="docblock"><p>Add a tooltip to appear when hovering over the image.</p>
</div><h4id="method.merged_image_style"class="method"><code>pub fn <ahref="#method.merged_image_style"class="fnname">merged_image_style</a>(&'c self, other: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'c </a>Self) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#152-171"title="goto source code">[src]</a></h4><divclass="docblock"><p>Create a new <code>Image</code> based on <code>self</code>, but overriding with any values set on <code>other</code>.</p>
</div><h4id="method.color"class="method"><code>pub fn <ahref="#method.color"class="fnname">color</a><RWC: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="../widgetry/geom/enum.RewriteColor.html"title="enum widgetry::geom::RewriteColor">RewriteColor</a>>>(self, value: RWC) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#174-177"title="goto source code">[src]</a></h4><divclass="docblock"><p>Rewrite the color of the image.</p>
</div><h4id="method.bg_color"class="method"><code>pub fn <ahref="#method.bg_color"class="fnname">bg_color</a>(self, value: <aclass="struct"href="../widgetry/color/struct.Color.html"title="struct widgetry::color::Color">Color</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#180-183"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a background color for the image.</p>
</div><h4id="method.dims"class="method"><code>pub fn <ahref="#method.dims"class="fnname">dims</a><D: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="../widgetry/screen_geom/struct.ScreenDims.html"title="struct widgetry::screen_geom::ScreenDims">ScreenDims</a>>>(self, dims: D) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#190-193"title="goto source code">[src]</a></h4><divclass="docblock"><p>Scale the bounds containing the image. If <code>image_dims</code> are not specified, the images
intrinsic size will be used.</p>
<p>See <ahref="../widgetry/widgets/image/struct.Image.html#method.content_mode"title="Self::content_mode"><code>Self::content_mode</code></a> to control how the image scales to fit
its custom bounds.</p>
</div><h4id="method.content_mode"class="method"><code>pub fn <ahref="#method.content_mode"class="fnname">content_mode</a>(self, value: <aclass="enum"href="../widgetry/enum.ContentMode.html"title="enum widgetry::ContentMode">ContentMode</a>) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#202-205"title="goto source code">[src]</a></h4><divclass="docblock"><p>If a custom <code>dims</code> was set, control how the image should be scaled to its new bounds</p>
<p>If <code>dims</code> were not specified, the image will not be scaled, so content_mode has no
affect.</p>
<p>The default, <ahref="../widgetry/enum.ContentMode.html#variant.ScaleAspectFit"title="ContentMode::ScaleAspectFit"><code>ContentMode::ScaleAspectFit</code></a> will only grow as much as it can while
maintaining its aspect ratio and not exceeding its bounds</p>
</div><h4id="method.corner_rounding"class="method"><code>pub fn <ahref="#method.corner_rounding"class="fnname">corner_rounding</a><R: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="../widgetry/widgets/enum.CornerRounding.html"title="enum widgetry::widgets::CornerRounding">CornerRounding</a>>>(self, value: R) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#208-211"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set independent rounding for each of the image's corners</p>
</div><h4id="method.padding"class="method"><code>pub fn <ahref="#method.padding"class="fnname">padding</a><EI: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="../widgetry/widgets/struct.EdgeInsets.html"title="struct widgetry::widgets::EdgeInsets">EdgeInsets</a>>>(self, value: EI) -> Self</code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#214-217"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set padding for the image</p>
</div><h4id="method.build_batch"class="method"><code>pub fn <ahref="#method.build_batch"class="fnname">build_batch</a>(&self, ctx: &<aclass="struct"href="../widgetry/event_ctx/struct.EventCtx.html"title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -><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.tuple.html">(</a><aclass="struct"href="../widgetry/geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>, <aclass="struct"href="../geom/bounds/struct.Bounds.html"title="struct geom::bounds::Bounds">Bounds</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#220-286"title="goto source code">[src]</a></h4><divclass="docblock"><p>Render the <code>Image</code> and any styling (padding, background, etc.) to a <code>GeomBatch</code>.</p>
</div><h4id="method.into_widget"class="method"><code>pub fn <ahref="#method.into_widget"class="fnname">into_widget</a>(self, ctx: &<aclass="struct"href="../widgetry/event_ctx/struct.EventCtx.html"title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -><aclass="struct"href="../widgetry/widgets/struct.Widget.html"title="struct widgetry::widgets::Widget">Widget</a></code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#288-308"title="goto source code">[src]</a></h4></div><h2id="trait-implementations"class="small-section-header">Trait Implementations<ahref="#trait-implementations"class="anchor"></a></h2><divid="trait-implementations-list"><h3id="impl-Clone"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-Clone"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#10"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.clone"class="method hidden"><code>fn <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone"class="fnname">clone</a>(&self) -><aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#10"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Returns a copy of the value. <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></div><h3id="impl-Debug"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-Debug"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#10"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.fmt"class="method hidden"><code>fn <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt"class="fnname">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#10"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3id="impl-Default"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html"title="trait core::default::Default">Default</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-Default"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#10"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.default"class="method hidden"><code>fn <ahref="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default"class="fnname">default</a>() -><aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><aclass="srclink"href="../src/widgetry/widgets/image.rs.html#10"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Returns the "default value" for a type. <ahref="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div></div><h2id="synthetic-implementations"class="small-section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor"></a></h2><divid="synthetic-implementations-list"><h3id="impl-RefUnwindSafe"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html"title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-RefUnwindSafe"class="anchor"></a><aclass="srclink"href="../src/widgetry/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-Send"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-Send"class="anchor"></a><aclass="srclink"href="../src/widgetry/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-Sync"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-Sync"class="anchor"></a><aclass="srclink"href="../src/widgetry/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-Unpin"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c><spanclass="where fmt-newline">where<br> 'a: 'c, </span></code><ahref="#impl-Unpin"class="anchor"></a><aclass="srclink"href="../src/widgetry/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-UnwindSafe"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html"title="trait std::panic::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="../widgetry/widgets/image/struct.Image.html"title="struct widgetry::widgets::image::Image">Image</a><'a, 'c></code><ahref="#impl-UnwindSafe"class="anchor"></a><aclass="srclink"href="../src/widgetry/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div></div><h2id="blanket-implementations"class="small-section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor"></a></h2><divid="blanket-implementations-list"><h3id="impl-Any"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T <spanclass="where fmt-newline">where<br> T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref="#impl-Any"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.type_id"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id"class="fnname">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></code><aclass="srclink"h
</div></div><h3id="impl-Borrow%3CT%3E"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref="#impl-Borrow%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.borrow"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow"class="fnname">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3id="impl-BorrowMut%3CT%3E"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref="#impl-BorrowMut%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.borrow_mut"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fnname">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3id="impl-Downcast"class="impl"><codeclass="in-band">impl<T> Downcast for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a>, </span></code><ahref="#impl-Downcast"class="anchor"></a></h3><divclass="impl-items"><h4id="method.into_any"class="method hidden"><code>pub fn <ahref="#method.into_any"class="fnname">into_any</a>(self: <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/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static, <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>></code></h4><divclass='docblock hidden'><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>. <ahref="#tymethod.into_any">Read more</a></p>
</div><h4id="method.into_any_rc"class="method hidden"><code>pub fn <ahref="#method.into_any_rc"class="fnname">into_any_rc</a>(self: <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><dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static></code></h4><divclass='docblock hidden'><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>. <ahref="#tymethod.into_any_rc">Read more</a></p>
</div><h4id="method.as_any"class="method hidden"><code>pub fn <ahref="#method.as_any"class="fnname">as_any</a>(&self) ->&(dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static)</code></h4><divclass='docblock hidden'><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. <ahref="#tymethod.as_any">Read more</a></p>
</div><h4id="method.as_any_mut"class="method hidden"><code>pub fn <ahref="#method.as_any_mut"class="fnname">as_any_mut</a>(&mut self) ->&mut (dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static)</code></h4><divclass='docblock hidden'><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. <ahref="#tymethod.as_any_mut">Read more</a></p>
</div></div><h3id="impl-DowncastSync"class="impl"><codeclass="in-band">impl<T> DowncastSync for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> + <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> + <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a>, </span></code><ahref="#impl-DowncastSync"class="anchor"></a></h3><divclass="impl-items"><h4id="method.into_any_arc"class="method hidden"><code>pub fn <ahref="#method.into_any_arc"class="fnname">into_any_arc</a>(self: <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html"title="struct alloc::sync::Arc">Arc</a><T>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html"title="struct alloc::sync::Arc">Arc</a><dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static + <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> + <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a>></code></h4><divclass='docblock hidden'><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>. <ahref="#tymethod.into_any_arc">Read more</a></p>
</div></div><h3id="impl-From%3CT%3E"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</code><ahref="#impl-From%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.from"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from"class="fnname">from</a>(t: T) -> T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-Into%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T>, </span></code><ahref="#impl-Into%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.into"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into"class="fnname">into</a>(self) -> U</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-Same%3CT%3E"class="impl"><codeclass="in-band">impl<T> Same<T> for T</code><ahref="#impl-Same%3CT%3E"class="anchor"></a></h3><divclass="impl-items"><h4id="associatedtype.Output"class="type"><code>type <ahref="#associatedtype.Output"class="type">Output</a> = T</code></h4><divclass='docblock'><p>Should always be <code>Self</code></p>
</div></div><h3id="impl-ToOwned"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></code><ahref="#impl-ToOwned"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Owned"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="type">Owned</a> = T</code></h4><divclass='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4id="method.to_owned"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fnname">to_owned</a>(&self) -> T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4id="method.clone_into"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fnname">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91"title="goto source code">[src]</a></h4><divclass="item-info hidden"><divclass="stab unstable"><details><summary><spanclass="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><divclass='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3id="impl-TryFrom%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></code><ahref="#impl-TryFrom%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Error"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_from"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-TryInto%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref="#impl-TryInto%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Error-1"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_into"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into"class="fnname">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>