<linkrel="alternate icon"type="image/png"href="../../../favicon-32x32.png"><styletype="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu"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.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.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">From<T></a><ahref="#impl-Into%3CU%3E">Into<U></a><ahref="#impl-Same%3CT%3E">S
</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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#186-189"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#192-195"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#198-201"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#204-207"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#212-217"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#222-228"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="../../../widgetry/text/struct.Text.html"title="struct widgetry::text::Text">Text</a>, <br> for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a><br>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#232-242"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="../../../widgetry/color/struct.Color.html"title="struct widgetry::color::Color">Color</a>, for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#247-253"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="../../../widgetry/text/enum.Font.html"title="enum widgetry::text::Font">Font</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#258-263"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#268-273"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#278-285"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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#295-302"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="../../../widgetry/geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>, bounds: <aclass="struct"href="../../../geom/bounds/struct.Bounds.html"title="struct geom::bounds::Bounds">Bounds</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#310-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_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="../../../widgetry/geom/enum.RewriteColor.html"title="enum widgetry::geom::RewriteColor">RewriteColor</a>>>(<br> self, <br> color: C, <br> for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a><br>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#323-329"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="../../../widgetry/color/struct.Color.html"title="struct widgetry::color::Color">Color</a>, for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#337-343"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="../../../widgetry/screen_geom/struct.ScreenDims.html"title="struct widgetry::screen_geom::ScreenDims">ScreenDims</a>>>(self, dims: D) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#350-355"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="../../../widgetry/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="../../../widgetry/enum.ContentMode.html"title="enum widgetry::ContentMode">ContentMode</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#364-369"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>If <code>image_dims</code> were not specified, the image will not be scaled, so content_mode has no
affect.</p>
<p>The default, <ahref="../../../widgetry/enum.ContentMode.html#variant.ScaleAspectFit"title="ContentMode::ScaleAspectFit"><code>ContentMode::ScaleAspectFit</code></a> will only grow as much as it can while
maintaining its aspect ratio and not exceeding its bounds.</p>
</div><h4id="method.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="../../../widgetry/widgets/enum.CornerRounding.html"title="enum widgetry::widgets::CornerRounding">CornerRounding</a>>>(self, value: R) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#372-377"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.bg_color"class="method"><code>pub fn <ahref="#method.bg_color"class="fnname">bg_color</a>(self, color: <aclass="struct"href="../../../widgetry/color/struct.Color.html"title="struct widgetry::color::Color">Color</a>, for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#391-394"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a background color for the button based on the button’s <ahref="../../../widgetry/enum.ControlState.html"title="ControlState"><code>ControlState</code></a>.</p>
<p>If the style hasn’t been set for the current ControlState, the style for
</div><h4id="method.outline"class="method"><code>pub fn <ahref="#method.outline"class="fnname">outline</a>(self, outline: <aclass="type"href="../../../widgetry/style/type.OutlineStyle.html"title="type widgetry::style::OutlineStyle">OutlineStyle</a>, for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#400-403"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set an outline for the button based on the button’s <ahref="../../../widgetry/enum.ControlState.html"title="ControlState"><code>ControlState</code></a>.</p>
<p>If the style hasn’t been set for the current ControlState, the style for
</div><h4id="method.custom_batch"class="method"><code>pub fn <ahref="#method.custom_batch"class="fnname">custom_batch</a>(self, batch: <aclass="struct"href="../../../widgetry/geom/struct.GeomBatch.html"title="struct widgetry::geom::GeomBatch">GeomBatch</a>, for_state: <aclass="enum"href="../../../widgetry/enum.ControlState.html"title="enum widgetry::ControlState">ControlState</a>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#409-412"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a pre-rendered <ahref="../../../widgetry/geom/struct.GeomBatch.html"title="GeomBatch">GeomBatch</a> to use for the button instead of individual fields.</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="../../../widgetry/text/struct.Text.html"title="struct widgetry::text::Text">Text</a>>) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#423-426"title="goto source code">[src]</a></h4><divclass="docblock"><p>Set a non-default tooltip <ahref="../../../widgetry/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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#430-434"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.vertical"class="method"><code>pub fn <ahref="#method.vertical"class="fnname">vertical</a>(self) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#439-442"title="goto source code">[src]</a></h4><divclass="docblock"><p>The button’s items will be rendered in a vertical column</p>
<p>If the button doesn’t have both an image and label, this has no effect.</p>
</div><h4id="method.horizontal"class="method"><code>pub fn <ahref="#method.horizontal"class="fnname">horizontal</a>(self) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#447-450"title="goto source code">[src]</a></h4><divclass="docblock"><p>The button’s items will be rendered in a horizontal row</p>
<p>If the button doesn’t have both an image and label, this has no effect.</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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#453-456"title="goto source code">[src]</a></h4><divclass="docblock"><p>The button cannot be clicked and will be styled as <ahref="../../../widgetry/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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#461-464"title="goto source code">[src]</a></h4><divclass="docblock"><p>Display the button’s label before the button’s image.</p>
<p>If the button doesn’t have both an image and label, this has no effect.</p>
</div><h4id="method.image_first"class="method"><code>pub fn <ahref="#method.image_first"class="fnname">image_first</a>(self) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#469-472"title="goto source code">[src]</a></h4><divclass="docblock"><p>Display the button’s image before the button’s label.</p>
<p>If the button doesn’t have both an image and label, this has no effect.</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><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#476-479"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="../../../widgetry/widgets/enum.CornerRounding.html"title="enum widgetry::widgets::CornerRounding">CornerRounding</a>>>(self, value: R) -> Self</code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#482-485"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="../../../widgetry/event_ctx/struct.EventCtx.html"title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -><aclass="struct"href="../../../widgetry/widgets/struct.Widget.html"title="struct widgetry::widgets::Widget">Widget</a></code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#541-550"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></div><h3id="impl-Debug"class="impl"><codeclass="in-band">impl<'a, 'c><aclass="trait"href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="../../../widgetry/widgets/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#131"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.fmt"class="method hidden"><code>fn <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt"class="fnname">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></code><aclass="srclink"href="../../../src/widgetry/widgets/button.rs.html#131"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3id="impl-Downcast"class="impl"><codeclass="in-band">impl<T> Downcast for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a>, </span></code><ahref="#impl-Downcast"class="anchor"></a></h3><divclass="impl-items"><h4id="method.into_any"class="method hidden"><code>pub fn <ahref="#method.into_any"class="fnname">into_any</a>(self: <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><T, <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static, <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>></code></h4><divclass='docblock hidden'><p>Convert <code>Box<dyn Trait></code> (where <code>Trait: Downcast</code>) to <code>Box<dyn Any></code>. <code>Box<dyn Any></code> can
then be further <code>downcast</code> into <code>Box<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <ahref="#tymethod.into_any">Read more</a></p>
</div><h4id="method.into_any_rc"class="method hidden"><code>pub fn <ahref="#method.into_any_rc"class="fnname">into_any_rc</a>(self: <aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html"title="struct alloc::rc::Rc">Rc</a><T>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html"title="struct alloc::rc::Rc">Rc</a><dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static></code></h4><divclass='docblock hidden'><p>Convert <code>Rc<Trait></code> (where <code>Trait: Downcast</code>) to <code>Rc<Any></code>. <code>Rc<Any></code> can then be
further <code>downcast</code> into <code>Rc<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <ahref="#tymethod.into_any_rc">Read more</a></p>
</div><h4id="method.as_any"class="method hidden"><code>pub fn <ahref="#method.as_any"class="fnname">as_any</a>(&self) ->&(dyn <aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static)</code></h4><divclass='docblock hidden'><p>Convert <code>&Trait</code> (where <code>Trait: Downcast</code>) to <code>&Any</code>. This is needed since Rust cannot
further <code>downcast</code> into <code>Arc<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <ahref="#tymethod.into_any_arc">Read more</a></p>
</div></div><h3id="impl-Same%3CT%3E"class="impl"><codeclass="in-band">impl<T> Same<T> for T</code><ahref="#impl-Same%3CT%3E"class="anchor"></a></h3><divclass="impl-items"><h4id="associatedtype.Output"class="type"><code>type <ahref="#associatedtype.Output"class="type">Output</a> = T</code></h4><divclass='docblock'><p>Should always be <code>Self</code></p>
</div></div><h3id="impl-ToOwned"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></code><ahref="#impl-ToOwned"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-93"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Owned"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="type">Owned</a> = T</code></h4><divclass='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4id="method.to_owned"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fnname">to_owned</a>(&self) -> T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#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"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fnname">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#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><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><divclass="impl-items"><h4id="associatedtype.Error"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_from"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#587"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-TryInto%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref="#impl-TryInto%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#567-576"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Error-1"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_into"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into"class="fnname">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#573"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>