<!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="A mutable builder for a group of colored polygons."><metaname="keywords"content="rust, rustlang, rust-lang, GeomBatch"><title>GeomBatch in widgetry - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceSerif4-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../FiraSans-Regular.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../FiraSans-Medium.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceCodePro-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceSerif4-Bold.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceCodePro-Semibold.ttf.woff2"><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../ayu.css"disabled><linkrel="stylesheet"type="text/css"href="../dark.css"disabled><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><scriptid="default-settings"></script><scriptsrc="../storage.js"></script><scriptsrc="../crates.js"></script><scriptdefersrc="../main.js"></script>
<noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="alternate icon"type="image/png"href="../favicon-16x16.png"><linkrel="alternate icon"type="image/png"href="../favicon-32x32.png"><linkrel="icon"type="image/svg+xml"href="../favicon.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="sidebar-logo"href="../widgetry/index.html"><divclass="logo-container"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></div>
}</code></pre></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A mutable builder for a group of colored polygons.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.push"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#39-41">source</a></span><ahref="#method.push"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.push"class="fnname">push</a><F: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="color/enum.Fill.html"title="enum widgetry::color::Fill">Fill</a>>>(&mut self, fill: F, p: <aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a>)</h4></section></summary><divclass="docblock"><p>Adds a single polygon, painted according to <code>Fill</code></p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.push_with_z"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#46-50">source</a></span><ahref="#method.push_with_z"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.push_with_z"class="fnname">push_with_z</a><F: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="color/enum.Fill.html"title="enum widgetry::color::Fill">Fill</a>>>(&mut self, fill: F, p: <aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a>, z_offset: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>)</h4></section></summary><divclass="docblock"><p>Offset z value to render above/below other polygons.
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.unshift"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#53-55">source</a></span><ahref="#method.unshift"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.unshift"class="fnname">unshift</a><F: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="color/enum.Fill.html"title="enum widgetry::color::Fill">Fill</a>>>(&mut self, fill: F, p: <aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a>)</h4></section></summary><divclass="docblock"><p>Adds a single polygon to the front of the batch, painted according to <code>Fill</code></p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.shift"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#58-60">source</a></span><ahref="#method.shift"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.shift"class="fnname">shift</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Removes the first polygon in the batch.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.extend"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#63-68">source</a></span><ahref="#method.extend"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.extend"class="fnname">extend</a><F: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="color/enum.Fill.html"title="enum widgetry::color::Fill">Fill</a>>>(&mut self, fill: F, polys: <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a>>)</h4></section></summary><divclass="docblock"><p>Applies one Fill to many polygons.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.append"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#71-73">source</a></span><ahref="#method.append"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.append"class="fnname">append</a>(&mut self, other: <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>)</h4></section></summary><divclass="docblock"><p>Appends all colored polygons from another batch to the current one.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.consume"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#76-78">source</a></span><ahref="#method.consume"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.consume"class="fnname">consume</a>(self) -><aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">(</a><aclass="enum"href="color/enum.Fill.html"title="enum widgetry::color::Fill">Fill</a>, <aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">)</a>><spanclass="notable-traits"><spanclass="notable-traits-tooltip">ⓘ<spanclass="notable-traits-tooltiptext"><spanclass="docblock"><spanclass="notable">Notable traits for <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.u8.html">u8</a>, A></span><codeclass="content"><spanclass="where fmt-newline">impl<A><aclass="trait"href="https://doc.rust-lang.org/1.60.0/std/io/trait.Write.html"title="trait std::io::Write">Write</a> for <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.u8.html">u8</a>, A><spanclass="where fmt-newline">where<br> A: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/alloc/trait.Allocator.html"title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></summary><divclass="docblock"><p>Returns the colored polygons in this batch, destroying the batch.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.draw"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#81-84">source</a></span><ahref="#method.draw"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.draw"class="fnname">draw</a>(self, g: &mut <aclass="struct"href="drawing/struct.GfxCtx.html"title="struct widgetry::drawing::GfxCtx">GfxCtx</a><'_>)</h4></section></summary><divclass="docblock"><p>Draws the batch, consuming it. Only use this for drawing things once.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.upload"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#88-90">source</a></span><ahref="#method.upload"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.upload"class="fnname">upload</a>(self, ctx: &<aclass="struct"href="event_ctx/struct.EventCtx.html"title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -><aclass="struct"href="backend_glow/struct.Drawable.html"title="struct widgetry::backend_glow::Drawable">Drawable</a></h4></section></summary><divclass="docblock"><p>Upload the batch of polygons to the GPU, returning something that can be cheaply redrawn
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.batch"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#93-95">source</a></span><ahref="#method.batch"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.batch"class="fnname">batch</a>(self) -><aclass="struct"href="widgets/struct.Widget.html"title="struct widgetry::widgets::Widget">Widget</a></h4></section></summary><divclass="docblock"><p>Wrap in a Widget for layouting, so this batch can become part of a larger one.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.into_widget"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#98-100">source</a></span><ahref="#method.into_widget"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.into_widget"class="fnname">into_widget</a>(self, ctx: &<aclass="struct"href="event_ctx/struct.EventCtx.html"title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -><aclass="struct"href="widgets/struct.Widget.html"title="struct widgetry::widgets::Widget">Widget</a></h4></section></summary><divclass="docblock"><p>Wrap in a Widget, so the batch can be drawn as part of a Panel.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.get_bounds"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#103-112">source</a></span><ahref="#method.get_bounds"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.get_bounds"class="fnname">get_bounds</a>(&self) -><aclass="struct"href="../geom/bounds/struct.Bounds.html"title="struct geom::bounds::Bounds">Bounds</a></h4></section></summary><divclass="docblock"><p>Compute the bounds of all polygons in this batch.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.autocrop"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#115-124">source</a></span><ahref="#method.autocrop"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.autocrop"class="fnname">autocrop</a>(self) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Sets the top-left to 0, 0. Not sure exactly when this should be used.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.unioned_polygon"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#127-133">source</a></span><ahref="#method.unioned_polygon"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.unioned_polygon"class="fnname">unioned_polygon</a>(&self) -><aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a></h4></section></summary><divclass="docblock"><p>Builds a single polygon covering everything in this batch. Use to create a hitbox.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.is_empty"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#136-138">source</a></span><ahref="#method.is_empty"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.is_empty"class="fnname">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>True when the batch is empty.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.get_dims"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#141-149">source</a></span><ahref="#method.get_dims"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.get_dims"class="fnname">get_dims</a>(&self) -><aclass="struct"href="screen_geom/struct.ScreenDims.html"title="struct widgetry::screen_geom::ScreenDims">ScreenDims</a></h4></section></summary><divclass="docblock"><p>Returns the width and height of all geometry contained in the batch.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.load_svg"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#152-154">source</a></span><ahref="#method.load_svg"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.load_svg"class="fnname">load_svg</a><P: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="struct"href="drawing/struct.Prerender.html"title="struct widgetry::drawing::Prerender">Prerender</a>>, I: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.str.html">str</a>>>(<br> prerender: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.reference.html">&</a>P, <br> filename: I<br>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Returns a batch containing an SVG from a file.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.load_svg_bytes"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#157-164">source</a></span><ahref="#method.load_svg_bytes"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.load_svg_bytes"class="fnname">load_svg_bytes</a><P: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="struct"href="drawing/struct.Prerender.html"title="struct widgetry::drawing::Prerender">Prerender</a>>>(<br> prerender: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.reference.html">&</a>P, <br> labeled_bytes: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">(</a>&<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.str.html">str</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.u8.html">u8</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.slice.html">]</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">)</a><br>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Returns a GeomBatch from the bytes of a utf8 encoded SVG string.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.load_svg_bytes_uncached"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#171-173">source</a></span><ahref="#method.load_svg_bytes_uncached"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.load_svg_bytes_uncached"class="fnname">load_svg_bytes_uncached</a>(raw: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.u8.html">u8</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.slice.html">]</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Returns a GeomBatch from the bytes of a utf8 encoded SVG string.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.color"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#176-183">source</a></span><ahref="#method.color"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.color"class="fnname">color</a>(self, transformation: <aclass="enum"href="geom/enum.RewriteColor.html"title="enum widgetry::geom::RewriteColor">RewriteColor</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Transforms all colors in a batch.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.centered_on"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#186-191">source</a></span><ahref="#method.centered_on"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.centered_on"class="fnname">centered_on</a>(self, center: <aclass="struct"href="../geom/pt/struct.Pt2D.html"title="struct geom::pt::Pt2D">Pt2D</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Translates the batch to be centered on some point.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.translate"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#194-199">source</a></span><ahref="#method.translate"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.translate"class="fnname">translate</a>(self, dx: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>, dy: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Translates the batch by some offset.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.rotate"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#202-207">source</a></span><ahref="#method.rotate"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.rotate"class="fnname">rotate</a>(self, angle: <aclass="struct"href="../geom/angle/struct.Angle.html"title="struct geom::angle::Angle">Angle</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Rotates each polygon in the batch relative to the center of that polygon.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.rotate_around_batch_center"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#210-216">source</a></span><ahref="#method.rotate_around_batch_center"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.rotate_around_batch_center"class="fnname">rotate_around_batch_center</a>(self, angle: <aclass="struct"href="../geom/angle/struct.Angle.html"title="struct geom::angle::Angle">Angle</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Rotates each polygon in the batch relative to the center of the entire batch.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.scale"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#219-221">source</a></span><ahref="#method.scale"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.scale"class="fnname">scale</a>(self, factor: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Scales the batch by some factor.</p>
</div></details><sectionid="method.scale_xy"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#223-235">source</a></span><ahref="#method.scale_xy"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.scale_xy"class="fnname">scale_xy</a>(self, x_factor: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>, y_factor: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.set_z_offset"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#239-247">source</a></span><ahref="#method.set_z_offset"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.set_z_offset"class="fnname">set_z_offset</a>(self, offset: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.f64.html">f64</a>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Overrides the Z-ordering offset for the batch. Must be in (-1, 0], with values closer to -1
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.into_geojson"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#252-268">source</a></span><ahref="#method.into_geojson"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.into_geojson"class="fnname">into_geojson</a>(self, gps_bounds: <aclass="enum"href="https://doc.rust-lang.org/1.60.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="struct"href="../geom/bounds/struct.GPSBounds.html"title="struct geom::bounds::GPSBounds">GPSBounds</a>>) -><aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><Feature><spanclass="notable-traits"><spanclass="notable-traits-tooltip">ⓘ<spanclass="notable-traits-tooltiptext"><spanclass="docblock"><spanclass="notable">Notable traits for <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.u8.html">u8</a>, A></span><codeclass="content"><spanclass="where fmt-newline">impl<A><aclass="trait"href="https://doc.rust-lang.org/1.60.0/std/io/trait.Write.html"title="trait std::io::Write">Write</a> for <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.u8.html">u8</a>, A><spanclass="where fmt-newline">where<br> A: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/alloc/trait.Allocator.html"title="trait core::alloc::Allocator">Allocator</a>, </span></span></code></span></span></span></span></h4></section></summary><divclass="docblock"><p>Exports the batch to a list of GeoJSON features, labeling each colored polygon. Z-values,
</div></details></div></details><h2id="trait-implementations"class="small-section-header">Trait Implementations<ahref="#trait-implementations"class="anchor"></a></h2><divid="trait-implementations-list"><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Clone"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#11">source</a></span><ahref="#impl-Clone"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.clone"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#11">source</a></span><ahref="#method.clone"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.60.0/core/clone/trait.Clone.html#tymethod.clone"class="fnname">clone</a>(&self) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass='docblock'><p>Returns a copy of the value. <ahref="https://doc.rust-lang.org/1.60.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.clone_from"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/clone.rs.html#130">source</a></span><ahref="#method.clone_from"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.60.0/core/clone/trait.Clone.html#method.clone_from"class="fnname">clone_from</a>(&mut self, source: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.reference.html">&</a>Self)</h4></section></summary><divclass='docblock'><p>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/1.60.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Debug"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#19-27">source</a></span><ahref="#impl-Debug"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.fmt"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#20-26">source</a></span><ahref="#method.fmt"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.60.0/core/fmt/trait.Debug.html#tymethod.fmt"class="fnname">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.60.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.60.0/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></h4></section></summary><divclass='docblock'><p>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/1.60.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Default"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#271-275">source</a></span><ahref="#impl-Default"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/default/trait.Default.html"title="trait core::default::Default">Default</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.default"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#272-274">source</a></span><ahref="#method.default"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.60.0/core/default/trait.Default.html#tymethod.default"class="fnname">default</a>() -> Self</h4></section></summary><divclass='docblock'><p>Returns the “default value” for a type. <ahref="https://doc.rust-lang.org/1.60.0/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-From%3CGeomBatch%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/mapspace/mod.rs.html#109-117">source</a></span><ahref="#impl-From%3CGeomBatch%3E"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><<aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>> for <aclass="struct"href="mapspace/struct.ToggleZoomedBuilder.html"title="struct widgetry::mapspace::ToggleZoomedBuilder">ToggleZoomedBuilder</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.from-1"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/mapspace/mod.rs.html#110-116">source</a></span><ahref="#method.from-1"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html#tymethod.from"class="fnname">from</a>(unzoomed: <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>) -> Self</h4></section></summary><divclass='docblock'><p>Performs the conversion.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-From%3CVec%3C(F%2C%20Polygon)%2C%20Global%3E%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#277-285">source</a></span><ahref="#impl-From%3CVec%3C(F%2C%20Polygon)%2C%20Global%3E%3E"class="anchor"></a><h3class="code-header in-band">impl<F: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="color/enum.Fill.html"title="enum widgetry::color::Fill">Fill</a>>><aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><<aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">(</a>F, <aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">)</a>, <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>>> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/widgetry/geom/mod.rs.html#279-284">source</a></span><ahref="#method.from"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html#tymethod.from"class="fnname">from</a>(list: <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><<aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">(</a>F, <aclass="struct"href="../geom/polygon/struct.Polygon.html"title="struct geom::polygon::Polygon">Polygon</a><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.tuple.html">)</a>>) -><aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h4></section></summary><divclass="docblock"><p>Creates a batch of filled polygons.</p>
</div></details></div></details></div><h2id="synthetic-implementations"class="small-section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor"></a></h2><divid="synthetic-implementations-list"><sectionid="impl-RefUnwindSafe"class="impl has-srclink"><ahref="#impl-RefUnwindSafe"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/panic/unwind_safe/trait.RefUnwindSafe.html"title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section><sectionid="impl-Send"class="impl has-srclink"><ahref="#impl-Send"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section><sectionid="impl-Sync"class="impl has-srclink"><ahref="#impl-Sync"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section><sectionid="impl-Unpin"class="impl has-srclink"><ahref="#impl-Unpin"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section><sectionid="impl-UnwindSafe"class="impl has-srclink"><ahref="#impl-UnwindSafe"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/panic/unwind_safe/trait.UnwindSafe.html"title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a></h3></section></div><h2id="blanket-implementations"class="small-section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor"></a></h2><divid="blanket-implementations-list"><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Any"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/any.rs.html#132-136">source</a></span><ahref="#impl-Any"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/any.rs.html#133">source</a></span><ahref="#method.type_id"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/any/trait.Any.html#tymethod.type_id"class="fnname">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.60.0/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></h4></section></summary><divclass='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/1.60.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Borrow%3CT%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/borrow.rs.html#209-214">source</a></span><ahref="#impl-Borrow%3CT%3E"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.borrow"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="const unstable">const: <ahref="https://github.com/rust-lang/rust/issues/91522"title="Tracking issue for const_borrow">unstable</a></span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/borrow.rs.html#211">source</a></span><ahref="#method.borrow"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fnname">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.reference.html">&</a>T</h4></section></summary><divclass='docblock'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.60.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-BorrowMut%3CT%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/borrow.rs.html#218-222">source</a></span><ahref="#impl-BorrowMut%3CT%3E"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="const unstable">const: <ahref="https://github.com/rust-lang/rust/issues/91522"title="Tracking issue for const_borrow">unstable</a></span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/borrow.rs.html#219">source</a></span><ahref="#method.borrow_mut"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fnname">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.reference.html">&mut </a>T</h4></section></summary><divclass='docblock'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.60.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Downcast"class="impl has-srclink"><ahref="#impl-Downcast"class="anchor"></a><h3class="code-header in-band">impl<T> Downcast for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/any/trait.Any.html"title="trait core::any::Any">Any</a>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.into_any"class="method trait-impl has-srclink"><ahref="#method.into_any"class="anchor"></a><h4class="code-header">pub fn <aclass="fnname">into_any</a>(self: <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><T, <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>>) -><aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><dyn <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static, <aclass="struct"href="https://doc.rust-lang.org/1.60.0/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>></h4></section></summary><divclass='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>. <ahref="#tymethod.into_any">Read more</a></p>
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>
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></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-From%3CT%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#553-558">source</a></span><ahref="#impl-From%3CT%3E"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.from-2"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="const unstable">const: <ahref="https://github.com/rust-lang/rust/issues/88674"title="Tracking issue for const_convert">unstable</a></span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#555">source</a></span><ahref="#method.from-2"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html#tymethod.from"class="fnname">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Instrument"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.26/src/tracing/instrument.rs.html#155">source</a></span><ahref="#impl-Instrument"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="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><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.instrument"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.26/src/tracing/instrument.rs.html#38">source</a></span><ahref="#method.instrument"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html#method.instrument"class="fnname">instrument</a>(self, span: <aclass="struct"href="https://docs.rs/tracing/0.1.26/tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="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><divclass='docblock'><p>Instruments this type with the provided <code>Span</code>, returning an
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.in_current_span"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.26/src/tracing/instrument.rs.html#74">source</a></span><ahref="#method.in_current_span"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.26/tracing/instrument/trait.Instrument.html#method.in_current_span"class="fnname">in_current_span</a>(self) -><aclass="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><divclass='docblock'><p>Instruments this type with the <ahref="../struct.Span.html#method.current">current</a><code>Span</code>, returning an
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Into%3CU%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#537-548">source</a></span><ahref="#impl-Into%3CU%3E"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.into"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="const unstable">const: <ahref="https://github.com/rust-lang/rust/issues/88674"title="Tracking issue for const_convert">unstable</a></span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#545">source</a></span><ahref="#method.into"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.Into.html#tymethod.into"class="fnname">into</a>(self) -> U</h4></section></summary><divclass="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.From.html"title="From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-Same%3CT%3E"class="impl has-srclink"><ahref="#impl-Same%3CT%3E"class="anchor"></a><h3class="code-header in-band">impl<T> Same<T> for T</h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Output"class="type trait-impl has-srclink"><ahref="#associatedtype.Output"class="anchor"></a><h4class="code-header">type <ahref="#associatedtype.Output"class="associatedtype">Output</a> = T</h4></section></summary><divclass='docblock'><p>Should always be <code>Self</code></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-ToOwned"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/alloc/borrow.rs.html#84-96">source</a></span><ahref="#impl-ToOwned"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Owned"class="type trait-impl has-srclink"><ahref="#associatedtype.Owned"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.60.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="associatedtype">Owned</a> = T</h4></section></summary><divclass='docblock'><p>The resulting type after obtaining ownership.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.to_owned"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/alloc/borrow.rs.html#89">source</a></span><ahref="#method.to_owned"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fnname">to_owned</a>(&self) -> T</h4></section></summary><divclass='docblock'><p>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/1.60.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.clone_into"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/alloc/borrow.rs.html#93">source</a></span><ahref="#method.clone_into"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fnname">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/1.60.0/std/primitive.reference.html">&mut </a>T)</h4></section></summary><divclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</div></div><divclass='docblock'><p>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/1.60.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-TryFrom%3CU%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#594-603">source</a></span><ahref="#impl-TryFrom%3CU%3E"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Error"class="type trait-impl has-srclink"><ahref="#associatedtype.Error"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.60.0/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="const unstable">const: <ahref="https://github.com/rust-lang/rust/issues/88674"title="Tracking issue for const_convert">unstable</a></span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#600">source</a></span><ahref="#method.try_from"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.60.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'><p>Performs the conversion.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-TryInto%3CU%3E"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#579-588">source</a></span><ahref="#impl-TryInto%3CU%3E"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.60.0/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/1.60.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Error-1"class="type trait-impl has-srclink"><ahref="#associatedtype.Error-1"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="const unstable">const: <ahref="https://github.com/rust-lang/rust/issues/88674"title="Tracking issue for const_convert">unstable</a></span> · <aclass="srclink"href="https://doc.rust-lang.org/1.60.0/src/core/convert/mod.rs.html#585">source</a></span><ahref="#method.try_into"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fnname">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.60.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.60.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'><p>Performs the conversion.</p>