174 lines
61 KiB
HTML
174 lines
61 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="Input state that egui updates each frame."><title>InputState 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="#">Input<wbr>State</a></h2><h3><a href="#fields">Fields</a></h3><ul class="block structfield"><li><a href="#structfield.events" title="events">events</a></li><li><a href="#structfield.focused" title="focused">focused</a></li><li><a href="#structfield.keys_down" title="keys_down">keys_down</a></li><li><a href="#structfield.max_texture_side" title="max_texture_side">max_texture_side</a></li><li><a href="#structfield.modifiers" title="modifiers">modifiers</a></li><li><a href="#structfield.pixels_per_point" title="pixels_per_point">pixels_per_point</a></li><li><a href="#structfield.pointer" title="pointer">pointer</a></li><li><a href="#structfield.predicted_dt" title="predicted_dt">predicted_dt</a></li><li><a href="#structfield.raw" title="raw">raw</a></li><li><a href="#structfield.raw_scroll_delta" title="raw_scroll_delta">raw_scroll_delta</a></li><li><a href="#structfield.screen_rect" title="screen_rect">screen_rect</a></li><li><a href="#structfield.smooth_scroll_delta" title="smooth_scroll_delta">smooth_scroll_delta</a></li><li><a href="#structfield.stable_dt" title="stable_dt">stable_dt</a></li><li><a href="#structfield.time" title="time">time</a></li><li><a href="#structfield.unstable_dt" title="unstable_dt">unstable_dt</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.aim_radius" title="aim_radius">aim_radius</a></li><li><a href="#method.any_touches" title="any_touches">any_touches</a></li><li><a href="#method.begin_pass" title="begin_pass">begin_pass</a></li><li><a href="#method.consume_key" title="consume_key">consume_key</a></li><li><a href="#method.consume_shortcut" title="consume_shortcut">consume_shortcut</a></li><li><a href="#method.count_and_consume_key" title="count_and_consume_key">count_and_consume_key</a></li><li><a href="#method.filtered_events" title="filtered_events">filtered_events</a></li><li><a href="#method.has_touch_screen" title="has_touch_screen">has_touch_screen</a></li><li><a href="#method.key_down" title="key_down">key_down</a></li><li><a href="#method.key_pressed" title="key_pressed">key_pressed</a></li><li><a href="#method.key_released" title="key_released">key_released</a></li><li><a href="#method.multi_touch" title="multi_touch">multi_touch</a></li><li><a href="#method.num_presses" title="num_presses">num_presses</a></li><li><a href="#method.physical_pixel_size" title="physical_pixel_size">physical_pixel_size</a></li><li><a href="#method.pixels_per_point" title="pixels_per_point">pixels_per_point</a></li><li><a href="#method.screen_rect" title="screen_rect">screen_rect</a></li><li><a href="#method.time_since_last_scroll" title="time_since_last_scroll">time_since_last_scroll</a></li><li><a href="#method.ui" title="ui">ui</a></li><li><a href="#method.viewport" title="viewport">viewport</a></li><li><a href="#method.wants_repaint_after" title="wants_repaint_after">wants_repaint_after</a></li><li><a href="#method.zoom_delta" title="zoom_delta">zoom_delta</a></li><li><a href="#method.zoom_delta_2d" title="zoom_delta_2d">zoom_delta_2d</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-InputState" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-InputState" title="Debug">Debug</a></li><li><a href="#impl-Default-for-InputState" 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-InputState" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-UnwindSafe-for-InputState" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-InputState" title="Freeze">Freeze</a></li><li><a href="#impl-Send-for-InputState" title="Send">Send</a></li><li><a href="#impl-Sync-for-InputState" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-InputState" 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">InputState</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/input_state/mod.rs.html#99-231">Source</a> </span></div><pre class="rust item-decl"><code>pub struct InputState {<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 15 fields</span></summary>
|
||
pub raw: <a class="struct" href="struct.RawInput.html" title="struct egui::RawInput">RawInput</a>,
|
||
pub pointer: <a class="struct" href="struct.PointerState.html" title="struct egui::PointerState">PointerState</a>,
|
||
pub raw_scroll_delta: <a class="struct" href="struct.Vec2.html" title="struct egui::Vec2">Vec2</a>,
|
||
pub smooth_scroll_delta: <a class="struct" href="struct.Vec2.html" title="struct egui::Vec2">Vec2</a>,
|
||
pub screen_rect: <a class="struct" href="struct.Rect.html" title="struct egui::Rect">Rect</a>,
|
||
pub pixels_per_point: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>,
|
||
pub max_texture_side: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>,
|
||
pub time: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a>,
|
||
pub unstable_dt: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>,
|
||
pub predicted_dt: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>,
|
||
pub stable_dt: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>,
|
||
pub focused: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
|
||
pub modifiers: <a class="struct" href="struct.Modifiers.html" title="struct egui::Modifiers">Modifiers</a>,
|
||
pub keys_down: <a class="struct" href="https://doc.rust-lang.org/1.84.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="enum.Key.html" title="enum egui::Key">Key</a>>,
|
||
pub events: <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="enum.Event.html" title="enum egui::Event">Event</a>>,
|
||
<span class="comment">/* private fields */</span>
|
||
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Input state that egui updates each frame.</p>
|
||
<p>You can access this with <a href="struct.Context.html#method.input" title="method egui::Context::input"><code>crate::Context::input</code></a>.</p>
|
||
<p>You can check if <code>egui</code> is using the inputs using
|
||
<a href="struct.Context.html#method.wants_pointer_input" title="method egui::Context::wants_pointer_input"><code>crate::Context::wants_pointer_input</code></a> and <a href="struct.Context.html#method.wants_keyboard_input" title="method egui::Context::wants_keyboard_input"><code>crate::Context::wants_keyboard_input</code></a>.</p>
|
||
</div></details><h2 id="fields" class="fields section-header">Fields<a href="#fields" class="anchor">§</a></h2><span id="structfield.raw" class="structfield section-header"><a href="#structfield.raw" class="anchor field">§</a><code>raw: <a class="struct" href="struct.RawInput.html" title="struct egui::RawInput">RawInput</a></code></span><div class="docblock"><p>The raw input we got this frame from the backend.</p>
|
||
</div><span id="structfield.pointer" class="structfield section-header"><a href="#structfield.pointer" class="anchor field">§</a><code>pointer: <a class="struct" href="struct.PointerState.html" title="struct egui::PointerState">PointerState</a></code></span><div class="docblock"><p>State of the mouse or simple touch gestures which can be mapped to mouse operations.</p>
|
||
</div><span id="structfield.raw_scroll_delta" class="structfield section-header"><a href="#structfield.raw_scroll_delta" class="anchor field">§</a><code>raw_scroll_delta: <a class="struct" href="struct.Vec2.html" title="struct egui::Vec2">Vec2</a></code></span><div class="docblock"><p>You probably want to use <a href="struct.InputState.html#structfield.smooth_scroll_delta" title="field egui::InputState::smooth_scroll_delta"><code>Self::smooth_scroll_delta</code></a> instead.</p>
|
||
<p>The raw input of how many points the user scrolled.</p>
|
||
<p>The delta dictates how the <em>content</em> should move.</p>
|
||
<p>A positive X-value indicates the content is being moved right,
|
||
as when swiping right on a touch-screen or track-pad with natural scrolling.</p>
|
||
<p>A positive Y-value indicates the content is being moved down,
|
||
as when swiping down on a touch-screen or track-pad with natural scrolling.</p>
|
||
<p>When using a notched scroll-wheel this will spike very large for one frame,
|
||
then drop to zero. For a smoother experience, use <a href="struct.InputState.html#structfield.smooth_scroll_delta" title="field egui::InputState::smooth_scroll_delta"><code>Self::smooth_scroll_delta</code></a>.</p>
|
||
</div><span id="structfield.smooth_scroll_delta" class="structfield section-header"><a href="#structfield.smooth_scroll_delta" class="anchor field">§</a><code>smooth_scroll_delta: <a class="struct" href="struct.Vec2.html" title="struct egui::Vec2">Vec2</a></code></span><div class="docblock"><p>How many points the user scrolled, smoothed over a few frames.</p>
|
||
<p>The delta dictates how the <em>content</em> should move.</p>
|
||
<p>A positive X-value indicates the content is being moved right,
|
||
as when swiping right on a touch-screen or track-pad with natural scrolling.</p>
|
||
<p>A positive Y-value indicates the content is being moved down,
|
||
as when swiping down on a touch-screen or track-pad with natural scrolling.</p>
|
||
<p><a href="containers/scroll_area/struct.ScrollArea.html" title="struct egui::containers::scroll_area::ScrollArea"><code>crate::ScrollArea</code></a> will both read and write to this field, so that
|
||
at the end of the frame this will be zero if a scroll-area consumed the delta.</p>
|
||
</div><span id="structfield.screen_rect" class="structfield section-header"><a href="#structfield.screen_rect" class="anchor field">§</a><code>screen_rect: <a class="struct" href="struct.Rect.html" title="struct egui::Rect">Rect</a></code></span><div class="docblock"><p>Position and size of the egui area.</p>
|
||
</div><span id="structfield.pixels_per_point" class="structfield section-header"><a href="#structfield.pixels_per_point" class="anchor field">§</a><code>pixels_per_point: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></code></span><div class="docblock"><p>Also known as device pixel ratio, > 1 for high resolution screens.</p>
|
||
</div><span id="structfield.max_texture_side" class="structfield section-header"><a href="#structfield.max_texture_side" class="anchor field">§</a><code>max_texture_side: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></code></span><div class="docblock"><p>Maximum size of one side of a texture.</p>
|
||
<p>This depends on the backend.</p>
|
||
</div><span id="structfield.time" class="structfield section-header"><a href="#structfield.time" class="anchor field">§</a><code>time: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f64.html">f64</a></code></span><div class="docblock"><p>Time in seconds. Relative to whatever. Used for animation.</p>
|
||
</div><span id="structfield.unstable_dt" class="structfield section-header"><a href="#structfield.unstable_dt" class="anchor field">§</a><code>unstable_dt: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></code></span><div class="docblock"><p>Time since last frame, in seconds.</p>
|
||
<p>This can be very unstable in reactive mode (when we don’t paint each frame).
|
||
For animations it is therefore better to use <a href="struct.InputState.html#structfield.stable_dt" title="field egui::InputState::stable_dt"><code>Self::stable_dt</code></a>.</p>
|
||
</div><span id="structfield.predicted_dt" class="structfield section-header"><a href="#structfield.predicted_dt" class="anchor field">§</a><code>predicted_dt: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></code></span><div class="docblock"><p>Estimated time until next frame (provided we repaint right away).</p>
|
||
<p>Used for animations to get instant feedback (avoid frame delay).
|
||
Should be set to the expected time between frames when painting at vsync speeds.</p>
|
||
<p>On most integrations this has a fixed value of <code>1.0 / 60.0</code>, so it is not a very accurate estimate.</p>
|
||
</div><span id="structfield.stable_dt" class="structfield section-header"><a href="#structfield.stable_dt" class="anchor field">§</a><code>stable_dt: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></code></span><div class="docblock"><p>Time since last frame (in seconds), but gracefully handles the first frame after sleeping in reactive mode.</p>
|
||
<p>In reactive mode (available in e.g. <code>eframe</code>), <code>egui</code> only updates when there is new input
|
||
or something is animating.
|
||
This can lead to large gaps of time (sleep), leading to large <a href="struct.InputState.html#structfield.unstable_dt" title="field egui::InputState::unstable_dt"><code>Self::unstable_dt</code></a>.</p>
|
||
<p>If <code>egui</code> requested a repaint the previous frame, then <code>egui</code> will use
|
||
<code>stable_dt = unstable_dt;</code>, but if <code>egui</code> did not not request a repaint last frame,
|
||
then <code>egui</code> will assume <code>unstable_dt</code> is too large, and will use
|
||
<code>stable_dt = predicted_dt;</code>.</p>
|
||
<p>This means that for the first frame after a sleep,
|
||
<code>stable_dt</code> will be a prediction of the delta-time until the next frame,
|
||
and in all other situations this will be an accurate measurement of time passed
|
||
since the previous frame.</p>
|
||
<p>Note that a frame can still stall for various reasons, so <code>stable_dt</code> can
|
||
still be unusually large in some situations.</p>
|
||
<p>When animating something, it is recommended that you use something like
|
||
<code>stable_dt.min(0.1)</code> - this will give you smooth animations when the framerate is good
|
||
(even in reactive mode), but will avoid large jumps when framerate is bad,
|
||
and will effectively slow down the animation when FPS drops below 10.</p>
|
||
</div><span id="structfield.focused" class="structfield section-header"><a href="#structfield.focused" class="anchor field">§</a><code>focused: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></code></span><div class="docblock"><p>The native window has the keyboard focus (i.e. is receiving key presses).</p>
|
||
<p>False when the user alt-tab away from the application, for instance.</p>
|
||
</div><span id="structfield.modifiers" class="structfield section-header"><a href="#structfield.modifiers" class="anchor field">§</a><code>modifiers: <a class="struct" href="struct.Modifiers.html" title="struct egui::Modifiers">Modifiers</a></code></span><div class="docblock"><p>Which modifier keys are down at the start of the frame?</p>
|
||
</div><span id="structfield.keys_down" class="structfield section-header"><a href="#structfield.keys_down" class="anchor field">§</a><code>keys_down: <a class="struct" href="https://doc.rust-lang.org/1.84.0/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="enum" href="enum.Key.html" title="enum egui::Key">Key</a>></code></span><span id="structfield.events" class="structfield section-header"><a href="#structfield.events" class="anchor field">§</a><code>events: <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="enum.Event.html" title="enum egui::Event">Event</a>></code></span><div class="docblock"><p>In-order events received this frame</p>
|
||
</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-InputState" class="impl"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#263-741">Source</a><a href="#impl-InputState" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.InputState.html" title="struct egui::InputState">InputState</a></h3></section></summary><div class="impl-items"><section id="method.begin_pass" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#265-434">Source</a><h4 class="code-header">pub fn <a href="#method.begin_pass" class="fn">begin_pass</a>(
|
||
self,
|
||
new: <a class="struct" href="struct.RawInput.html" title="struct egui::RawInput">RawInput</a>,
|
||
requested_immediate_repaint_prev_frame: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>,
|
||
pixels_per_point: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>,
|
||
options: &<a class="struct" href="struct.Options.html" title="struct egui::Options">Options</a>,
|
||
) -> Self</h4></section><details class="toggle method-toggle" open><summary><section id="method.viewport" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#438-440">Source</a><h4 class="code-header">pub fn <a href="#method.viewport" class="fn">viewport</a>(&self) -> &<a class="struct" href="struct.ViewportInfo.html" title="struct egui::ViewportInfo">ViewportInfo</a></h4></section></summary><div class="docblock"><p>Info about the active viewport</p>
|
||
</div></details><section id="method.screen_rect" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#443-445">Source</a><h4 class="code-header">pub fn <a href="#method.screen_rect" class="fn">screen_rect</a>(&self) -> <a class="struct" href="struct.Rect.html" title="struct egui::Rect">Rect</a></h4></section><details class="toggle method-toggle" open><summary><section id="method.zoom_delta" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#452-459">Source</a><h4 class="code-header">pub fn <a href="#method.zoom_delta" class="fn">zoom_delta</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Zoom scale factor this frame (e.g. from ctrl-scroll or pinch gesture).</p>
|
||
<ul>
|
||
<li><code>zoom = 1</code>: no change</li>
|
||
<li><code>zoom < 1</code>: pinch together</li>
|
||
<li><code>zoom > 1</code>: pinch spread</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.zoom_delta_2d" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#475-484">Source</a><h4 class="code-header">pub fn <a href="#method.zoom_delta_2d" class="fn">zoom_delta_2d</a>(&self) -> <a class="struct" href="struct.Vec2.html" title="struct egui::Vec2">Vec2</a></h4></section></summary><div class="docblock"><p>2D non-proportional zoom scale factor this frame (e.g. from ctrl-scroll or pinch gesture).</p>
|
||
<p>For multitouch devices the user can do a horizontal or vertical pinch gesture.
|
||
In these cases a non-proportional zoom factor is a available.
|
||
In other cases, this reverts to <code>Vec2::splat(self.zoom_delta())</code>.</p>
|
||
<p>For horizontal pinches, this will return <code>[z, 1]</code>,
|
||
for vertical pinches this will return <code>[1, z]</code>,
|
||
and otherwise this will return <code>[z, z]</code>,
|
||
where <code>z</code> is the zoom factor:</p>
|
||
<ul>
|
||
<li><code>zoom = 1</code>: no change</li>
|
||
<li><code>zoom < 1</code>: pinch together</li>
|
||
<li><code>zoom > 1</code>: pinch spread</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.time_since_last_scroll" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#488-490">Source</a><h4 class="code-header">pub fn <a href="#method.time_since_last_scroll" class="fn">time_since_last_scroll</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>How long has it been (in seconds) since the use last scrolled?</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.wants_repaint_after" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#495-519">Source</a><h4 class="code-header">pub fn <a href="#method.wants_repaint_after" class="fn">wants_repaint_after</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="https://doc.rust-lang.org/1.84.0/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>></h4></section></summary><div class="docblock"><p>The <a href="struct.Context.html" title="struct egui::Context"><code>crate::Context</code></a> will call this at the end of each frame to see if we need a repaint.</p>
|
||
<p>Returns how long to wait for a repaint.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.count_and_consume_key" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#530-550">Source</a><h4 class="code-header">pub fn <a href="#method.count_and_consume_key" class="fn">count_and_consume_key</a>(
|
||
&mut self,
|
||
modifiers: <a class="struct" href="struct.Modifiers.html" title="struct egui::Modifiers">Modifiers</a>,
|
||
logical_key: <a class="enum" href="enum.Key.html" title="enum egui::Key">Key</a>,
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Count presses of a key. If non-zero, the presses are consumed, so that this will only return non-zero once.</p>
|
||
<p>Includes key-repeat events.</p>
|
||
<p>This uses <a href="struct.Modifiers.html#method.matches_logically" title="method egui::Modifiers::matches_logically"><code>Modifiers::matches_logically</code></a> to match modifiers,
|
||
meaning extra Shift and Alt modifiers are ignored.
|
||
Therefore, you should match most specific shortcuts first,
|
||
i.e. check for <code>Cmd-Shift-S</code> (“Save as…”) before <code>Cmd-S</code> (“Save”),
|
||
so that a user pressing <code>Cmd-Shift-S</code> won’t trigger the wrong command!</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.consume_key" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#561-563">Source</a><h4 class="code-header">pub fn <a href="#method.consume_key" class="fn">consume_key</a>(&mut self, modifiers: <a class="struct" href="struct.Modifiers.html" title="struct egui::Modifiers">Modifiers</a>, logical_key: <a class="enum" href="enum.Key.html" title="enum egui::Key">Key</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 for a key press. If found, <code>true</code> is returned and the key pressed is consumed, so that this will only return <code>true</code> once.</p>
|
||
<p>Includes key-repeat events.</p>
|
||
<p>This uses <a href="struct.Modifiers.html#method.matches_logically" title="method egui::Modifiers::matches_logically"><code>Modifiers::matches_logically</code></a> to match modifiers,
|
||
meaning extra Shift and Alt modifiers are ignored.
|
||
Therefore, you should match most specific shortcuts first,
|
||
i.e. check for <code>Cmd-Shift-S</code> (“Save as…”) before <code>Cmd-S</code> (“Save”),
|
||
so that a user pressing <code>Cmd-Shift-S</code> won’t trigger the wrong command!</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.consume_shortcut" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#574-580">Source</a><h4 class="code-header">pub fn <a href="#method.consume_shortcut" class="fn">consume_shortcut</a>(&mut self, shortcut: &<a class="struct" href="struct.KeyboardShortcut.html" title="struct egui::KeyboardShortcut">KeyboardShortcut</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 given shortcut has been pressed.</p>
|
||
<p>If so, <code>true</code> is returned and the key pressed is consumed, so that this will only return <code>true</code> once.</p>
|
||
<p>This uses <a href="struct.Modifiers.html#method.matches_logically" title="method egui::Modifiers::matches_logically"><code>Modifiers::matches_logically</code></a> to match modifiers,
|
||
meaning extra Shift and Alt modifiers are ignored.
|
||
Therefore, you should match most specific shortcuts first,
|
||
i.e. check for <code>Cmd-Shift-S</code> (“Save as…”) before <code>Cmd-S</code> (“Save”),
|
||
so that a user pressing <code>Cmd-Shift-S</code> won’t trigger the wrong command!</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.key_pressed" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#585-587">Source</a><h4 class="code-header">pub fn <a href="#method.key_pressed" class="fn">key_pressed</a>(&self, desired_key: <a class="enum" href="enum.Key.html" title="enum egui::Key">Key</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>Was the given key pressed this frame?</p>
|
||
<p>Includes key-repeat events.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.num_presses" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#592-603">Source</a><h4 class="code-header">pub fn <a href="#method.num_presses" class="fn">num_presses</a>(&self, desired_key: <a class="enum" href="enum.Key.html" title="enum egui::Key">Key</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>How many times was the given key pressed this frame?</p>
|
||
<p>Includes key-repeat events.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.key_down" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#606-608">Source</a><h4 class="code-header">pub fn <a href="#method.key_down" class="fn">key_down</a>(&self, desired_key: <a class="enum" href="enum.Key.html" title="enum egui::Key">Key</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 key currently held down?</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.key_released" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#611-622">Source</a><h4 class="code-header">pub fn <a href="#method.key_released" class="fn">key_released</a>(&self, desired_key: <a class="enum" href="enum.Key.html" title="enum egui::Key">Key</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>Was the given key released this frame?</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.pixels_per_point" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#626-628">Source</a><h4 class="code-header">pub fn <a href="#method.pixels_per_point" class="fn">pixels_per_point</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Also known as device pixel ratio, > 1 for high resolution screens.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.physical_pixel_size" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#632-634">Source</a><h4 class="code-header">pub fn <a href="#method.physical_pixel_size" class="fn">physical_pixel_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>Size of a physical pixel in logical gui coordinates (points).</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.aim_radius" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#639-642">Source</a><h4 class="code-header">pub fn <a href="#method.aim_radius" class="fn">aim_radius</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section></summary><div class="docblock"><p>How imprecise do we expect the mouse/touch input to be?
|
||
Returns imprecision in points.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.multi_touch" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#671-674">Source</a><h4 class="code-header">pub fn <a href="#method.multi_touch" class="fn">multi_touch</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.MultiTouchInfo.html" title="struct egui::MultiTouchInfo">MultiTouchInfo</a>></h4></section></summary><div class="docblock"><p>Returns details about the currently ongoing multi-touch gesture, if any. Note that this
|
||
method returns <code>None</code> for single-touch gestures (click, drag, …).</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>zoom = <span class="number">1.0</span>; <span class="comment">// no zoom
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>rotation = <span class="number">0.0</span>; <span class="comment">// no rotation
|
||
</span><span class="kw">let </span>multi_touch = ui.input(|i| i.multi_touch());
|
||
<span class="kw">if let </span><span class="prelude-val">Some</span>(multi_touch) = multi_touch {
|
||
zoom <span class="kw-2">*</span>= multi_touch.zoom_delta;
|
||
rotation += multi_touch.rotation_delta;
|
||
}
|
||
<span class="kw">let </span>transform = zoom * Rot2::from_angle(rotation);</code></pre></div>
|
||
<p>By far not all touch devices are supported, and the details depend on the <code>egui</code>
|
||
integration backend you are using. <code>eframe</code> web supports multi touch for most mobile
|
||
devices, but not for a <code>Trackpad</code> on <code>MacOS</code>, for example. The backend has to be able to
|
||
capture native touch events, but many browsers seem to pass such events only for touch
|
||
<em>screens</em>, but not touch <em>pads.</em></p>
|
||
<p>Refer to <a href="struct.MultiTouchInfo.html" title="struct egui::MultiTouchInfo"><code>MultiTouchInfo</code></a> for details about the touch information available.</p>
|
||
<p>Consider using <code>zoom_delta()</code> instead of <code>MultiTouchInfo::zoom_delta</code> as the former
|
||
delivers a synthetic zoom factor based on ctrl-scroll events, as a fallback.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.any_touches" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#677-679">Source</a><h4 class="code-header">pub fn <a href="#method.any_touches" class="fn">any_touches</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>True if there currently are any fingers touching egui.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_touch_screen" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#682-684">Source</a><h4 class="code-header">pub fn <a href="#method.has_touch_screen" class="fn">has_touch_screen</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>True if we have ever received a touch event.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.filtered_events" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#726-732">Source</a><h4 class="code-header">pub fn <a href="#method.filtered_events" class="fn">filtered_events</a>(&self, filter: &<a class="struct" href="struct.EventFilter.html" title="struct egui::EventFilter">EventFilter</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="enum.Event.html" title="enum egui::Event">Event</a>></h4></section></summary><div class="docblock"><p>Get all events that matches the given filter.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-InputState-1" class="impl"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#1330-1419">Source</a><a href="#impl-InputState-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.InputState.html" title="struct egui::InputState">InputState</a></h3></section></summary><div class="impl-items"><section id="method.ui" class="method"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#1331-1418">Source</a><h4 class="code-header">pub fn <a href="#method.ui" class="fn">ui</a>(&self, ui: &mut <a class="struct" href="struct.Ui.html" title="struct egui::Ui">Ui</a>)</h4></section></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-InputState" class="impl"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#97">Source</a><a href="#impl-Clone-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</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/input_state/mod.rs.html#97">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.InputState.html" title="struct egui::InputState">InputState</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-InputState" class="impl"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#97">Source</a><a href="#impl-Debug-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</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/input_state/mod.rs.html#97">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-InputState" class="impl"><a class="src rightside" href="../src/egui/input_state/mod.rs.html#233-261">Source</a><a href="#impl-Default-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</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/input_state/mod.rs.html#234-260">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-InputState" class="impl"><a href="#impl-Freeze-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</a></h3></section><section id="impl-RefUnwindSafe-for-InputState" class="impl"><a href="#impl-RefUnwindSafe-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</a></h3></section><section id="impl-Send-for-InputState" class="impl"><a href="#impl-Send-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</a></h3></section><section id="impl-Sync-for-InputState" class="impl"><a href="#impl-Sync-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</a></h3></section><section id="impl-Unpin-for-InputState" class="impl"><a href="#impl-Unpin-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</a></h3></section><section id="impl-UnwindSafe-for-InputState" class="impl"><a href="#impl-UnwindSafe-for-InputState" 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.InputState.html" title="struct egui::InputState">InputState</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> |