Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > fdedb3cf2140df9b6d419a2338ab1caa > files > 5117

rust-doc-1.25.0-1.mga6.x86_64.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 `Index` trait in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Index">

    <title>std::ops::Index - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
    
    <link rel="stylesheet" type="text/css" href="../../dark.css">
    <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
    <script src="../../storage.js"></script>
    

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

    

    <nav class="sidebar">
        <div class="sidebar-menu">&#9776;</div>
        <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'>Trait Index</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Output">Output</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.index">index</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>ops</a></p><script>window.sidebarCurrent = {name: 'Index', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
    </nav>

    <div class="theme-picker">
        <button id="theme-picker" aria-label="Pick another theme!">
            <img src="../../brush.svg" width="18" alt="Pick another theme!">
        </button>
        <div id="theme-choices"></div>
    </div>
    <script src="../../theme.js"></script>
    <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'>Trait <a href='../index.html'>std</a>::<wbr><a href='index.html'>ops</a>::<wbr><a class="trait" href=''>Index</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</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/core/ops/index.rs.html#65-73' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'><div class="docblock attributes">#[lang = "index"]
</div>pub trait Index&lt;Idx&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Idx: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span>{
    type <a href='#associatedtype.Output' class="type">Output</a>: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>;
    fn <a href='#tymethod.index' class='fnname'>index</a>(&amp;self, index: Idx) -&gt; &amp;Self::<a class="type" href="../../std/ops/trait.Index.html#associatedtype.Output" title="type std::ops::Index::Output">Output</a>;
}</pre><div class='docblock'><p>Used for indexing operations (<code>container[index]</code>) in immutable contexts.</p>
<p><code>container[index]</code> is actually syntactic sugar for <code>*container.index(index)</code>,
but only when used as an immutable value. If a mutable value is requested,
<a href="../../std/ops/trait.IndexMut.html"><code>IndexMut</code></a> is used instead. This allows nice things such as
<code>let value = v[index]</code> if the type of <code>value</code> implements <a href="../../std/marker/trait.Copy.html"><code>Copy</code></a>.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<p>The following example implements <code>Index</code> on a read-only <code>NucleotideCount</code>
container, enabling individual counts to be retrieved with index syntax.</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Index</span>;

<span class="kw">enum</span> <span class="ident">Nucleotide</span> {
    <span class="ident">A</span>,
    <span class="ident">C</span>,
    <span class="ident">G</span>,
    <span class="ident">T</span>,
}

<span class="kw">struct</span> <span class="ident">NucleotideCount</span> {
    <span class="ident">a</span>: <span class="ident">usize</span>,
    <span class="ident">c</span>: <span class="ident">usize</span>,
    <span class="ident">g</span>: <span class="ident">usize</span>,
    <span class="ident">t</span>: <span class="ident">usize</span>,
}

<span class="kw">impl</span> <span class="ident">Index</span><span class="op">&lt;</span><span class="ident">Nucleotide</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">NucleotideCount</span> {
    <span class="kw">type</span> <span class="ident">Output</span> <span class="op">=</span> <span class="ident">usize</span>;

    <span class="kw">fn</span> <span class="ident">index</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">nucleotide</span>: <span class="ident">Nucleotide</span>) <span class="op">-&gt;</span> <span class="kw-2">&amp;</span><span class="ident">usize</span> {
        <span class="kw">match</span> <span class="ident">nucleotide</span> {
            <span class="ident">Nucleotide</span>::<span class="ident">A</span> <span class="op">=&gt;</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">a</span>,
            <span class="ident">Nucleotide</span>::<span class="ident">C</span> <span class="op">=&gt;</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">c</span>,
            <span class="ident">Nucleotide</span>::<span class="ident">G</span> <span class="op">=&gt;</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">g</span>,
            <span class="ident">Nucleotide</span>::<span class="ident">T</span> <span class="op">=&gt;</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">t</span>,
        }
    }
}

<span class="kw">let</span> <span class="ident">nucleotide_count</span> <span class="op">=</span> <span class="ident">NucleotideCount</span> {<span class="ident">a</span>: <span class="number">14</span>, <span class="ident">c</span>: <span class="number">9</span>, <span class="ident">g</span>: <span class="number">10</span>, <span class="ident">t</span>: <span class="number">12</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">nucleotide_count</span>[<span class="ident">Nucleotide</span>::<span class="ident">A</span>], <span class="number">14</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">nucleotide_count</span>[<span class="ident">Nucleotide</span>::<span class="ident">C</span>], <span class="number">9</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">nucleotide_count</span>[<span class="ident">Nucleotide</span>::<span class="ident">G</span>], <span class="number">10</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">nucleotide_count</span>[<span class="ident">Nucleotide</span>::<span class="ident">T</span>], <span class="number">12</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aops%3A%3AIndex%3B%0A%0Aenum%20Nucleotide%20%7B%0A%20%20%20%20A%2C%0A%20%20%20%20C%2C%0A%20%20%20%20G%2C%0A%20%20%20%20T%2C%0A%7D%0A%0Astruct%20NucleotideCount%20%7B%0A%20%20%20%20a%3A%20usize%2C%0A%20%20%20%20c%3A%20usize%2C%0A%20%20%20%20g%3A%20usize%2C%0A%20%20%20%20t%3A%20usize%2C%0A%7D%0A%0Aimpl%20Index%3CNucleotide%3E%20for%20NucleotideCount%20%7B%0A%20%20%20%20type%20Output%20%3D%20usize%3B%0A%0A%20%20%20%20fn%20index(%26self%2C%20nucleotide%3A%20Nucleotide)%20-%3E%20%26usize%20%7B%0A%20%20%20%20%20%20%20%20match%20nucleotide%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Nucleotide%3A%3AA%20%3D%3E%20%26self.a%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20Nucleotide%3A%3AC%20%3D%3E%20%26self.c%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20Nucleotide%3A%3AG%20%3D%3E%20%26self.g%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20Nucleotide%3A%3AT%20%3D%3E%20%26self.t%2C%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%0Alet%20nucleotide_count%20%3D%20NucleotideCount%20%7Ba%3A%2014%2C%20c%3A%209%2C%20g%3A%2010%2C%20t%3A%2012%7D%3B%0Aassert_eq!(nucleotide_count%5BNucleotide%3A%3AA%5D%2C%2014)%3B%0Aassert_eq!(nucleotide_count%5BNucleotide%3A%3AC%5D%2C%209)%3B%0Aassert_eq!(nucleotide_count%5BNucleotide%3A%3AG%5D%2C%2010)%3B%0Aassert_eq!(nucleotide_count%5BNucleotide%3A%3AT%5D%2C%2012)%3B%0A%7D">Run</a></pre>
</div>
            <h2 id='associated-types' class='small-section-header'>
              Associated Types<a href='#associated-types' class='anchor'></a>
            </h2>
            <div class='methods'>
        <h3 id='associatedtype.Output' class='method'><span id='Output.t' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a>: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a></code></span></h3><div class='docblock'><p>The returned type after indexing.</p>
</div></div>
            <h2 id='required-methods' class='small-section-header'>
              Required Methods<a href='#required-methods' class='anchor'></a>
            </h2>
            <div class='methods'>
        <h3 id='tymethod.index' class='method'><span id='index.v' class='invisible'><code>fn <a href='#tymethod.index' class='fnname'>index</a>(&amp;self, index: Idx) -&gt; &amp;Self::<a class="type" href="../../std/ops/trait.Index.html#associatedtype.Output" title="type std::ops::Index::Output">Output</a></code></span></h3><div class='docblock'><p>Performs the indexing (<code>container[index]</code>) operation.</p>
</div></div>
        <h2 id='implementors' class='small-section-header'>
          Implementors<a href='#implementors' class='anchor'></a>
        </h2>
        <ul class='item-list' id='implementors-list'>
    <li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#1785-1792' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeInclusive.html" title="struct std::ops::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="primitive" href="../primitive.str.html">str</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/slice/mod.rs.html#760-769' title='goto source code'>[src]</a></div><code>impl&lt;T, I&gt; Index&lt;I&gt; for <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/slice/trait.SliceIndex.html" title="trait std::slice::SliceIndex">SliceIndex</a>&lt;<a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt;,&nbsp;</span><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = &lt;I as <a class="trait" href="../../std/slice/trait.SliceIndex.html" title="trait std::slice::SliceIndex">SliceIndex</a>&lt;<a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt;&gt;::<a class="type" href="../../std/slice/trait.SliceIndex.html#associatedtype.Output" title="type std::slice::SliceIndex::Output">Output</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#1729-1736' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeFrom.html" title="struct std::ops::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="primitive" href="../primitive.str.html">str</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#1699-1706' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeTo.html" title="struct std::ops::RangeTo">RangeTo</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="primitive" href="../primitive.str.html">str</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#1797-1804' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeToInclusive.html" title="struct std::ops::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="primitive" href="../primitive.str.html">str</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#1759-1766' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeFull.html" title="struct std::ops::RangeFull">RangeFull</a>&gt; for <a class="primitive" href="../primitive.str.html">str</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#1662-1668' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.Range.html" title="struct std::ops::Range">Range</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="primitive" href="../primitive.str.html">str</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1853-1860' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeTo.html" title="struct std::ops::RangeTo">RangeTo</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1611-1618' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="struct" href="../../std/ops/struct.RangeInclusive.html" title="struct std::ops::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1578-1585' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="struct" href="../../std/ops/struct.RangeTo.html" title="struct std::ops::RangeTo">RangeTo</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1889-1896' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeToInclusive.html" title="struct std::ops::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1622-1629' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="struct" href="../../std/ops/struct.RangeToInclusive.html" title="struct std::ops::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1871-1878' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeFull.html" title="struct std::ops::RangeFull">RangeFull</a>&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1545-1553' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = T;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1880-1887' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeInclusive.html" title="struct std::ops::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1844-1851' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.Range.html" title="struct std::ops::Range">Range</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/btree/map.rs.html#1745-1760' title='goto source code'>[src]</a></div><code>impl&lt;'a, K, Q, V&gt; Index&lt;<a class="primitive" href="../primitive.reference.html">&amp;'a </a>Q&gt; for <a class="struct" href="../../std/collections/btree_map/struct.BTreeMap.html" title="struct std::collections::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = V;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1600-1607' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="struct" href="../../std/ops/struct.RangeFull.html" title="struct std::ops::RangeFull">RangeFull</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1567-1574' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="struct" href="../../std/ops/struct.Range.html" title="struct std::ops::Range">Range</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec.rs.html#1589-1596' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Index&lt;<a class="struct" href="../../std/ops/struct.RangeFrom.html" title="struct std::ops::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/vec_deque.rs.html#2361-2368' title='goto source code'>[src]</a></div><code>impl&lt;A&gt; Index&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt; for <a class="struct" href="../../std/collections/vec_deque/struct.VecDeque.html" title="struct std::collections::vec_deque::VecDeque">VecDeque</a>&lt;A&gt;<span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = A;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1862-1869' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeFrom.html" title="struct std::ops::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="../primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="../primitive.str.html">str</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/collections/hash/map.rs.html#1380-1396' title='goto source code'>[src]</a></div><code>impl&lt;'a, K, Q:&nbsp;?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, V, S&gt; Index&lt;<a class="primitive" href="../primitive.reference.html">&amp;'a </a>Q&gt; for <a class="struct" href="../../std/collections/struct.HashMap.html" title="struct std::collections::HashMap">HashMap</a>&lt;K, V, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> + <a class="trait" href="../../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a> + <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> + <a class="trait" href="../../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../std/hash/trait.BuildHasher.html" title="trait std::hash::BuildHasher">BuildHasher</a>,&nbsp;</span><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = V;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/ffi/c_str.rs.html#1210-1217' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeFull.html" title="struct std::ops::RangeFull">RangeFull</a>&gt; for <a class="struct" href="../../std/ffi/struct.CString.html" title="struct std::ffi::CString">CString</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/ffi/struct.CStr.html" title="struct std::ffi::CStr">CStr</a>;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/ffi/os_str.rs.html#333-340' title='goto source code'>[src]</a></div><code>impl Index&lt;<a class="struct" href="../../std/ops/struct.RangeFull.html" title="struct std::ops::RangeFull">RangeFull</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a><span class="where fmt-newline">  type <a href='#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>;</span></code></li>
</ul><script type="text/javascript" async
                         src="../../implementors/core/ops/index/trait.Index.js">
                 </script></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><kbd>?</kbd></dt>
                    <dd>Show this help dialog</dd>
                    <dt><kbd>S</kbd></dt>
                    <dd>Focus the search field</dd>
                    <dt><kbd>↑</kbd></dt>
                    <dd>Move up in search results</dd>
                    <dt><kbd>↓</kbd></dt>
                    <dd>Move down in search results</dd>
                    <dt><kbd>↹</kbd></dt>
                    <dd>Switch tab</dd>
                    <dt><kbd>&#9166;</kbd></dt>
                    <dd>Go to active search result</dd>
                    <dt><kbd>+</kbd></dt>
                    <dd>Expand all sections</dd>
                    <dt><kbd>-</kbd></dt>
                    <dd>Collapse 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>