struct.SegQueue.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `SegQueue` struct in crate `crossbeam`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, SegQueue">
  9. <title>crossbeam::sync::SegQueue - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
  14. <script src="../../storage.js"></script>
  15. </head>
  16. <body class="rustdoc struct">
  17. <!--[if lte IE 8]>
  18. <div class="warning">
  19. This old browser is unsupported and will most likely display funky
  20. things.
  21. </div>
  22. <![endif]-->
  23. <nav class="sidebar">
  24. <div class="sidebar-menu">&#9776;</div>
  25. <p class='location'>Struct SegQueue</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.push">push</a><a href="#method.is_empty">is_empty</a><a href="#method.try_pop">try_pop</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Drop">Drop</a></div></div><p class='location'><a href='../index.html'>crossbeam</a>::<wbr><a href='index.html'>sync</a></p><script>window.sidebarCurrent = {name: 'SegQueue', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
  26. </nav>
  27. <div class="theme-picker">
  28. <button id="theme-picker" aria-label="Pick another theme!">
  29. <img src="../../brush.svg" width="18" alt="Pick another theme!">
  30. </button>
  31. <div id="theme-choices"></div>
  32. </div>
  33. <script src="../../theme.js"></script>
  34. <nav class="sub">
  35. <form class="search-form js-only">
  36. <div class="search-container">
  37. <input class="search-input" name="search"
  38. autocomplete="off"
  39. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  40. type="search">
  41. </div>
  42. </form>
  43. </nav>
  44. <section id='main' class="content">
  45. <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>crossbeam</a>::<wbr><a href='index.html'>sync</a>::<wbr><a class="struct" href=''>SegQueue</a></span><span class='out-of-band'><span id='render-detail'>
  46. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  47. [<span class='inner'>&#x2212;</span>]
  48. </a>
  49. </span><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#17-20' title='goto source code'>[src]</a></span></h1>
  50. <pre class='rust struct'>pub struct SegQueue&lt;T&gt; { /* fields omitted */ }</pre><div class='docblock'><p>A Michael-Scott queue that allocates &quot;segments&quot; (arrays of nodes)
  51. for efficiency.</p>
  52. <p>Usable with any number of producers and consumers.</p>
  53. </div>
  54. <h2 id='methods' class='small-section-header'>
  55. Methods<a href='#methods' class='anchor'></a>
  56. </h2>
  57. <h3 id='impl' class='impl'><span class='in-band'><code>impl&lt;T&gt; <a class="struct" href="../../crossbeam/sync/struct.SegQueue.html" title="struct crossbeam::sync::SegQueue">SegQueue</a>&lt;T&gt;</code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#54-139' title='goto source code'>[src]</a></span></h3>
  58. <div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../crossbeam/sync/struct.SegQueue.html" title="struct crossbeam::sync::SegQueue">SegQueue</a>&lt;T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#56-66' title='goto source code'>[src]</a></span></h4>
  59. <div class='docblock'><p>Create a new, empty queue.</p>
  60. </div><h4 id='method.push' class="method"><span id='push.v' class='invisible'><code>pub fn <a href='#method.push' class='fnname'>push</a>(&amp;self, t: T)</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#69-90' title='goto source code'>[src]</a></span></h4>
  61. <div class='docblock'><p>Add <code>t</code> to the back of the queue.</p>
  62. </div><h4 id='method.is_empty' class="method"><span id='is_empty.v' class='invisible'><code>pub fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#95-105' title='goto source code'>[src]</a></span></h4>
  63. <div class='docblock'><p>Judge if the queue is empty.</p>
  64. <p>Returns <code>true</code> if the queue is empty.</p>
  65. </div><h4 id='method.try_pop' class="method"><span id='try_pop.v' class='invisible'><code>pub fn <a href='#method.try_pop' class='fnname'>try_pop</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#110-138' title='goto source code'>[src]</a></span></h4>
  66. <div class='docblock'><p>Attempt to dequeue from the front.</p>
  67. <p>Returns <code>None</code> if the queue is observed to be empty.</p>
  68. </div></div>
  69. <h2 id='implementations' class='small-section-header'>
  70. Trait Implementations<a href='#implementations' class='anchor'></a>
  71. </h2>
  72. <h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../crossbeam/sync/struct.SegQueue.html" title="struct crossbeam::sync::SegQueue">SegQueue</a>&lt;T&gt;</code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#16' title='goto source code'>[src]</a></span></h3>
  73. <div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#16' title='goto source code'>[src]</a></span></h4>
  74. <div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
  75. </div></div><h3 id='impl-Drop' class='impl'><span class='in-band'><code>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../crossbeam/sync/struct.SegQueue.html" title="struct crossbeam::sync::SegQueue">SegQueue</a>&lt;T&gt;</code><a href='#impl-Drop' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#141-152' title='goto source code'>[src]</a></span></h3>
  76. <div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/crossbeam/sync/seg_queue.rs.html#142-151' title='goto source code'>[src]</a></span></h4>
  77. <div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
  78. </div></div></section>
  79. <section id='search' class="content hidden"></section>
  80. <section class="footer"></section>
  81. <aside id="help" class="hidden">
  82. <div>
  83. <h1 class="hidden">Help</h1>
  84. <div class="shortcuts">
  85. <h2>Keyboard Shortcuts</h2>
  86. <dl>
  87. <dt><kbd>?</kbd></dt>
  88. <dd>Show this help dialog</dd>
  89. <dt><kbd>S</kbd></dt>
  90. <dd>Focus the search field</dd>
  91. <dt><kbd>↑</kbd></dt>
  92. <dd>Move up in search results</dd>
  93. <dt><kbd>↓</kbd></dt>
  94. <dd>Move down in search results</dd>
  95. <dt><kbd>↹</kbd></dt>
  96. <dd>Switch tab</dd>
  97. <dt><kbd>&#9166;</kbd></dt>
  98. <dd>Go to active search result</dd>
  99. <dt><kbd>+</kbd></dt>
  100. <dd>Expand all sections</dd>
  101. <dt><kbd>-</kbd></dt>
  102. <dd>Collapse all sections</dd>
  103. </dl>
  104. </div>
  105. <div class="infos">
  106. <h2>Search Tricks</h2>
  107. <p>
  108. Prefix searches with a type followed by a colon (e.g.
  109. <code>fn:</code>) to restrict the search to a given type.
  110. </p>
  111. <p>
  112. Accepted types are: <code>fn</code>, <code>mod</code>,
  113. <code>struct</code>, <code>enum</code>,
  114. <code>trait</code>, <code>type</code>, <code>macro</code>,
  115. and <code>const</code>.
  116. </p>
  117. <p>
  118. Search functions by type signature (e.g.
  119. <code>vec -> usize</code> or <code>* -> vec</code>)
  120. </p>
  121. </div>
  122. </div>
  123. </aside>
  124. <script>
  125. window.rootPath = "../../";
  126. window.currentCrate = "crossbeam";
  127. </script>
  128. <script src="../../main.js"></script>
  129. <script defer src="../../search-index.js"></script>
  130. </body>
  131. </html>