Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

1
target/doc/mio/all.html Normal file
View File

@@ -0,0 +1 @@
<!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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">All</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>List of all items</h1><rustdoc-toolbar></rustdoc-toolbar></div><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.Interest.html">Interest</a></li><li><a href="struct.Poll.html">Poll</a></li><li><a href="struct.Registry.html">Registry</a></li><li><a href="struct.Token.html">Token</a></li><li><a href="struct.Waker.html">Waker</a></li><li><a href="event/struct.Event.html">event::Event</a></li><li><a href="event/struct.Events.html">event::Events</a></li><li><a href="event/struct.Iter.html">event::Iter</a></li><li><a href="net/struct.TcpListener.html">net::TcpListener</a></li><li><a href="net/struct.TcpStream.html">net::TcpStream</a></li><li><a href="net/struct.UdpSocket.html">net::UdpSocket</a></li><li><a href="net/struct.UnixDatagram.html">net::UnixDatagram</a></li><li><a href="net/struct.UnixListener.html">net::UnixListener</a></li><li><a href="net/struct.UnixStream.html">net::UnixStream</a></li><li><a href="unix/struct.SourceFd.html">unix::SourceFd</a></li><li><a href="unix/pipe/struct.Receiver.html">unix::pipe::Receiver</a></li><li><a href="unix/pipe/struct.Sender.html">unix::pipe::Sender</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="event/trait.Source.html">event::Source</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="unix/pipe/fn.new.html">unix::pipe::new</a></li></ul></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../mio/event/struct.Event.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../mio/event/struct.Event.html">../../../mio/event/struct.Event.html</a>...</p>
<script>location.replace("../../../mio/event/struct.Event.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../mio/event/struct.Events.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../mio/event/struct.Events.html">../../../mio/event/struct.Events.html</a>...</p>
<script>location.replace("../../../mio/event/struct.Events.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../mio/event/struct.Iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../mio/event/struct.Iter.html">../../../mio/event/struct.Iter.html</a>...</p>
<script>location.replace("../../../mio/event/struct.Iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,2 @@
<!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="Readiness event types and utilities."><title>mio::event - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module event</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module event</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate mio</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mio</a></div><h1>Module <span>event</span>&nbsp;<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/mio/event/mod.rs.html#1-10">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Readiness event types and utilities.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Event.html" title="struct mio::event::Event">Event</a></dt><dd>A readiness event.</dd><dt><a class="struct" href="struct.Events.html" title="struct mio::event::Events">Events</a></dt><dd>A collection of readiness events.</dd><dt><a class="struct" href="struct.Iter.html" title="struct mio::event::Iter">Iter</a></dt><dd><a href="struct.Events.html"><code>Events</code></a> iterator.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Source.html" title="trait mio::event::Source">Source</a></dt><dd>An event source that may be registered with <a href="../struct.Registry.html"><code>Registry</code></a>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Event","Events","Iter"],"trait":["Source"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../mio/event/trait.Source.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../mio/event/trait.Source.html">../../../mio/event/trait.Source.html</a>...</p>
<script>location.replace("../../../mio/event/trait.Source.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
<!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="Mios optional features."><title>mio::features - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module features</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module features</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#mios-optional-features" title="Mios optional features.">Mios optional features.</a><ul><li><a href="#os-poll-enabled" title="`os-poll` (enabled)"><code>os-poll</code> (enabled)</a></li><li><a href="#os-ext-enabled" title="`os-ext` (enabled)"><code>os-ext</code> (enabled)</a></li><li><a href="#network-types-enabled" title="Network types (enabled)">Network types (enabled)</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate mio</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mio</a></div><h1>Module <span>features</span>&nbsp;<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/mio/lib.rs.html#107">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="mios-optional-features"><a class="doc-anchor" href="#mios-optional-features">§</a>Mios optional features.</h2>
<p>This document describes the available features in Mio.</p>
<h3 id="os-poll-enabled"><a class="doc-anchor" href="#os-poll-enabled">§</a><code>os-poll</code> (enabled)</h3>
<p>Mio by default provides only a shell implementation that <code>panic!</code>s the
moment it is actually run. To run it requires OS support, this is
enabled by activating the <code>os-poll</code> feature.</p>
<p>This makes <code>Poll</code>, <code>Registry</code> and <code>Waker</code> functional.</p>
<h3 id="os-ext-enabled"><a class="doc-anchor" href="#os-ext-enabled">§</a><code>os-ext</code> (enabled)</h3>
<p><code>os-ext</code> enables additional OS specific facilities. These facilities can
be found in the <code>unix</code> and <code>windows</code> module.</p>
<h3 id="network-types-enabled"><a class="doc-anchor" href="#network-types-enabled">§</a>Network types (enabled)</h3>
<p>The <code>net</code> feature enables networking primitives in the <code>net</code> module.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {};

View File

@@ -0,0 +1,84 @@
<!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="Getting started guide."><title>mio::guide - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module guide</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module guide</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#getting-started-guide" title="Getting started guide.">Getting started guide.</a><ul><li><a href="#1-creating-a-poll-instance" title="1. Creating a `Poll` instance">1. Creating a <code>Poll</code> instance</a></li><li><a href="#2-registering-event-source" title="2. Registering event source">2. Registering event source</a></li><li><a href="#3-creating-the-event-loop" title="3. Creating the event loop">3. Creating the event loop</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate mio</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mio</a></div><h1>Module <span>guide</span>&nbsp;<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/mio/lib.rs.html#133">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="getting-started-guide"><a class="doc-anchor" href="#getting-started-guide">§</a>Getting started guide.</h2>
<p>In this guide well do the following:</p>
<ol>
<li>Create a <a href="../struct.Poll.html"><code>Poll</code></a> instance (and learn what it is).</li>
<li>Register an <a href="../event/trait.Source.html">event source</a>.</li>
<li>Create an event loop.</li>
</ol>
<p>At the end youll have a very small (but quick) TCP server that accepts
connections and then drops (disconnects) them.</p>
<h3 id="1-creating-a-poll-instance"><a class="doc-anchor" href="#1-creating-a-poll-instance">§</a>1. Creating a <code>Poll</code> instance</h3>
<p>Using Mio starts by creating a <a href="../struct.Poll.html"><code>Poll</code></a> instance, which monitors events
from the OS and puts them into <a href="../event/struct.Events.html"><code>Events</code></a>. This allows us to execute I/O
operations based on what operations are ready.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// `Poll` allows for polling of readiness events.
</span><span class="kw">let </span>poll = Poll::new()<span class="question-mark">?</span>;
<span class="comment">// `Events` is collection of readiness `Event`s and can be filled by
// calling `Poll::poll`.
</span><span class="kw">let </span>events = Events::with_capacity(<span class="number">128</span>);</code></pre></div>
<p>For example if were using a <a href="../net/struct.TcpListener.html"><code>TcpListener</code></a>, well only want to
attempt to accept an incoming connection <em>iff</em> any connections are
queued and ready to be accepted. We dont want to waste our time if no
connections are ready.</p>
<h3 id="2-registering-event-source"><a class="doc-anchor" href="#2-registering-event-source">§</a>2. Registering event source</h3>
<p>After weve created a <a href="../struct.Poll.html"><code>Poll</code></a> instance that monitors events from the OS
for us, we need to provide it with a source of events. This is done by
registering an <a href="../event/trait.Source.html">event source</a>. As the name “event source” suggests it is
a source of events which can be polled using a <code>Poll</code> instance. On Unix
systems this is usually a file descriptor, or a socket/handle on
Windows.</p>
<p>In the example below well use a <a href="../net/struct.TcpListener.html"><code>TcpListener</code></a> for which well receive
an event (from <a href="../struct.Poll.html"><code>Poll</code></a>) once a connection is ready to be accepted.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Create a `TcpListener`, binding it to `address`.
</span><span class="kw">let </span><span class="kw-2">mut </span>listener = TcpListener::bind(address)<span class="question-mark">?</span>;
<span class="comment">// Next we register it with `Poll` to receive events for it. The `SERVER`
// `Token` is used to determine that we received an event for the listener
// later on.
</span><span class="kw">const </span>SERVER: Token = Token(<span class="number">0</span>);
poll.registry().register(<span class="kw-2">&amp;mut </span>listener, SERVER, Interest::READABLE)<span class="question-mark">?</span>;</code></pre></div>
<p>Multiple event sources can be <a href="../struct.Registry.html#method.register">registered</a> (concurrently), so we can
monitor multiple sources at a time.</p>
<h3 id="3-creating-the-event-loop"><a class="doc-anchor" href="#3-creating-the-event-loop">§</a>3. Creating the event loop</h3>
<p>After weve created a <a href="../struct.Poll.html"><code>Poll</code></a> instance and registered one or more
<a href="../event/trait.Source.html">event sources</a> with it, we can <a href="../struct.Poll.html#method.poll">poll</a> it for events. Polling for events
is simple, we need a container to store the events: <a href="../event/struct.Events.html"><code>Events</code></a> and need
to do something based on the polled events (this part is up to you, we
cant do it all!). If we do this in a loop weve got ourselves an event
loop.</p>
<p>The example below shows the event loop in action, completing our small
TCP server.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Start our event loop.
</span><span class="kw">loop </span>{
<span class="comment">// Poll the OS for events, waiting at most 100 milliseconds.
</span>poll.poll(<span class="kw-2">&amp;mut </span>events, <span class="prelude-val">Some</span>(Duration::from_millis(<span class="number">100</span>)))<span class="question-mark">?</span>;
<span class="comment">// Process each event.
</span><span class="kw">for </span>event <span class="kw">in </span>events.iter() {
<span class="comment">// We can use the token we previously provided to `register` to
// determine for which type the event is.
</span><span class="kw">match </span>event.token() {
SERVER =&gt; <span class="kw">loop </span>{
<span class="comment">// One or more connections are ready, so we'll attempt to
// accept them (in a loop).
</span><span class="kw">match </span>listener.accept() {
<span class="prelude-val">Ok</span>((connection, address)) =&gt; {
<span class="macro">println!</span>(<span class="string">"Got a connection from: {}"</span>, address);
},
<span class="comment">// A "would block error" is returned if the operation
// is not ready, so we'll stop trying to accept
// connections.
</span><span class="prelude-val">Err</span>(<span class="kw-2">ref </span>err) <span class="kw">if </span>would_block(err) =&gt; <span class="kw">break</span>,
<span class="prelude-val">Err</span>(err) =&gt; <span class="kw">return </span><span class="prelude-val">Err</span>(err),
}
}
}
}
}
<span class="kw">fn </span>would_block(err: <span class="kw-2">&amp;</span>io::Error) -&gt; bool {
err.kind() == io::ErrorKind::WouldBlock
}</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {};

15
target/doc/mio/index.html Normal file
View File

@@ -0,0 +1,15 @@
<!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="Mio is a fast, low-level I/O library for Rust focusing on non-blocking APIs and event notification for building high performance I/O apps with as little overhead as possible over the OS abstractions."><title>mio - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate mio</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#usage" title="Usage">Usage</a><ul><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#guide" title="Guide">Guide</a></li><li><a href="#available-features" title="Available features">Available features</a></li></ul></li></ul><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>mio</span>&nbsp;<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/mio/lib.rs.html#1-277">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Mio is a fast, low-level I/O library for Rust focusing on non-blocking APIs
and event notification for building high performance I/O apps with as little
overhead as possible over the OS abstractions.</p>
<h2 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h2>
<p>Using Mio starts by creating a <a href="../mio/struct.Poll.html"><code>Poll</code></a>, which reads events from the OS and
puts them into <a href="../mio/event/struct.Events.html"><code>Events</code></a>. You can handle I/O events from the OS with it.</p>
<p>For more detail, see <a href="../mio/struct.Poll.html"><code>Poll</code></a>.</p>
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
<p>Examples can be found in the <code>examples</code> directory of the source code, or <a href="https://github.com/tokio-rs/mio/tree/master/examples">on
GitHub</a>.</p>
<h3 id="guide"><a class="doc-anchor" href="#guide">§</a>Guide</h3>
<p>A getting started guide is available in the <a href="guide/index.html" title="mod mio::guide"><code>guide</code></a> module.</p>
<h3 id="available-features"><a class="doc-anchor" href="#available-features">§</a>Available features</h3>
<p>The available features are described in the <a href="features/index.html" title="mod mio::features"><code>features</code></a> module.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.Events"><code>pub use event::<a class="struct" href="event/struct.Events.html" title="struct mio::event::Events">Events</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="event/index.html" title="mod mio::event">event</a></dt><dd>Readiness event types and utilities.</dd><dt><a class="mod" href="features/index.html" title="mod mio::features">features</a></dt><dd>Mios optional features.</dd><dt><a class="mod" href="guide/index.html" title="mod mio::guide">guide</a></dt><dd>Getting started guide.</dd><dt><a class="mod" href="net/index.html" title="mod mio::net">net</a></dt><dd>Networking primitives.</dd><dt><a class="mod" href="unix/index.html" title="mod mio::unix">unix</a></dt><dd>Unix only extensions.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Interest.html" title="struct mio::Interest">Interest</a></dt><dd>Interest used in registering.</dd><dt><a class="struct" href="struct.Poll.html" title="struct mio::Poll">Poll</a></dt><dd>Polls for readiness events on all registered values.</dd><dt><a class="struct" href="struct.Registry.html" title="struct mio::Registry">Registry</a></dt><dd>Registers I/O resources.</dd><dt><a class="struct" href="struct.Token.html" title="struct mio::Token">Token</a></dt><dd>Associates readiness events with <a href="./event/trait.Source.html"><code>event::Source</code></a>s.</dd><dt><a class="struct" href="struct.Waker.html" title="struct mio::Waker">Waker</a></dt><dd>Waker allows cross-thread waking of <a href="struct.Poll.html"><code>Poll</code></a>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../mio/struct.Interest.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../mio/struct.Interest.html">../../mio/struct.Interest.html</a>...</p>
<script>location.replace("../../mio/struct.Interest.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,23 @@
<!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="Networking primitives."><title>mio::net - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module net</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module net</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#notes" title="Notes">Notes</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate mio</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mio</a></div><h1>Module <span>net</span>&nbsp;<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/mio/net/mod.rs.html#1-39">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Networking primitives.</p>
<p>The types provided in this module are non-blocking by default and are
designed to be portable across all supported Mio platforms. As long as the
<a href="../struct.Poll.html#portability">portability guidelines</a> are followed, the behavior should be identical no
matter the target platform.</p>
<h2 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h2>
<p>When using a datagram based socket, i.e. <a href="struct.UdpSocket.html" title="struct mio::net::UdpSocket"><code>UdpSocket</code></a> or <a href="struct.UnixDatagram.html" title="struct mio::net::UnixDatagram"><code>UnixDatagram</code></a>,
its only possible to receive a packet once. This means that if you provide a
buffer that is too small you wont be able to receive the data anymore. How
OSs deal with this situation is different for each OS:</p>
<ul>
<li>Unixes, such as Linux, FreeBSD and macOS, will simply fill the buffer and
return the amount of bytes written. This means that if the returned value
is equal to the size of the buffer it may have only written a part of the
packet (or the packet has the same size as the buffer).</li>
<li>Windows returns an <code>WSAEMSGSIZE</code> error.</li>
</ul>
<p>Mio does not change the value (either ok or error) returned by the OS, its
up to the user to handle this. How to deal with these differences is still up
for debate, specifically in
<a href="https://github.com/rust-lang/rust/issues/55794">https://github.com/rust-lang/rust/issues/55794</a>. The best advice we can
give is to always call receive with a large enough buffer.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.TcpListener.html" title="struct mio::net::TcpListener">TcpListener</a></dt><dd>A structure representing a socket server</dd><dt><a class="struct" href="struct.TcpStream.html" title="struct mio::net::TcpStream">TcpStream</a></dt><dd>A non-blocking TCP stream between a local socket and a remote socket.</dd><dt><a class="struct" href="struct.UdpSocket.html" title="struct mio::net::UdpSocket">UdpSocket</a></dt><dd>A User Datagram Protocol socket.</dd><dt><a class="struct" href="struct.UnixDatagram.html" title="struct mio::net::UnixDatagram">Unix<wbr>Datagram</a></dt><dd>A Unix datagram socket.</dd><dt><a class="struct" href="struct.UnixListener.html" title="struct mio::net::UnixListener">Unix<wbr>Listener</a></dt><dd>A non-blocking Unix domain socket server.</dd><dt><a class="struct" href="struct.UnixStream.html" title="struct mio::net::UnixStream">Unix<wbr>Stream</a></dt><dd>A non-blocking Unix stream socket.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["TcpListener","TcpStream","UdpSocket","UnixDatagram","UnixListener","UnixStream"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/net/struct.TcpListener.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/net/struct.TcpListener.html">../../../../mio/net/struct.TcpListener.html</a>...</p>
<script>location.replace("../../../../mio/net/struct.TcpListener.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/net/struct.TcpStream.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/net/struct.TcpStream.html">../../../../mio/net/struct.TcpStream.html</a>...</p>
<script>location.replace("../../../../mio/net/struct.TcpStream.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../mio/net/struct.UdpSocket.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../mio/net/struct.UdpSocket.html">../../../mio/net/struct.UdpSocket.html</a>...</p>
<script>location.replace("../../../mio/net/struct.UdpSocket.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/net/struct.UnixDatagram.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/net/struct.UnixDatagram.html">../../../../mio/net/struct.UnixDatagram.html</a>...</p>
<script>location.replace("../../../../mio/net/struct.UnixDatagram.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/net/struct.UnixListener.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/net/struct.UnixListener.html">../../../../mio/net/struct.UnixListener.html</a>...</p>
<script>location.replace("../../../../mio/net/struct.UnixListener.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/net/struct.UnixStream.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/net/struct.UnixStream.html">../../../../mio/net/struct.UnixStream.html</a>...</p>
<script>location.replace("../../../../mio/net/struct.UnixStream.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../mio/struct.Poll.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../mio/struct.Poll.html">../../mio/struct.Poll.html</a>...</p>
<script>location.replace("../../mio/struct.Poll.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../mio/struct.Registry.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../mio/struct.Registry.html">../../mio/struct.Registry.html</a>...</p>
<script>location.replace("../../mio/struct.Registry.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["event","features","guide","net","unix"],"struct":["Interest","Poll","Registry","Token","Waker"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/unix/pipe/fn.new.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/unix/pipe/fn.new.html">../../../../mio/unix/pipe/fn.new.html</a>...</p>
<script>location.replace("../../../../mio/unix/pipe/fn.new.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/unix/pipe/struct.Receiver.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/unix/pipe/struct.Receiver.html">../../../../mio/unix/pipe/struct.Receiver.html</a>...</p>
<script>location.replace("../../../../mio/unix/pipe/struct.Receiver.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/unix/pipe/struct.Sender.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/unix/pipe/struct.Sender.html">../../../../mio/unix/pipe/struct.Sender.html</a>...</p>
<script>location.replace("../../../../mio/unix/pipe/struct.Sender.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../mio/unix/struct.SourceFd.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../mio/unix/struct.SourceFd.html">../../../../mio/unix/struct.SourceFd.html</a>...</p>
<script>location.replace("../../../../mio/unix/struct.SourceFd.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../mio/struct.Token.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../mio/struct.Token.html">../../mio/struct.Token.html</a>...</p>
<script>location.replace("../../mio/struct.Token.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,2 @@
<!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="Unix only extensions."><title>mio::unix - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module unix</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module unix</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate mio</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mio</a></div><h1>Module <span>unix</span>&nbsp;<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/mio/lib.rs.html#77">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unix only extensions.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="pipe/index.html" title="mod mio::unix::pipe">pipe</a></dt><dd>Unix pipe.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.SourceFd.html" title="struct mio::unix::SourceFd">Source<wbr>Fd</a></dt><dd>Adapter for <a href="https://doc.rust-lang.org/1.93.1/std/os/fd/raw/type.RawFd.html" title="type std::os::fd::raw::RawFd"><code>RawFd</code></a> providing an <a href="../event/trait.Source.html"><code>event::Source</code></a> implementation.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,96 @@
<!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="Create a new non-blocking Unix pipe."><title>new in mio::unix::pipe - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">new</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">new</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#events" title="Events">Events</a></li><li><a href="#deregistering" title="Deregistering">Deregistering</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In mio::<wbr>unix::<wbr>pipe</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">mio</a>::<wbr><a href="../index.html">unix</a>::<wbr><a href="index.html">pipe</a></div><h1>Function <span class="fn">new</span>&nbsp;<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/mio/sys/unix/pipe.rs.html#209-215">Source</a> </span></div><pre class="rust item-decl"><code>pub fn new() -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;(<a class="struct" href="struct.Sender.html" title="struct mio::unix::pipe::Sender">Sender</a>, <a class="struct" href="struct.Receiver.html" title="struct mio::unix::pipe::Receiver">Receiver</a>)&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new non-blocking Unix pipe.</p>
<p>This is a wrapper around Unixs <a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html"><code>pipe(2)</code></a> system call and can be used as
inter-process or thread communication channel.</p>
<p>This channel may be created before forking the process and then one end used
in each process, e.g. the parent process has the sending end to send command
to the child process.</p>
<h2 id="events"><a class="doc-anchor" href="#events">§</a>Events</h2>
<p>The <a href="struct.Sender.html" title="struct mio::unix::pipe::Sender"><code>Sender</code></a> can be registered with <a href="../../struct.Interest.html#associatedconstant.WRITABLE" title="associated constant mio::Interest::WRITABLE"><code>WRITABLE</code></a> interest to receive
<a href="../../event/struct.Event.html#method.is_writable" title="method mio::event::Event::is_writable">writable events</a>, the <a href="struct.Receiver.html" title="struct mio::unix::pipe::Receiver"><code>Receiver</code></a> with <a href="../../struct.Interest.html#associatedconstant.READABLE" title="associated constant mio::Interest::READABLE"><code>READABLE</code></a> interest. Once data is
written to the <code>Sender</code> the <code>Receiver</code> will receive an <a href="../../event/struct.Event.html#method.is_readable" title="method mio::event::Event::is_readable">readable event</a>.</p>
<p>In addition to those events, events will also be generated if the other side
is dropped. To check if the <code>Sender</code> is dropped youll need to check
<a href="../../event/struct.Event.html#method.is_read_closed" title="method mio::event::Event::is_read_closed"><code>is_read_closed</code></a> on events for the <code>Receiver</code>, if it returns true the
<code>Sender</code> is dropped. On the <code>Sender</code> end check <a href="../../event/struct.Event.html#method.is_write_closed" title="method mio::event::Event::is_write_closed"><code>is_write_closed</code></a>, if it
returns true the <code>Receiver</code> was dropped. Also see the second example below.</p>
<h2 id="deregistering"><a class="doc-anchor" href="#deregistering">§</a>Deregistering</h2>
<p>Both <code>Sender</code> and <code>Receiver</code> will deregister themselves when dropped,
<strong>iff</strong> the file descriptors are not duplicated (via <a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html"><code>dup(2)</code></a>).</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>Simple example that writes data into the sending end and read it from the
receiving end.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io::{<span class="self">self</span>, Read, Write};
<span class="kw">use </span>mio::{Poll, Events, Interest, Token};
<span class="kw">use </span>mio::unix::pipe;
<span class="comment">// Unique tokens for the two ends of the channel.
</span><span class="kw">const </span>PIPE_RECV: Token = Token(<span class="number">0</span>);
<span class="kw">const </span>PIPE_SEND: Token = Token(<span class="number">1</span>);
<span class="comment">// Create our `Poll` instance and the `Events` container.
</span><span class="kw">let </span><span class="kw-2">mut </span>poll = Poll::new()<span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>events = Events::with_capacity(<span class="number">8</span>);
<span class="comment">// Create a new pipe.
</span><span class="kw">let </span>(<span class="kw-2">mut </span>sender, <span class="kw-2">mut </span>receiver) = pipe::new()<span class="question-mark">?</span>;
<span class="comment">// Register both ends of the channel.
</span>poll.registry().register(<span class="kw-2">&amp;mut </span>receiver, PIPE_RECV, Interest::READABLE)<span class="question-mark">?</span>;
poll.registry().register(<span class="kw-2">&amp;mut </span>sender, PIPE_SEND, Interest::WRITABLE)<span class="question-mark">?</span>;
<span class="kw">const </span>MSG: <span class="kw-2">&amp;</span>[u8; <span class="number">11</span>] = <span class="string">b"Hello world"</span>;
<span class="kw">loop </span>{
poll.poll(<span class="kw-2">&amp;mut </span>events, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
<span class="kw">for </span>event <span class="kw">in </span>events.iter() {
<span class="kw">match </span>event.token() {
PIPE_SEND =&gt; sender.write(MSG)
.and_then(|n| <span class="kw">if </span><span class="macro">n !</span>= MSG.len() {
<span class="comment">// We'll consider a short write an error in this
// example. NOTE: we can't use `write_all` with
// non-blocking I/O.
</span><span class="prelude-val">Err</span>(io::ErrorKind::WriteZero.into())
} <span class="kw">else </span>{
<span class="prelude-val">Ok</span>(())
})<span class="question-mark">?</span>,
PIPE_RECV =&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>buf = [<span class="number">0</span>; <span class="number">11</span>];
<span class="kw">let </span>n = receiver.read(<span class="kw-2">&amp;mut </span>buf)<span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"received: {:?}"</span>, <span class="kw-2">&amp;</span>buf[<span class="number">0</span>..n]);
<span class="macro">assert_eq!</span>(n, MSG.len());
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>buf, <span class="kw-2">&amp;*</span>MSG);
<span class="kw">return </span><span class="prelude-val">Ok</span>(());
},
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
}
}
}</code></pre></div>
<p>Example that receives an event once the <code>Sender</code> is dropped.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Same setup as in the example above.
</span><span class="kw">let </span><span class="kw-2">mut </span>poll = Poll::new()<span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>events = Events::with_capacity(<span class="number">8</span>);
<span class="kw">let </span>(<span class="kw-2">mut </span>sender, <span class="kw-2">mut </span>receiver) = pipe::new()<span class="question-mark">?</span>;
poll.registry().register(<span class="kw-2">&amp;mut </span>receiver, PIPE_RECV, Interest::READABLE)<span class="question-mark">?</span>;
poll.registry().register(<span class="kw-2">&amp;mut </span>sender, PIPE_SEND, Interest::WRITABLE)<span class="question-mark">?</span>;
<span class="comment">// Drop the sender.
</span>drop(sender);
poll.poll(<span class="kw-2">&amp;mut </span>events, <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
<span class="kw">for </span>event <span class="kw">in </span>events.iter() {
<span class="kw">match </span>event.token() {
PIPE_RECV <span class="kw">if </span>event.is_read_closed() =&gt; {
<span class="comment">// Detected that the sender was dropped.
</span><span class="macro">println!</span>(<span class="string">"Sender dropped!"</span>);
<span class="kw">return </span><span class="prelude-val">Ok</span>(());
},
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
}
}</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,3 @@
<!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="Unix pipe."><title>mio::unix::pipe - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module pipe</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../mio/index.html">mio</a><span class="version">1.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module pipe</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In mio::<wbr>unix</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">mio</a>::<wbr><a href="../index.html">unix</a></div><h1>Module <span>pipe</span>&nbsp;<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/mio/lib.rs.html#80">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unix pipe.</p>
<p>See the <a href="fn.new.html" title="fn mio::unix::pipe::new"><code>new</code></a> function for documentation.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Receiver.html" title="struct mio::unix::pipe::Receiver">Receiver</a></dt><dd>Receiving end of an Unix pipe.</dd><dt><a class="struct" href="struct.Sender.html" title="struct mio::unix::pipe::Sender">Sender</a></dt><dd>Sending end of an Unix pipe.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.new.html" title="fn mio::unix::pipe::new">new</a></dt><dd>Create a new non-blocking Unix pipe.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["new"],"struct":["Receiver","Sender"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["pipe"],"struct":["SourceFd"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../mio/struct.Waker.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../mio/struct.Waker.html">../../mio/struct.Waker.html</a>...</p>
<script>location.replace("../../mio/struct.Waker.html" + location.search + location.hash);</script>
</body>
</html>