libcosmic/cosmic/widget/trait.Operation.html
2026-04-18 20:11:25 +00:00

72 lines
No EOL
17 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A piece of logic that can traverse the widget tree of an application in order to query or update some widget state."><title>Operation in cosmic::widget - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Operation</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.traverse" title="traverse">traverse</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.container" title="container">container</a></li><li><a href="#method.custom" title="custom">custom</a></li><li><a href="#method.finish" title="finish">finish</a></li><li><a href="#method.focusable" title="focusable">focusable</a></li><li><a href="#method.scrollable" title="scrollable">scrollable</a></li><li><a href="#method.text" title="text">text</a></li><li><a href="#method.text_input" title="text_input">text_input</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>widget</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">cosmic</a>::<wbr><a href="index.html">widget</a></div><h1>Trait <span class="trait">Operation</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait Operation&lt;T = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> {
// Required method
fn <a href="#tymethod.traverse" class="fn">traverse</a>(&amp;mut self, operate: &amp;mut dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;mut dyn <a class="trait" href="trait.Operation.html" title="trait cosmic::widget::Operation">Operation</a>&lt;T&gt;));
// Provided methods
fn <a href="#method.container" class="fn">container</a>(&amp;mut self, _id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;, _bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>) { ... }
<span class="item-spacer"></span> fn <a href="#method.scrollable" class="fn">scrollable</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_content_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_translation: <a class="struct" href="../iced/struct.Vector.html" title="struct cosmic::iced::Vector">Vector</a>,
_state: &amp;mut dyn <a class="trait" href="../iced/daemon/program/graphics/core/widget/operation/trait.Scrollable.html" title="trait cosmic::iced::daemon::program::graphics::core::widget::operation::Scrollable">Scrollable</a>,
) { ... }
<span class="item-spacer"></span> fn <a href="#method.focusable" class="fn">focusable</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_state: &amp;mut dyn <a class="trait" href="../iced/daemon/program/graphics/core/widget/operation/trait.Focusable.html" title="trait cosmic::iced::daemon::program::graphics::core::widget::operation::Focusable">Focusable</a>,
) { ... }
<span class="item-spacer"></span> fn <a href="#method.text_input" class="fn">text_input</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_state: &amp;mut dyn <a class="trait" href="../iced/daemon/program/graphics/core/widget/operation/trait.TextInput.html" title="trait cosmic::iced::daemon::program::graphics::core::widget::operation::TextInput">TextInput</a>,
) { ... }
<span class="item-spacer"></span> fn <a href="#method.text" class="fn">text</a>(&amp;mut self, _id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;, _bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>, _text: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) { ... }
<span class="item-spacer"></span> fn <a href="#method.custom" class="fn">custom</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_state: &amp;mut (dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static),
) { ... }
<span class="item-spacer"></span> fn <a href="#method.finish" class="fn">finish</a>(&amp;self) -&gt; <a class="enum" href="../iced/daemon/program/graphics/core/widget/operation/enum.Outcome.html" title="enum cosmic::iced::daemon::program::graphics::core::widget::operation::Outcome">Outcome</a>&lt;T&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A piece of logic that can traverse the widget tree of an application in
order to query or update some widget state.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.traverse" class="method"><h4 class="code-header">fn <a href="#tymethod.traverse" class="fn">traverse</a>(&amp;mut self, operate: &amp;mut dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;mut dyn <a class="trait" href="trait.Operation.html" title="trait cosmic::widget::Operation">Operation</a>&lt;T&gt;))</h4></section></summary><div class="docblock"><p>Requests further traversal of the widget tree to keep operating.</p>
<p>The provided <code>operate</code> closure may be called by an <a href="trait.Operation.html" title="trait cosmic::widget::Operation"><code>Operation</code></a>
to return control to the widget tree and keep traversing it. If
the closure is not called, the children of the widget asking for
traversal will be skipped.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.container" class="method"><h4 class="code-header">fn <a href="#method.container" class="fn">container</a>(&amp;mut self, _id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;, _bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>)</h4></section></summary><div class="docblock"><p>Operates on a widget that contains other widgets.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.scrollable" class="method"><h4 class="code-header">fn <a href="#method.scrollable" class="fn">scrollable</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_content_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_translation: <a class="struct" href="../iced/struct.Vector.html" title="struct cosmic::iced::Vector">Vector</a>,
_state: &amp;mut dyn <a class="trait" href="../iced/daemon/program/graphics/core/widget/operation/trait.Scrollable.html" title="trait cosmic::iced::daemon::program::graphics::core::widget::operation::Scrollable">Scrollable</a>,
)</h4></section></summary><div class="docblock"><p>Operates on a widget that can be scrolled.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.focusable" class="method"><h4 class="code-header">fn <a href="#method.focusable" class="fn">focusable</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_state: &amp;mut dyn <a class="trait" href="../iced/daemon/program/graphics/core/widget/operation/trait.Focusable.html" title="trait cosmic::iced::daemon::program::graphics::core::widget::operation::Focusable">Focusable</a>,
)</h4></section></summary><div class="docblock"><p>Operates on a widget that can be focused.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.text_input" class="method"><h4 class="code-header">fn <a href="#method.text_input" class="fn">text_input</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_state: &amp;mut dyn <a class="trait" href="../iced/daemon/program/graphics/core/widget/operation/trait.TextInput.html" title="trait cosmic::iced::daemon::program::graphics::core::widget::operation::TextInput">TextInput</a>,
)</h4></section></summary><div class="docblock"><p>Operates on a widget that has text input.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.text" class="method"><h4 class="code-header">fn <a href="#method.text" class="fn">text</a>(&amp;mut self, _id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;, _bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>, _text: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)</h4></section></summary><div class="docblock"><p>Operates on a widget that contains some text.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.custom" class="method"><h4 class="code-header">fn <a href="#method.custom" class="fn">custom</a>(
&amp;mut self,
_id: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Id.html" title="struct cosmic::widget::Id">Id</a>&gt;,
_bounds: <a class="struct" href="../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_state: &amp;mut (dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static),
)</h4></section></summary><div class="docblock"><p>Operates on a custom widget with some state.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.finish" class="method"><h4 class="code-header">fn <a href="#method.finish" class="fn">finish</a>(&amp;self) -&gt; <a class="enum" href="../iced/daemon/program/graphics/core/widget/operation/enum.Outcome.html" title="enum cosmic::iced::daemon::program::graphics::core::widget::operation::Outcome">Outcome</a>&lt;T&gt;</h4></section></summary><div class="docblock"><p>Finishes the <a href="trait.Operation.html" title="trait cosmic::widget::Operation"><code>Operation</code></a> and returns its <a href="../iced/daemon/program/graphics/core/widget/operation/enum.Outcome.html" title="enum cosmic::iced::daemon::program::graphics::core::widget::operation::Outcome"><code>Outcome</code></a>.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Operation%3CO%3E-for-Box%3CT%3E" class="impl"><a href="#impl-Operation%3CO%3E-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, O&gt; <a class="trait" href="trait.Operation.html" title="trait cosmic::widget::Operation">Operation</a>&lt;O&gt; for <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/boxed/struct.Box.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::boxed::Box">Box</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="trait.Operation.html" title="trait cosmic::widget::Operation">Operation</a>&lt;O&gt; + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><script src="../../trait.impl/iced_core/widget/operation/trait.Operation.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>