<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `ButtonBuilder` struct in crate `widgetry`."><metaname="keywords"content="rust, rustlang, rust-lang, ButtonBuilder"><title>ButtonBuilder in widgetry - Rust</title><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><linkrel="stylesheet"type="text/css"href="../dark.css"disabled><linkrel="stylesheet"type="text/css"href="../ayu.css"disabled><scriptid="default-settings"></script><scriptsrc="../storage.js"></script><scriptsrc="../crates.js"></script><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="icon"type="image/svg+xml"href="../favicon.svg">
<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 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu"role="button">☰</div><ahref='../widgetry/index.html'><divclass='logo-container rust-logo'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass="location">Struct ButtonBuilder</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#fields">Fields</a><divclass="sidebar-links"><ahref="#structfield.corner_rounding">corner_rounding</a><ahref="#structfield.default_style">default_style</a><ahref="#structfield.disable_style">disable_style</a><ahref="#structfield.disabled_tooltip">disabled_tooltip</a><ahref="#structfield.hotkey">hotkey</a><ahref="#structfield.hover_style">hover_style</a><ahref="#structfield.is_disabled">is_disabled</a><ahref="#structfield.is_label_before_image">is_label_before_image</a><ahref="#structfield.padding">padding</a><ahref="#structfield.stack_axis">stack_axis</a><ahref="#structfield.stack_spacing">stack_spacing</a><ahref="#structfield.tooltip">tooltip</a></div><aclass="sidebar-title"href="#implementations">Methods</a><divclass="sidebar-links"><ahref="#method.batch">batch</a><ahref="#method.bg_color">bg_color</a><ahref="#method.build">build</a><ahref="#method.build_def">build_def</a><ahref="#method.build_widget">build_widget</a><ahref="#method.corner_rounding">corner_rounding</a><ahref="#method.custom_batch">custom_batch</a><ahref="#method.disabled">disabled</a><ahref="#method.disabled_tooltip">disabled_tooltip</a><ahref="#method.font">font</a><ahref="#method.font_size">font_size</a><ahref="#method.horizontal">horizontal</a><ahref="#method.hotkey">hotkey</a><ahref="#method.image_batch">image_batch</a><ahref="#method.image_bg_color">image_bg_color</a><ahref="#method.image_bytes">image_bytes</a><ahref="#method.image_color">image_color</a><ahref="#method.image_content_mode">image_content_mode</a><ahref="#method.image_corner_rounding">image_corner_rounding</a><ahref="#method.image_dims">image_dims</a><ahref="#method.image_first">image_first</a><ahref="#method.image_padding">image_padding</a><ahref="#method.image_path">image_path</a><ahref="#method.label_color">label_color</a><ahref="#method.label_first">label_first</a><ahref="#method.label_styled_text">label_styled_text</a><ahref="#method.label_text">label_text</a><ahref="#method.label_underlined_text">label_underlined_text</a><ahref="#method.new">new</a><ahref="#method.no_tooltip">no_tooltip</a><ahref="#method.outline">outline</a><ahref="#method.padding">padding</a><ahref="#method.padding_bottom">padding_bottom</a><ahref="#method.padding_left">padding_left</a><ahref="#method.padding_right">padding_right</a><ahref="#method.padding_top">padding_top</a><ahref="#method.stack_spacing">stack_spacing</a><ahref="#method.style">style</a><ahref="#method.style_mut">style_mut</a><ahref="#method.tooltip">tooltip</a><ahref="#method.vertical">vertical</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"
</div><h4id="method.padding_top"class="method"><code>pub fn <ahref="#method.padding_top"class="fnname">padding_top</a>(self, padding: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><ahref="#method.padding_top"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#199-202"title="goto source code">[src]</a></h4><divclass="docblock"><p>Extra spacing around a button’s items (label and/or image).</p>
</div><h4id="method.padding_left"class="method"><code>pub fn <ahref="#method.padding_left"class="fnname">padding_left</a>(self, padding: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><ahref="#method.padding_left"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#205-208"title="goto source code">[src]</a></h4><divclass="docblock"><p>Extra spacing around a button’s items (label and/or image).</p>
</div><h4id="method.padding_bottom"class="method"><code>pub fn <ahref="#method.padding_bottom"class="fnname">padding_bottom</a>(self, padding: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><ahref="#method.padding_bottom"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#211-214"title="goto source code">[src]</a></h4><divclass="docblock"><p>Extra spacing around a button’s items (label and/or image).</p>
</div><h4id="method.padding_right"class="method"><code>pub fn <ahref="#method.padding_right"class="fnname">padding_right</a>(self, padding: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><ahref="#method.padding_right"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#217-220"title="goto source code">[src]</a></h4><divclass="docblock"><p>Extra spacing around a button’s items (label and/or image).</p>
</div><h4id="method.label_text"class="method"><code>pub fn <ahref="#method.label_text"class="fnname">label_text</a><I: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>>(self, text: I) -> Self</code><ahref="#method.label_text"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#225-230"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the text of the button’s label.</p>
</div><h4id="method.label_underlined_text"class="method"><code>pub fn <ahref="#method.label_underlined_text"class="fnname">label_underlined_text</a>(self, text: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><ahref="#method.label_underlined_text"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#235-241"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the text of the button’s label. The text will be decorated with an underline.</p>
</div><h4id="method.label_styled_text"class="method"><code>pub fn <ahref="#method.label_styled_text"class="fnname">label_styled_text</a>(<br> self, <br> styled_text: <aclass="struct"href="text/struct.Text.html"title="struct widgetry::text::Text">Text</a>, <br> for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a><br>) -> Self</code><ahref="#method.label_styled_text"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#245-255"title="goto source code">[src]</a></h4><divclass="docblock"><p>Assign a pre-styled <code>Text</code> instance if your button need something more than uniformly
</div><h4id="method.label_color"class="method"><code>pub fn <ahref="#method.label_color"class="fnname">label_color</a>(self, color: <aclass="struct"href="color/struct.Color.html"title="struct widgetry::color::Color">Color</a>, for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><ahref="#method.label_color"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#260-266"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the color of the button’s label.</p>
</div><h4id="method.font"class="method"><code>pub fn <ahref="#method.font"class="fnname">font</a>(self, font: <aclass="enum"href="text/enum.Font.html"title="enum widgetry::text::Font">Font</a>) -> Self</code><ahref="#method.font"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#271-276"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the font used by the button’s label.</p>
</div><h4id="method.font_size"class="method"><code>pub fn <ahref="#method.font_size"class="fnname">font_size</a>(self, font_size: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</code><ahref="#method.font_size"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#281-286"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the size of the font of the button’s label.</p>
</div><h4id="method.image_path"class="method"><code>pub fn <ahref="#method.image_path"class="fnname">image_path</a>(self, path: &'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><ahref="#method.image_path"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#291-298"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the image for the button. If not set, the button will have no image.</p>
</div><h4id="method.image_bytes"class="method"><code>pub fn <ahref="#method.image_bytes"class="fnname">image_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><ahref="#method.image_bytes"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#308-315"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the image for the button. If not set, the button will have no image.</p>
</div><h4id="method.image_batch"class="method"><code>pub fn <ahref="#method.image_batch"class="fnname">image_batch</a>(self, batch: <aclass="struct"href="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><ahref="#method.image_batch"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#323-328"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set the image for the button. If not set, the button will have no image.</p>
</div><h4id="method.image_color"class="method"><code>pub fn <ahref="#method.image_color"class="fnname">image_color</a><C: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="geom/enum.RewriteColor.html"title="enum widgetry::geom::RewriteColor">RewriteColor</a>>>(<br> self, <br> color: C, <br> for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a><br>) -> Self</code><ahref="#method.image_color"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#336-342"title="goto source code">[src]</a></h4><divclass="docblock"><p>Rewrite the color of the button’s image.</p>
</div><h4id="method.image_bg_color"class="method"><code>pub fn <ahref="#method.image_bg_color"class="fnname">image_bg_color</a>(self, color: <aclass="struct"href="color/struct.Color.html"title="struct widgetry::color::Color">Color</a>, for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><ahref="#method.image_bg_color"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#350-356"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a background color for the image, other than the buttons background.</p>
</div><h4id="method.image_dims"class="method"><code>pub fn <ahref="#method.image_dims"class="fnname">image_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="screen_geom/struct.ScreenDims.html"title="struct widgetry::screen_geom::ScreenDims">ScreenDims</a>>>(self, dims: D) -> Self</code><ahref="#method.image_dims"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#363-368"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
<p>See <ahref="widgets/button/struct.ButtonBuilder.html#method.image_content_mode"title="ButtonBuilder::image_content_mode"><code>ButtonBuilder::image_content_mode</code></a> to control how the image scales to fit
</div><h4id="method.image_content_mode"class="method"><code>pub fn <ahref="#method.image_content_mode"class="fnname">image_content_mode</a>(self, content_mode: <aclass="enum"href="enum.ContentMode.html"title="enum widgetry::ContentMode">ContentMode</a>) -> Self</code><ahref="#method.image_content_mode"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#377-382"title="goto source code">[src]</a></h4><divclass="docblock"><p>If a custom <code>image_dims</code> was set, control how the image should be scaled to its new bounds</p>
<p>The default, <ahref="enum.ContentMode.html#variant.ScaleAspectFit"title="ContentMode::ScaleAspectFit"><code>ContentMode::ScaleAspectFit</code></a> will only grow as much as it can while
</div><h4id="method.image_corner_rounding"class="method"><code>pub fn <ahref="#method.image_corner_rounding"class="fnname">image_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="widgets/enum.CornerRounding.html"title="enum widgetry::widgets::CornerRounding">CornerRounding</a>>>(self, value: R) -> Self</code><ahref="#method.image_corner_rounding"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#385-390"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set independent rounding for each of the button’s image’s corners</p>
</div><h4id="method.image_padding"class="method"><code>pub fn <ahref="#method.image_padding"class="fnname">image_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="widgets/struct.EdgeInsets.html"title="struct widgetry::widgets::EdgeInsets">EdgeInsets</a>>>(self, value: EI) -> Self</code><ahref="#method.image_padding"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#393-398"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set padding for the image</p>
</div><h4id="method.bg_color"class="method"><code>pub fn <ahref="#method.bg_color"class="fnname">bg_color</a>(self, color: <aclass="struct"href="color/struct.Color.html"title="struct widgetry::color::Color">Color</a>, for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><ahref="#method.bg_color"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#404-407"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a background color for the button based on the button’s <ahref="enum.ControlState.html"title="ControlState"><code>ControlState</code></a>.</p>
</div><h4id="method.outline"class="method"><code>pub fn <ahref="#method.outline"class="fnname">outline</a>(self, outline: <aclass="type"href="style/type.OutlineStyle.html"title="type widgetry::style::OutlineStyle">OutlineStyle</a>, for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><ahref="#method.outline"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#413-416"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set an outline for the button based on the button’s <ahref="enum.ControlState.html"title="ControlState"><code>ControlState</code></a>.</p>
</div><h4id="method.custom_batch"class="method"><code>pub fn <ahref="#method.custom_batch"class="fnname">custom_batch</a>(self, batch: <aclass="struct"href="geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>, for_state: <aclass="enum"href="enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><ahref="#method.custom_batch"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#422-425"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a pre-rendered <ahref="geom/struct.GeomBatch.html"title="GeomBatch">GeomBatch</a> to use for the button instead of individual fields.</p>
</div><h4id="method.hotkey"class="method"><code>pub fn <ahref="#method.hotkey"class="fnname">hotkey</a><MK: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="enum"href="event/enum.MultiKey.html"title="enum widgetry::event::MultiKey">MultiKey</a>>>>(self, key: MK) -> Self</code><ahref="#method.hotkey"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#428-431"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a hotkey for the button</p>
</div><h4id="method.tooltip"class="method"><code>pub fn <ahref="#method.tooltip"class="fnname">tooltip</a>(self, tooltip: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="text/struct.Text.html"title="struct widgetry::text::Text">Text</a>>) -> Self</code><ahref="#method.tooltip"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#436-439"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a non-default tooltip <ahref="text/struct.Text.html"title="Text"><code>Text</code></a> to appear when hovering over the button.</p>
</div><h4id="method.no_tooltip"class="method"><code>pub fn <ahref="#method.no_tooltip"class="fnname">no_tooltip</a>(self) -> Self</code><ahref="#method.no_tooltip"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#443-447"title="goto source code">[src]</a></h4><divclass="docblock"><p>If a <code>tooltip</code> is not specified, a default tooltip will be applied. Use <code>no_tooltip</code> when
</div><h4id="method.disabled_tooltip"class="method"><code>pub fn <ahref="#method.disabled_tooltip"class="fnname">disabled_tooltip</a>(self, tooltip: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="text/struct.Text.html"title="struct widgetry::text::Text">Text</a>>) -> Self</code><ahref="#method.disabled_tooltip"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#453-456"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a tooltip <ahref="text/struct.Text.html"title="Text"><code>Text</code></a> to appear when hovering over the button, when the button is
</div><h4id="method.vertical"class="method"><code>pub fn <ahref="#method.vertical"class="fnname">vertical</a>(self) -> Self</code><ahref="#method.vertical"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#461-464"title="goto source code">[src]</a></h4><divclass="docblock"><p>The button’s items will be rendered in a vertical column</p>
</div><h4id="method.horizontal"class="method"><code>pub fn <ahref="#method.horizontal"class="fnname">horizontal</a>(self) -> Self</code><ahref="#method.horizontal"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#469-472"title="goto source code">[src]</a></h4><divclass="docblock"><p>The button’s items will be rendered in a horizontal row</p>
</div><h4id="method.disabled"class="method"><code>pub fn <ahref="#method.disabled"class="fnname">disabled</a>(self, is_disabled: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</code><ahref="#method.disabled"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#475-478"title="goto source code">[src]</a></h4><divclass="docblock"><p>The button cannot be clicked and will be styled as <ahref="enum.ControlState.html#variant.Disabled"title="ControlState::Disabled"><code>ControlState::Disabled</code></a></p>
</div><h4id="method.label_first"class="method"><code>pub fn <ahref="#method.label_first"class="fnname">label_first</a>(self) -> Self</code><ahref="#method.label_first"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#483-486"title="goto source code">[src]</a></h4><divclass="docblock"><p>Display the button’s label before the button’s image.</p>
</div><h4id="method.image_first"class="method"><code>pub fn <ahref="#method.image_first"class="fnname">image_first</a>(self) -> Self</code><ahref="#method.image_first"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#491-494"title="goto source code">[src]</a></h4><divclass="docblock"><p>Display the button’s image before the button’s label.</p>
</div><h4id="method.stack_spacing"class="method"><code>pub fn <ahref="#method.stack_spacing"class="fnname">stack_spacing</a>(self, value: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><ahref="#method.stack_spacing"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#498-501"title="goto source code">[src]</a></h4><divclass="docblock"><p>Spacing between the image and text of a button.
</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="widgets/enum.CornerRounding.html"title="enum widgetry::widgets::CornerRounding">CornerRounding</a>>>(self, value: R) -> Self</code><ahref="#method.corner_rounding"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#504-507"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set independent rounding for each of the button’s corners</p>
<spanclass="kw">let</span><spanclass="ident">red_button_1</span><spanclass="op">=</span><spanclass="ident">red_builder</span>.<spanclass="ident">clone</span>().<spanclass="ident">label_text</span>(<spanclass="string">"First red button"</span>).<spanclass="ident">build</span>(<spanclass="ident">ctx</span>, <spanclass="string">"first"</span>);
<spanclass="kw">let</span><spanclass="ident">red_button_2</span><spanclass="op">=</span><spanclass="ident">red_builder</span>.<spanclass="ident">clone</span>().<spanclass="ident">label_text</span>(<spanclass="string">"Second red button"</span>).<spanclass="ident">build</span>(<spanclass="ident">ctx</span>, <spanclass="string">"second"</span>);
<spanclass="kw">let</span><spanclass="ident">red_button_3</span><spanclass="op">=</span><spanclass="ident">red_builder</span>.<spanclass="ident">label_text</span>(<spanclass="string">"Last red button"</span>).<spanclass="ident">build</span>(<spanclass="ident">ctx</span>, <spanclass="string">"third"</span>);
</div><h4id="method.build_def"class="method"><code>pub fn <ahref="#method.build_def"class="fnname">build_def</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></code><ahref="#method.build_def"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#564-573"title="goto source code">[src]</a></h4><divclass="docblock"><p>Shorthand method to build a default widget whose <code>action</code> is derived from the label’s text.</p>
</div><h4id="method.clone_from"class="method hidden trait-impl"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from"class="fnname">clone_from</a>(&mut self, source: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><ahref="#method.clone_from"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#impl-Debug"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#143"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.fmt"class="method hidden trait-impl"><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><ahref="#method.fmt"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#143"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></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#impl-Default"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#143"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.default"class="method hidden trait-impl"><code>fn <ahref="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default"class="fnname">default</a>() -><aclass="struct"href="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#method.default"class="anchor"></a><aclass="srclink"href="../src/widgetry/widgets/button.rs.html#143"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></details></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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#impl-RefUnwindSafe"class="anchor"></a></h3><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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#impl-Send"class="anchor"></a></h3><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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#impl-Sync"class="anchor"></a></h3><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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c><spanclass="where fmt-newline">where<br> 'a: 'c, </span></code><ahref="#impl-Unpin"class="anchor"></a></h3><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="widgets/button/struct.ButtonBuilder.html"title="struct widgetry::widgets::button::ButtonBuilder">ButtonBuilder</a><'a, 'c></code><ahref="#impl-UnwindSafe"class="anchor"></a></h3></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><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#131-135"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.type_id"class="method hidden trait-impl"><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><ahref="#method.type_id"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#208-213"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.borrow"class="method hidden trait-impl"><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><ahref="#method.borrow"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210"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></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#216-220"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.borrow_mut"class="method hidden trait-impl"><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><ahref="#method.borrow_mut"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217"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></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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></summary><divclass="impl-items"><h4id="method.into_any"class="method hidden trait-impl"><code>pub fn <ahref="#tymethod.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><ahref="#method.into_any"class="anchor"></a></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>
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></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#544-548"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.from"class="method hidden trait-impl"><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><ahref="#method.from"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#533-540"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="method.into"class="method hidden trait-impl"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into"class="fnname">into</a>(self) -> U</code><ahref="#method.into"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#537"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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></summary><divclass="impl-items"><h4id="associatedtype.Output"class="type trait-impl"><code>type <ahref="#associatedtype.Output"class="type">Output</a> = T</code><ahref="#associatedtype.Output"class="anchor"></a></h4><divclass='docblock'><p>Should always be <code>Self</code></p>
</div></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#81-93"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="associatedtype.Owned"class="type trait-impl"><code>type <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="type">Owned</a> = T</code><ahref="#associatedtype.Owned"class="anchor"></a></h4><divclass='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4id="method.to_owned"class="method hidden trait-impl"><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><ahref="#method.to_owned"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#86"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 trait-impl"><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><ahref="#method.clone_into"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90"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></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#581-590"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="associatedtype.Error"class="type trait-impl"><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><ahref="#associatedtype.Error"class="anchor"></a></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_from"class="method hidden trait-impl"><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><ahref="#method.try_from"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#587"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><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#567-576"title="goto source code">[src]</a></h3></summary><divclass="impl-items"><h4id="associatedtype.Error-1"class="type trait-impl"><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><ahref="#associatedtype.Error-1"class="anchor"></a></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_into"class="method hidden trait-impl"><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><ahref="#method.try_into"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#573"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>