137 lines
60 KiB
HTML
137 lines
60 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="The data that egui persists between frames."><title>Memory in egui - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="egui" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.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 struct"><!--[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="../egui/index.html">egui</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Memory</a></h2><h3><a href="#fields">Fields</a></h3><ul class="block structfield"><li><a href="#structfield.caches" title="caches">caches</a></li><li><a href="#structfield.data" title="data">data</a></li><li><a href="#structfield.options" title="options">options</a></li><li><a href="#structfield.to_global" title="to_global">to_global</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.allows_interaction" title="allows_interaction">allows_interaction</a></li><li><a href="#method.any_popup_open" title="any_popup_open">any_popup_open</a></li><li><a href="#method.area_rect" title="area_rect">area_rect</a></li><li><a href="#method.areas" title="areas">areas</a></li><li><a href="#method.areas_mut" title="areas_mut">areas_mut</a></li><li><a href="#method.close_popup" title="close_popup">close_popup</a></li><li><a href="#method.dragged_id" title="dragged_id">dragged_id</a></li><li><a href="#method.dragging_something_else" title="dragging_something_else">dragging_something_else</a></li><li><a href="#method.everything_is_visible" title="everything_is_visible">everything_is_visible</a></li><li><a href="#method.focused" title="focused">focused</a></li><li><a href="#method.had_focus_last_frame" title="had_focus_last_frame">had_focus_last_frame</a></li><li><a href="#method.has_focus" title="has_focus">has_focus</a></li><li><a href="#method.interested_in_focus" title="interested_in_focus">interested_in_focus</a></li><li><a href="#method.is_above_modal_layer" title="is_above_modal_layer">is_above_modal_layer</a></li><li><a href="#method.is_anything_being_dragged" title="is_anything_being_dragged">is_anything_being_dragged</a></li><li><a href="#method.is_being_dragged" title="is_being_dragged">is_being_dragged</a></li><li><a href="#method.is_popup_open" title="is_popup_open">is_popup_open</a></li><li><a href="#method.layer_id_at" title="layer_id_at">layer_id_at</a></li><li><a href="#method.layer_ids" title="layer_ids">layer_ids</a></li><li><a href="#method.layer_transforms" title="layer_transforms">layer_transforms</a></li><li><a href="#method.open_popup" title="open_popup">open_popup</a></li><li><a href="#method.request_focus" title="request_focus">request_focus</a></li><li><a href="#method.reset_areas" title="reset_areas">reset_areas</a></li><li><a href="#method.set_dragged_id" title="set_dragged_id">set_dragged_id</a></li><li><a href="#method.set_everything_is_visible" title="set_everything_is_visible">set_everything_is_visible</a></li><li><a href="#method.set_focus_lock_filter" title="set_focus_lock_filter">set_focus_lock_filter</a></li><li><a href="#method.set_modal_layer" title="set_modal_layer">set_modal_layer</a></li><li><a href="#method.stop_dragging" title="stop_dragging">stop_dragging</a></li><li><a href="#method.stop_text_input" title="stop_text_input">stop_text_input</a></li><li><a href="#method.surrender_focus" title="surrender_focus">surrender_focus</a></li><li><a href="#method.toggle_popup" title="toggle_popup">toggle_popup</a></li><li><a href="#method.top_modal_layer" title="top_modal_layer">top_modal_layer</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-Memory" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-Memory" title="Debug">Debug</a></li><li><a href="#impl-Default-for-Memory" title="Default">Default</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-Memory" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-UnwindSafe-for-Memory" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-Memory" title="Freeze">Freeze</a></li><li><a href="#impl-Send-for-Memory" title="Send">Send</a></li><li><a href="#impl-Sync-for-Memory" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Memory" title="Unpin">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-SerializableAny-for-T" title="SerializableAny">SerializableAny</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate egui</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">egui</a></span><h1>Struct <span class="struct">Memory</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/egui/memory/mod.rs.html#30-115">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Memory {
|
|
pub options: <a class="struct" href="struct.Options.html" title="struct egui::Options">Options</a>,
|
|
pub data: <a class="struct" href="util/id_type_map/struct.IdTypeMap.html" title="struct egui::util::id_type_map::IdTypeMap">IdTypeMap</a>,
|
|
pub caches: <a class="struct" href="cache/struct.CacheStorage.html" title="struct egui::cache::CacheStorage">CacheStorage</a>,
|
|
pub to_global: <a class="type" href="../ahash/type.HashMap.html" title="type ahash::HashMap">HashMap</a><<a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>, <a class="struct" href="../emath/ts_transform/struct.TSTransform.html" title="struct emath::ts_transform::TSTransform">TSTransform</a>>,
|
|
<span class="comment">/* private fields */</span>
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The data that egui persists between frames.</p>
|
|
<p>This includes window positions and sizes,
|
|
how far the user has scrolled in a <a href="containers/scroll_area/struct.ScrollArea.html" title="struct egui::containers::scroll_area::ScrollArea"><code>ScrollArea</code></a> etc.</p>
|
|
<p>If you want this to persist when closing your app, you should serialize <a href="struct.Memory.html" title="struct egui::Memory"><code>Memory</code></a> and store it.
|
|
For this you need to enable the <code>persistence</code>.</p>
|
|
<p>If you want to store data for your widgets, you should look at <a href="struct.Memory.html#structfield.data" title="field egui::Memory::data"><code>Memory::data</code></a></p>
|
|
</div></details><h2 id="fields" class="fields section-header">Fields<a href="#fields" class="anchor">§</a></h2><span id="structfield.options" class="structfield section-header"><a href="#structfield.options" class="anchor field">§</a><code>options: <a class="struct" href="struct.Options.html" title="struct egui::Options">Options</a></code></span><div class="docblock"><p>Global egui options.</p>
|
|
</div><span id="structfield.data" class="structfield section-header"><a href="#structfield.data" class="anchor field">§</a><code>data: <a class="struct" href="util/id_type_map/struct.IdTypeMap.html" title="struct egui::util::id_type_map::IdTypeMap">IdTypeMap</a></code></span><div class="docblock"><p>This map stores some superficial state for all widgets with custom <a href="struct.Id.html" title="struct egui::Id"><code>Id</code></a>s.</p>
|
|
<p>This includes storing whether a <a href="containers/collapsing_header/struct.CollapsingHeader.html" title="struct egui::containers::collapsing_header::CollapsingHeader"><code>crate::CollapsingHeader</code></a> is open, how far scrolled a
|
|
<a href="containers/scroll_area/struct.ScrollArea.html" title="struct egui::containers::scroll_area::ScrollArea"><code>crate::ScrollArea</code></a> is, where the cursor in a <a href="widgets/text_edit/struct.TextEdit.html" title="struct egui::widgets::text_edit::TextEdit"><code>crate::TextEdit</code></a> is, etc.</p>
|
|
<p>This is NOT meant to store any important data. Store that in your own structures!</p>
|
|
<p>Each read clones the data, so keep your values cheap to clone.
|
|
If you want to store a lot of data, you should wrap it in <code>Arc<Mutex<…>></code> so it is cheap to clone.</p>
|
|
<p>This will be saved between different program runs if you use the <code>persistence</code> feature.</p>
|
|
<p>To store a state common for all your widgets (a singleton), use <a href="struct.Id.html#associatedconstant.NULL" title="associated constant egui::Id::NULL"><code>Id::NULL</code></a> as the key.</p>
|
|
</div><span id="structfield.caches" class="structfield section-header"><a href="#structfield.caches" class="anchor field">§</a><code>caches: <a class="struct" href="cache/struct.CacheStorage.html" title="struct egui::cache::CacheStorage">CacheStorage</a></code></span><div class="docblock"><p>Can be used to cache computations from one frame to another.</p>
|
|
<p>This is for saving CPU time when you have something that may take 1-100ms to compute.
|
|
Very slow operations (>100ms) should instead be done async (i.e. in another thread)
|
|
so as not to lock the UI thread.</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>egui::cache::{ComputerMut, FrameCache};
|
|
|
|
<span class="attr">#[derive(Default)]
|
|
</span><span class="kw">struct </span>CharCounter {}
|
|
<span class="kw">impl </span>ComputerMut<<span class="kw-2">&</span>str, usize> <span class="kw">for </span>CharCounter {
|
|
<span class="kw">fn </span>compute(<span class="kw-2">&mut </span><span class="self">self</span>, s: <span class="kw-2">&</span>str) -> usize {
|
|
s.chars().count() <span class="comment">// you probably want to cache something more expensive than this
|
|
</span>}
|
|
}
|
|
<span class="kw">type </span>CharCountCache<<span class="lifetime">'a</span>> = FrameCache<usize, CharCounter>;
|
|
|
|
ctx.memory_mut(|mem| {
|
|
<span class="kw">let </span>cache = mem.caches.cache::<CharCountCache<<span class="lifetime">'_</span>>>();
|
|
<span class="macro">assert_eq!</span>(cache.get(<span class="string">"hello"</span>), <span class="number">5</span>);
|
|
});</code></pre></div>
|
|
</div><span id="structfield.to_global" class="structfield section-header"><a href="#structfield.to_global" class="anchor field">§</a><code>to_global: <a class="type" href="../ahash/type.HashMap.html" title="type ahash::HashMap">HashMap</a><<a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>, <a class="struct" href="../emath/ts_transform/struct.TSTransform.html" title="struct emath::ts_transform::TSTransform">TSTransform</a>></code></span><div class="docblock"><p>Transforms per layer.</p>
|
|
<p>Instead of using this directly, use:</p>
|
|
<ul>
|
|
<li><a href="struct.Context.html#method.set_transform_layer" title="method egui::Context::set_transform_layer"><code>crate::Context::set_transform_layer</code></a></li>
|
|
<li><a href="struct.Context.html#method.layer_transform_to_global" title="method egui::Context::layer_transform_to_global"><code>crate::Context::layer_transform_to_global</code></a></li>
|
|
<li><a href="struct.Context.html#method.layer_transform_from_global" title="method egui::Context::layer_transform_from_global"><code>crate::Context::layer_transform_from_global</code></a></li>
|
|
</ul>
|
|
</div><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Memory" class="impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#780-1065">Source</a><a href="#impl-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.areas" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#813-817">Source</a><h4 class="code-header">pub fn <a href="#method.areas" class="fn">areas</a>(&self) -> &Areas</h4></section></summary><div class="docblock"><p>Access memory of the <a href="containers/struct.Area.html" title="struct egui::containers::Area"><code>Area</code></a>s, such as <code>Window</code>s.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.areas_mut" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#820-822">Source</a><h4 class="code-header">pub fn <a href="#method.areas_mut" class="fn">areas_mut</a>(&mut self) -> &mut Areas</h4></section></summary><div class="docblock"><p>Access memory of the <a href="containers/struct.Area.html" title="struct egui::containers::Area"><code>Area</code></a>s, such as <code>Window</code>s.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.layer_id_at" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#825-835">Source</a><h4 class="code-header">pub fn <a href="#method.layer_id_at" class="fn">layer_id_at</a>(&self, pos: <a class="struct" href="struct.Pos2.html" title="struct egui::Pos2">Pos2</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>></h4></section></summary><div class="docblock"><p>Top-most layer at the given position.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.layer_transforms" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#839-841">Source</a><h4 class="code-header">pub fn <a href="#method.layer_transforms" class="fn">layer_transforms</a>(&self, layer_id: <a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../emath/ts_transform/struct.TSTransform.html" title="struct emath::ts_transform::TSTransform">TSTransform</a>></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::layer_transform_to_global</code> instead</span></div></span></summary><div class="docblock"><p>The currently set transform of a layer.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.layer_ids" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#844-846">Source</a><h4 class="code-header">pub fn <a href="#method.layer_ids" class="fn">layer_ids</a>(&self) -> impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/exact_size/trait.ExactSizeIterator.html" title="trait core::iter::traits::exact_size::ExactSizeIterator">ExactSizeIterator</a><Item = <a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>> + '_</h4></section></summary><div class="docblock"><p>An iterator over all layers. Back-to-front, top is last.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.had_focus_last_frame" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#850-852">Source</a><h4 class="code-header">pub fn <a href="#method.had_focus_last_frame" class="fn">had_focus_last_frame</a>(&self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Check if the layer had focus last frame.
|
|
returns <code>true</code> if the layer had focus last frame, but not this one.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_focus" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#873-875">Source</a><h4 class="code-header">pub fn <a href="#method.has_focus" class="fn">has_focus</a>(&self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this widget have keyboard focus?</p>
|
|
<p>This function does not consider whether the UI as a whole (e.g. window)
|
|
has the keyboard focus. That makes this function suitable for deciding
|
|
widget state that should not be disrupted if the user moves away from
|
|
the window and back.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.focused" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#878-880">Source</a><h4 class="code-header">pub fn <a href="#method.focused" class="fn">focused</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>></h4></section></summary><div class="docblock"><p>Which widget has keyboard focus?</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_focus_lock_filter" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#888-896">Source</a><h4 class="code-header">pub fn <a href="#method.set_focus_lock_filter" class="fn">set_focus_lock_filter</a>(&mut self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>, event_filter: <a class="struct" href="struct.EventFilter.html" title="struct egui::EventFilter">EventFilter</a>)</h4></section></summary><div class="docblock"><p>Set an event filter for a widget.</p>
|
|
<p>This allows you to control whether the widget will loose focus
|
|
when the user presses tab, arrow keys, or escape.</p>
|
|
<p>You must first give focus to the widget before calling this.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.request_focus" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#901-903">Source</a><h4 class="code-header">pub fn <a href="#method.request_focus" class="fn">request_focus</a>(&mut self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>)</h4></section></summary><div class="docblock"><p>Give keyboard focus to a specific widget.
|
|
See also <a href="struct.Response.html#method.request_focus" title="method egui::Response::request_focus"><code>crate::Response::request_focus</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.surrender_focus" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#908-913">Source</a><h4 class="code-header">pub fn <a href="#method.surrender_focus" class="fn">surrender_focus</a>(&mut self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>)</h4></section></summary><div class="docblock"><p>Surrender keyboard focus for a specific widget.
|
|
See also <a href="struct.Response.html#method.surrender_focus" title="method egui::Response::surrender_focus"><code>crate::Response::surrender_focus</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_above_modal_layer" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#918-927">Source</a><h4 class="code-header">pub fn <a href="#method.is_above_modal_layer" class="fn">is_above_modal_layer</a>(&self, layer_id: <a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns true if</p>
|
|
<ul>
|
|
<li>this layer is the top-most modal layer or above it</li>
|
|
<li>there is no modal layer</li>
|
|
</ul>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.allows_interaction" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#933-937">Source</a><h4 class="code-header">pub fn <a href="#method.allows_interaction" class="fn">allows_interaction</a>(&self, layer_id: <a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this layer allow interaction?
|
|
Returns true if</p>
|
|
<ul>
|
|
<li>the layer is not behind a modal layer</li>
|
|
<li>the <a href="layers/enum.Order.html" title="enum egui::layers::Order"><code>Order</code></a> allows interaction</li>
|
|
</ul>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.interested_in_focus" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#949-954">Source</a><h4 class="code-header">pub fn <a href="#method.interested_in_focus" class="fn">interested_in_focus</a>(&mut self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>, layer_id: <a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>)</h4></section></summary><div class="docblock"><p>Register this widget as being interested in getting keyboard focus.
|
|
This will allow the user to select it with tab and shift-tab.
|
|
This is normally done automatically when handling interactions,
|
|
but it is sometimes useful to pre-register interest in focus,
|
|
e.g. before deciding which type of underlying widget to use,
|
|
as in the <a href="widgets/struct.DragValue.html" title="struct egui::widgets::DragValue"><code>crate::DragValue</code></a> widget, so a widget can be focused
|
|
and rendered correctly in a single frame.</p>
|
|
<p>Pass in the <code>layer_id</code> of the layer that the widget is in.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_modal_layer" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#958-969">Source</a><h4 class="code-header">pub fn <a href="#method.set_modal_layer" class="fn">set_modal_layer</a>(&mut self, layer_id: <a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>)</h4></section></summary><div class="docblock"><p>Limit focus to widgets on the given layer and above.
|
|
If this is called multiple times per frame, the top layer wins.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.top_modal_layer" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#972-974">Source</a><h4 class="code-header">pub fn <a href="#method.top_modal_layer" class="fn">top_modal_layer</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="layers/struct.LayerId.html" title="struct egui::layers::LayerId">LayerId</a>></h4></section></summary><div class="docblock"><p>Get the top modal layer (from the previous frame).</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.stop_text_input" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#978-980">Source</a><h4 class="code-header">pub fn <a href="#method.stop_text_input" class="fn">stop_text_input</a>(&mut self)</h4></section></summary><div class="docblock"><p>Stop editing the active <a href="widgets/text_edit/struct.TextEdit.html" title="struct egui::widgets::text_edit::TextEdit"><code>TextEdit</code></a> (if any).</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_anything_being_dragged" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#985-987">Source</a><h4 class="code-header">pub fn <a href="#method.is_anything_being_dragged" class="fn">is_anything_being_dragged</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::dragged_id</code> instead</span></div></span></summary><div class="docblock"><p>Is any widget being dragged?</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_being_dragged" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#995-997">Source</a><h4 class="code-header">pub fn <a href="#method.is_being_dragged" class="fn">is_being_dragged</a>(&self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::is_being_dragged</code> instead</span></div></span></summary><div class="docblock"><p>Is this specific widget being dragged?</p>
|
|
<p>A widget that sense both clicks and drags is only marked as “dragged”
|
|
when the mouse has moved a bit, but <code>is_being_dragged</code> will return true immediately.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.dragged_id" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1007-1009">Source</a><h4 class="code-header">pub fn <a href="#method.dragged_id" class="fn">dragged_id</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::dragged_id</code> instead</span></div></span></summary><div class="docblock"><p>Get the id of the widget being dragged, if any.</p>
|
|
<p>Note that this is set as soon as the mouse is pressed,
|
|
so the widget may not yet be marked as “dragged”,
|
|
as that can only happen after the mouse has moved a bit
|
|
(at least if the widget is interesated in both clicks and drags).</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_dragged_id" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1014-1016">Source</a><h4 class="code-header">pub fn <a href="#method.set_dragged_id" class="fn">set_dragged_id</a>(&mut self, id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>)</h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::set_dragged_id</code> instead</span></div></span></summary><div class="docblock"><p>Set which widget is being dragged.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.stop_dragging" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1021-1023">Source</a><h4 class="code-header">pub fn <a href="#method.stop_dragging" class="fn">stop_dragging</a>(&mut self)</h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::stop_dragging</code> instead</span></div></span></summary><div class="docblock"><p>Stop dragging any widget.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.dragging_something_else" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1030-1033">Source</a><h4 class="code-header">pub fn <a href="#method.dragging_something_else" class="fn">dragging_something_else</a>(&self, not_this: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>Context::dragging_something_else</code> instead</span></div></span></summary><div class="docblock"><p>Is something else being dragged?</p>
|
|
<p>Returns true if we are dragging something, but not the given widget.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reset_areas" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1037-1041">Source</a><h4 class="code-header">pub fn <a href="#method.reset_areas" class="fn">reset_areas</a>(&mut self)</h4></section></summary><div class="docblock"><p>Forget window positions, sizes etc.
|
|
Can be used to auto-layout windows.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.area_rect" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1044-1046">Source</a><h4 class="code-header">pub fn <a href="#method.area_rect" class="fn">area_rect</a>(&self, id: impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Rect.html" title="struct egui::Rect">Rect</a>></h4></section></summary><div class="docblock"><p>Obtain the previous rectangle of an area.</p>
|
|
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Memory-1" class="impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1070-1120">Source</a><a href="#impl-Memory-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section></summary><div class="docblock"><h5 id="popups"><a class="doc-anchor" href="#popups">§</a>Popups</h5>
|
|
<p>Popups are things like combo-boxes, color pickers, menus etc.
|
|
Only one can be open at a time.</p>
|
|
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.is_popup_open" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1072-1074">Source</a><h4 class="code-header">pub fn <a href="#method.is_popup_open" class="fn">is_popup_open</a>(&self, popup_id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Is the given popup open?</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.any_popup_open" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1077-1079">Source</a><h4 class="code-header">pub fn <a href="#method.any_popup_open" class="fn">any_popup_open</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Is any popup open?</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.open_popup" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1082-1084">Source</a><h4 class="code-header">pub fn <a href="#method.open_popup" class="fn">open_popup</a>(&mut self, popup_id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>)</h4></section></summary><div class="docblock"><p>Open the given popup and close all others.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.close_popup" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1087-1089">Source</a><h4 class="code-header">pub fn <a href="#method.close_popup" class="fn">close_popup</a>(&mut self)</h4></section></summary><div class="docblock"><p>Close the open popup, if any.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.toggle_popup" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1094-1100">Source</a><h4 class="code-header">pub fn <a href="#method.toggle_popup" class="fn">toggle_popup</a>(&mut self, popup_id: <a class="struct" href="struct.Id.html" title="struct egui::Id">Id</a>)</h4></section></summary><div class="docblock"><p>Toggle the given popup between closed and open.</p>
|
|
<p>Note: At most, only one popup can be open at a time.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.everything_is_visible" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1108-1110">Source</a><h4 class="code-header">pub fn <a href="#method.everything_is_visible" class="fn">everything_is_visible</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>If true, all windows, menus, tooltips, etc., will be visible at once.</p>
|
|
<p>This is useful for testing, benchmarking, pre-caching, etc.</p>
|
|
<p>Experimental feature!</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_everything_is_visible" class="method"><a class="src rightside" href="../src/egui/memory/mod.rs.html#1117-1119">Source</a><h4 class="code-header">pub fn <a href="#method.set_everything_is_visible" class="fn">set_everything_is_visible</a>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>)</h4></section></summary><div class="docblock"><p>If true, all windows, menus, tooltips etc are to be visible at once.</p>
|
|
<p>This is useful for testing, benchmarking, pre-caching, etc.</p>
|
|
<p>Experimental feature!</p>
|
|
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-Memory" class="impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#27">Source</a><a href="#impl-Clone-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#27">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Memory" class="impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#27">Source</a><a href="#impl-Debug-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#27">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.84.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.84.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-Memory" class="impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#117-137">Source</a><a href="#impl-Default-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/egui/memory/mod.rs.html#118-136">Source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Memory" class="impl"><a href="#impl-Freeze-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section><section id="impl-RefUnwindSafe-for-Memory" class="impl"><a href="#impl-RefUnwindSafe-for-Memory" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section><section id="impl-Send-for-Memory" class="impl"><a href="#impl-Send-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section><section id="impl-Sync-for-Memory" class="impl"><a href="#impl-Sync-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section><section id="impl-Unpin-for-Memory" class="impl"><a href="#impl-Unpin-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section><section id="impl-UnwindSafe-for-Memory" class="impl"><a href="#impl-UnwindSafe-for-Memory" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Memory.html" title="struct egui::Memory">Memory</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
|
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
|
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
|
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
|
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
|
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
|
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
|
<p>That is, this conversion is whatever the implementation of
|
|
<code><a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
|
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
|
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
|
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
|
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><section id="impl-SerializableAny-for-T" class="impl"><a class="src rightside" href="../src/egui/util/id_type_map.rs.html#54">Source</a><a href="#impl-SerializableAny-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="util/id_type_map/trait.SerializableAny.html" title="trait egui::util::id_type_map::SerializableAny">SerializableAny</a> for T<div class="where">where
|
|
T: 'static + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + for<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section></div></section></div></main></body></html> |