blob: 647c88aa1c0e1e662dde5357156523665c596a4e [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A readiness event."><meta name="keywords" content="rust, rustlang, rust-lang, Event"><title>Event in mio::event - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.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">&#9776;</button><a class="sidebar-logo" href="../../mio/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../mio/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Event</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.is_aio">is_aio</a></li><li><a href="#method.is_error">is_error</a></li><li><a href="#method.is_lio">is_lio</a></li><li><a href="#method.is_priority">is_priority</a></li><li><a href="#method.is_read_closed">is_read_closed</a></li><li><a href="#method.is_readable">is_readable</a></li><li><a href="#method.is_writable">is_writable</a></li><li><a href="#method.is_write_closed">is_write_closed</a></li><li><a href="#method.token">token</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Clone-for-Event">Clone</a></li><li><a href="#impl-Debug-for-Event">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-Event">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Event">Send</a></li><li><a href="#impl-Sync-for-Event">Sync</a></li><li><a href="#impl-Unpin-for-Event">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Event">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-Event">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-Event">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-Event">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-Event">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-Event">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-Event">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-Event">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-Event">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In mio::event</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="../index.html">mio</a>::<wbr><a href="index.html">event</a>::<wbr><a class="struct" href="#">Event</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/mio/event/event.rs.html#17-19">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code><div class="code-attribute">#[repr(transparent)]</div>pub struct Event { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A readiness event.</p>
<p><code>Event</code> is a readiness state paired with a <a href="../struct.Token.html"><code>Token</code></a>. It is returned by
<a href="../struct.Poll.html#method.poll"><code>Poll::poll</code></a>.</p>
<p>For more documentation on polling and events, see <a href="../struct.Poll.html"><code>Poll</code></a>.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Event" class="impl has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#21-194">source</a><a href="#impl-Event" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.token" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#23-25">source</a><h4 class="code-header">pub fn <a href="#method.token" class="fnname">token</a>(&amp;self) -&gt; <a class="struct" href="../struct.Token.html" title="struct mio::Token">Token</a></h4></section></summary><div class="docblock"><p>Returns the event’s token.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_readable" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#37-39">source</a><h4 class="code-header">pub fn <a href="#method.is_readable" class="fnname">is_readable</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains readable readiness.</p>
<h5 id="notes"><a href="#notes">Notes</a></h5>
<p>Out-of-band (OOB) data also triggers readable events. But must
application don’t actually read OOB data, this could leave an
application open to a Denial-of-Service (Dos) attack, see
<a href="https://github.com/sandstorm-io/sandstorm-website/blob/58f93346028c0576e8147627667328eaaf4be9fa/_posts/2015-04-08-osx-security-bug.md">https://github.com/sandstorm-io/sandstorm-website/blob/58f93346028c0576e8147627667328eaaf4be9fa/_posts/2015-04-08-osx-security-bug.md</a>.
However because Mio uses edge-triggers it will not result in an infinite
loop as described in the article above.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_writable" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#42-44">source</a><h4 class="code-header">pub fn <a href="#method.is_writable" class="fnname">is_writable</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains writable readiness.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_error" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#67-69">source</a><h4 class="code-header">pub fn <a href="#method.is_error" class="fnname">is_error</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains error readiness.</p>
<p>Error events occur when the socket enters an error state. In this case,
the socket will also receive a readable or writable event. Reading or
writing to the socket will result in an error.</p>
<h5 id="notes-1"><a href="#notes-1">Notes</a></h5>
<p>Method is available on all platforms, but not all platforms trigger the
error event.</p>
<p>The table below shows what flags are checked on what OS.</p>
<div><table><thead><tr><th><a href="../struct.Poll.html#implementation-notes">OS selector</a></th><th>Flag(s) checked</th></tr></thead><tbody>
<tr><td><a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll</a></td><td><code>EPOLLERR</code></td></tr>
<tr><td><a href="https://www.freebsd.org/cgi/man.cgi?query=kqueue&amp;sektion=2">kqueue</a></td><td><code>EV_ERROR</code> and <code>EV_EOF</code> with <code>fflags</code> set to <code>0</code>.</td></tr>
</tbody></table>
</div></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_read_closed" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#98-100">source</a><h4 class="code-header">pub fn <a href="#method.is_read_closed" class="fnname">is_read_closed</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains read closed readiness.</p>
<h5 id="notes-2"><a href="#notes-2">Notes</a></h5>
<p>Read closed readiness can be expected after any of the following have
occurred:</p>
<ul>
<li>The local stream has shutdown the read half of its socket</li>
<li>The local stream has shutdown both the read half and the write half
of its socket</li>
<li>The peer stream has shutdown the write half its socket; this sends a
<code>FIN</code> packet that has been received by the local stream</li>
</ul>
<p>Method is a best effort implementation. While some platforms may not
return readiness when read half is closed, it is guaranteed that
false-positives will not occur.</p>
<p>The table below shows what flags are checked on what OS.</p>
<div><table><thead><tr><th><a href="../struct.Poll.html#implementation-notes">OS selector</a></th><th>Flag(s) checked</th></tr></thead><tbody>
<tr><td><a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll</a></td><td><code>EPOLLHUP</code>, or</td></tr>
<tr><td></td><td><code>EPOLLIN</code> and <code>EPOLLRDHUP</code></td></tr>
<tr><td><a href="https://www.freebsd.org/cgi/man.cgi?query=kqueue&amp;sektion=2">kqueue</a></td><td><code>EV_EOF</code></td></tr>
</tbody></table>
</div></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_write_closed" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#128-130">source</a><h4 class="code-header">pub fn <a href="#method.is_write_closed" class="fnname">is_write_closed</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains write closed readiness.</p>
<h5 id="notes-3"><a href="#notes-3">Notes</a></h5>
<p>On <a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll</a> this is essentially a check for <code>EPOLLHUP</code> flag as the
local stream shutting down its write half does not trigger this event.</p>
<p>On <a href="https://www.freebsd.org/cgi/man.cgi?query=kqueue&amp;sektion=2">kqueue</a> the local stream shutting down the write half of its
socket will trigger this event.</p>
<p>Method is a best effort implementation. While some platforms may not
return readiness when write half is closed, it is guaranteed that
false-positives will not occur.</p>
<p>The table below shows what flags are checked on what OS.</p>
<div><table><thead><tr><th><a href="../struct.Poll.html#implementation-notes">OS selector</a></th><th>Flag(s) checked</th></tr></thead><tbody>
<tr><td><a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll</a></td><td><code>EPOLLHUP</code>, or</td></tr>
<tr><td></td><td>only <code>EPOLLERR</code>, or</td></tr>
<tr><td></td><td><code>EPOLLOUT</code> and <code>EPOLLERR</code></td></tr>
<tr><td><a href="https://www.freebsd.org/cgi/man.cgi?query=kqueue&amp;sektion=2">kqueue</a></td><td><code>EV_EOF</code></td></tr>
</tbody></table>
</div></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_priority" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#150-152">source</a><h4 class="code-header">pub fn <a href="#method.is_priority" class="fnname">is_priority</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains priority readiness.</p>
<h5 id="notes-4"><a href="#notes-4">Notes</a></h5>
<p>Method is available on all platforms, but not all platforms trigger the
priority event.</p>
<p>The table below shows what flags are checked on what OS.</p>
<div><table><thead><tr><th><a href="../struct.Poll.html#implementation-notes">OS selector</a></th><th>Flag(s) checked</th></tr></thead><tbody>
<tr><td><a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll</a></td><td><code>EPOLLPRI</code></td></tr>
<tr><td><a href="https://www.freebsd.org/cgi/man.cgi?query=kqueue&amp;sektion=2">kqueue</a></td><td><em>Not supported</em></td></tr>
</tbody></table>
</div></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_aio" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#172-174">source</a><h4 class="code-header">pub fn <a href="#method.is_aio" class="fnname">is_aio</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains AIO readiness.</p>
<h5 id="notes-5"><a href="#notes-5">Notes</a></h5>
<p>Method is available on all platforms, but not all platforms support AIO.</p>
<p>The table below shows what flags are checked on what OS.</p>
<div><table><thead><tr><th><a href="../struct.Poll.html#implementation-notes">OS selector</a></th><th>Flag(s) checked</th></tr></thead><tbody>
<tr><td><a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll</a></td><td><em>Not supported</em></td></tr>
<tr><td><a href="https://www.freebsd.org/cgi/man.cgi?query=kqueue&amp;sektion=2">kqueue</a><sup>1</sup></td><td><code>EVFILT_AIO</code></td></tr>
</tbody></table>
</div>
<p>1: Only supported on DragonFly BSD, FreeBSD, iOS and macOS.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_lio" class="method has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#182-184">source</a><h4 class="code-header">pub fn <a href="#method.is_lio" class="fnname">is_lio</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the event contains LIO readiness.</p>
<h5 id="notes-6"><a href="#notes-6">Notes</a></h5>
<p>Method is available on all platforms, but only FreeBSD supports LIO. On
FreeBSD this method checks the <code>EVFILT_LIO</code> flag.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-Event" class="impl has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#15">source</a><a href="#impl-Clone-for-Event" class="anchor"></a><h3 class="code-header">impl Clone for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#15">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-Event" class="impl has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#202-230">source</a><a href="#impl-Debug-for-Event" class="anchor"></a><h3 class="code-header">impl Debug for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section></summary><div class="docblock"><p>When the <a href="fmt::Formatter::alternate">alternate</a> flag is enabled this will print platform specific
details, for example the fields of the <code>kevent</code> structure on platforms that
use <code>kqueue(2)</code>. Note however that the output of this implementation is
<strong>not</strong> consider a part of the stable API.</p>
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/mio/event/event.rs.html#203-229">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-Event" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-Event" class="anchor"></a><h3 class="code-header">impl RefUnwindSafe for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section><section id="impl-Send-for-Event" class="impl has-srclink"><a href="#impl-Send-for-Event" class="anchor"></a><h3 class="code-header">impl Send for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section><section id="impl-Sync-for-Event" class="impl has-srclink"><a href="#impl-Sync-for-Event" class="anchor"></a><h3 class="code-header">impl Sync for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section><section id="impl-Unpin-for-Event" class="impl has-srclink"><a href="#impl-Unpin-for-Event" class="anchor"></a><h3 class="code-header">impl Unpin for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section><section id="impl-UnwindSafe-for-Event" class="impl has-srclink"><a href="#impl-UnwindSafe-for-Event" class="anchor"></a><h3 class="code-header">impl UnwindSafe for <a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-Event" class="impl has-srclink"><a href="#impl-Any-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-Event" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-Event" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-Event" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-Event" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; 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>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-Event" class="impl has-srclink"><a href="#impl-ToOwned-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; ToOwned for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Clone,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone_into</a>(&amp;self, target: &amp;mut T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-Event" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-Event" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-Event" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="mio" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>