Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 564935689ab5527f955e5449ded02799 > files > 5144

rust-doc-1.19.0-1.mga6.armv7hl.rpm

<!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="API documentation for the Rust `Select` struct in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Select">

    <title>std::sync::mpsc::Select - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../../main.css">
    

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
    
</head>
<body class="rustdoc struct">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        <a href='../../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
        <p class='location'>Struct Select</p><div class="block items"><ul><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../../index.html'>std</a>::<wbr><a href='../index.html'>sync</a>::<wbr><a href='index.html'>mpsc</a></p><script>window.sidebarCurrent = {name: 'Select', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
    </nav>

    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>std</a>::<wbr><a href='../index.html'>sync</a>::<wbr><a href='index.html'>mpsc</a>::<wbr><a class="struct" href=''>Select</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version '></span><span id='render-detail'>
                   <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                       [<span class='inner'>&#x2212;</span>]
                   </a>
               </span><a class='srclink' href='../../../src/std/sync/mpsc/select.rs.html#73-76' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Select { /* fields omitted */ }</pre><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>mpsc_select </code><a href="https://github.com/rust-lang/rust/issues/27800">#27800</a>)</summary><p>This implementation, while likely sufficient, is unsafe and likely to be error prone. At some point in the future this module will likely be replaced, and it is currently unknown how much API breakage that will cause. The ability to select over a number of channels will remain forever, but no guarantees beyond this are being made</p>
</details></div></div><div class='docblock'><p>The &quot;receiver set&quot; of the select interface. This structure is used to manage
a set of receivers which are being selected over.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../../../std/sync/mpsc/struct.Select.html" title="struct std::sync::mpsc::Select">Select</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/select.rs.html#119-262' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../../std/sync/mpsc/struct.Select.html" title="struct std::sync::mpsc::Select">Select</a></code></span></h4>
<div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>mpsc_select </code><a href="https://github.com/rust-lang/rust/issues/27800">#27800</a>)</summary><p>This implementation, while likely sufficient, is unsafe and likely to be error prone. At some point in the future this module will likely be replaced, and it is currently unknown how much API breakage that will cause. The ability to select over a number of channels will remain forever, but no guarantees beyond this are being made</p>
</details></div></div><div class='docblock'><p>Creates a new selection structure. This set is initially empty.</p>

<p>Usage of this struct directly can sometimes be burdensome, and usage is much easier through
the <code>select!</code> macro.</p>

<h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#<span class="op">!</span>[<span class="ident">feature</span>(<span class="ident">mpsc_select</span>)]</span>

<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>::<span class="ident">Select</span>;

<span class="kw">let</span> <span class="ident">select</span> <span class="op">=</span> <span class="ident">Select</span>::<span class="ident">new</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Bfeature(mpsc_select)%5D%0A%0Afn%20main()%20%7B%0Ause%20std%3A%3Async%3A%3Ampsc%3A%3ASelect%3B%0A%0Alet%20select%20%3D%20Select%3A%3Anew()%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.handle' class="method"><span id='handle.v' class='invisible'><code>fn <a href='#method.handle' class='fnname'>handle</a>&lt;'a, T:&nbsp;<a class="trait" href="../../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a>&gt;(&amp;'a self, rx: &amp;'a <a class="struct" href="../../../std/sync/mpsc/struct.Receiver.html" title="struct std::sync::mpsc::Receiver">Receiver</a>&lt;T&gt;) -&gt; <a class="struct" href="../../../std/sync/mpsc/struct.Handle.html" title="struct std::sync::mpsc::Handle">Handle</a>&lt;'a, T&gt;</code></span></h4>
<div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>mpsc_select </code><a href="https://github.com/rust-lang/rust/issues/27800">#27800</a>)</summary><p>This implementation, while likely sufficient, is unsafe and likely to be error prone. At some point in the future this module will likely be replaced, and it is currently unknown how much API breakage that will cause. The ability to select over a number of channels will remain forever, but no guarantees beyond this are being made</p>
</details></div></div><div class='docblock'><p>Creates a new handle into this receiver set for a new receiver. Note
that this does <em>not</em> add the receiver to the receiver set, for that you
must call the <code>add</code> method on the handle itself.</p>
</div><h4 id='method.wait' class="method"><span id='wait.v' class='invisible'><code>fn <a href='#method.wait' class='fnname'>wait</a>(&amp;self) -&gt; <a class="primitive" href="../../primitive.usize.html">usize</a></code></span></h4>
<div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>mpsc_select </code><a href="https://github.com/rust-lang/rust/issues/27800">#27800</a>)</summary><p>This implementation, while likely sufficient, is unsafe and likely to be error prone. At some point in the future this module will likely be replaced, and it is currently unknown how much API breakage that will cause. The ability to select over a number of channels will remain forever, but no guarantees beyond this are being made</p>
</details></div></div><div class='docblock'><p>Waits for an event on this receiver set. The returned value is <em>not</em> an
index, but rather an id. This id can be queried against any active
<code>Handle</code> structures (each one has an <code>id</code> method). The handle with
the matching <code>id</code> will have some sort of event available on it. The
event could either be that data is available or the corresponding
channel has been closed.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl !<a class="trait" href="../../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="struct" href="../../../std/sync/mpsc/struct.Select.html" title="struct std::sync::mpsc::Select">Select</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/select.rs.html#83' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="../../../std/ops/trait.Drop.html" title="trait std::ops::Drop">Drop</a> for <a class="struct" href="../../../std/sync/mpsc/struct.Select.html" title="struct std::sync::mpsc::Select">Select</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/select.rs.html#326-333' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><code>fn <a href='../../../std/ops/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>A method called when the value goes out of scope. <a href="../../../std/ops/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="../../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../../std/sync/mpsc/struct.Select.html" title="struct std::sync::mpsc::Select">Select</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/select.rs.html#355-359' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='../../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="../../../std/fmt/type.Result.html" title="type std::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
    <section id='search' class="content hidden"></section>

    <section class="footer"></section>

    <aside id="help" class="hidden">
        <div>
            <h1 class="hidden">Help</h1>

            <div class="shortcuts">
                <h2>Keyboard Shortcuts</h2>

                <dl>
                    <dt>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</dd>
                    <dt>+</dt>
                    <dd>Collapse/expand all sections</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code> or <code>* -> vec</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../../";
        window.currentCrate = "std";
    </script>
    <script src="../../../main.js"></script>
    <script defer src="../../../search-index.js"></script>
</body>
</html>