struct.Stack.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 `Stack` struct in crate `rustc_serialize`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, Stack">
  9. <title>rustc_serialize::json::Stack - 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. <link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
  16. </head>
  17. <body class="rustdoc struct">
  18. <!--[if lte IE 8]>
  19. <div class="warning">
  20. This old browser is unsupported and will most likely display funky
  21. things.
  22. </div>
  23. <![endif]-->
  24. <nav class="sidebar">
  25. <div class="sidebar-menu">&#9776;</div>
  26. <a href='../../rustc_serialize/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
  27. <p class='location'>Struct Stack</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.len">len</a><a href="#method.is_empty">is_empty</a><a href="#method.get">get</a><a href="#method.is_equal_to">is_equal_to</a><a href="#method.starts_with">starts_with</a><a href="#method.ends_with">ends_with</a><a href="#method.top">top</a></div></div><p class='location'><a href='../index.html'>rustc_serialize</a>::<wbr><a href='index.html'>json</a></p><script>window.sidebarCurrent = {name: 'Stack', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
  28. </nav>
  29. <div class="theme-picker">
  30. <button id="theme-picker" aria-label="Pick another theme!">
  31. <img src="../../brush.svg" width="18" alt="Pick another theme!">
  32. </button>
  33. <div id="theme-choices"></div>
  34. </div>
  35. <script src="../../theme.js"></script>
  36. <nav class="sub">
  37. <form class="search-form js-only">
  38. <div class="search-container">
  39. <input class="search-input" name="search"
  40. autocomplete="off"
  41. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  42. type="search">
  43. </div>
  44. </form>
  45. </nav>
  46. <section id='main' class="content">
  47. <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>rustc_serialize</a>::<wbr><a href='index.html'>json</a>::<wbr><a class="struct" href=''>Stack</a></span><span class='out-of-band'><span id='render-detail'>
  48. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  49. [<span class='inner'>&#x2212;</span>]
  50. </a>
  51. </span><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1258-1261' title='goto source code'>[src]</a></span></h1>
  52. <pre class='rust struct'>pub struct Stack { /* fields omitted */ }</pre><div class='docblock'><p>A Stack represents the current position of the parser in the logical
  53. structure of the JSON stream.
  54. For example foo.bar[3].x</p>
  55. </div>
  56. <h2 id='methods' class='small-section-header'>
  57. Methods<a href='#methods' class='anchor'></a>
  58. </h2>
  59. <h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="struct" href="../../rustc_serialize/json/struct.Stack.html" title="struct rustc_serialize::json::Stack">Stack</a></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1280-1391' title='goto source code'>[src]</a></span></h3>
  60. <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="../../rustc_serialize/json/struct.Stack.html" title="struct rustc_serialize::json::Stack">Stack</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1281-1283' title='goto source code'>[src]</a></span></h4>
  61. <h4 id='method.len' class="method"><span id='len.v' class='invisible'><code>pub fn <a href='#method.len' class='fnname'>len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1286' title='goto source code'>[src]</a></span></h4>
  62. <div class='docblock'><p>Returns The number of elements in the Stack.</p>
  63. </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/rustc_serialize/json.rs.html#1289' title='goto source code'>[src]</a></span></h4>
  64. <div class='docblock'><p>Returns true if the stack is empty.</p>
  65. </div><h4 id='method.get' class="method"><span id='get.v' class='invisible'><code>pub fn <a href='#method.get' class='fnname'>get</a>&lt;'l&gt;(&amp;'l self, idx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="../../rustc_serialize/json/enum.StackElement.html" title="enum rustc_serialize::json::StackElement">StackElement</a>&lt;'l&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1294-1302' title='goto source code'>[src]</a></span></h4>
  66. <div class='docblock'><p>Provides access to the StackElement at a given index.
  67. lower indices are at the bottom of the stack while higher indices are
  68. at the top.</p>
  69. </div><h4 id='method.is_equal_to' class="method"><span id='is_equal_to.v' class='invisible'><code>pub fn <a href='#method.is_equal_to' class='fnname'>is_equal_to</a>(&amp;self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="enum" href="../../rustc_serialize/json/enum.StackElement.html" title="enum rustc_serialize::json::StackElement">StackElement</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&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/rustc_serialize/json.rs.html#1305-1311' title='goto source code'>[src]</a></span></h4>
  70. <div class='docblock'><p>Compares this stack with an array of StackElements.</p>
  71. </div><h4 id='method.starts_with' class="method"><span id='starts_with.v' class='invisible'><code>pub fn <a href='#method.starts_with' class='fnname'>starts_with</a>(&amp;self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="enum" href="../../rustc_serialize/json/enum.StackElement.html" title="enum rustc_serialize::json::StackElement">StackElement</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&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/rustc_serialize/json.rs.html#1315-1321' title='goto source code'>[src]</a></span></h4>
  72. <div class='docblock'><p>Returns true if the bottom-most elements of this stack are the same as
  73. the ones passed as parameter.</p>
  74. </div><h4 id='method.ends_with' class="method"><span id='ends_with.v' class='invisible'><code>pub fn <a href='#method.ends_with' class='fnname'>ends_with</a>(&amp;self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="enum" href="../../rustc_serialize/json/enum.StackElement.html" title="enum rustc_serialize::json::StackElement">StackElement</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&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/rustc_serialize/json.rs.html#1325-1332' title='goto source code'>[src]</a></span></h4>
  75. <div class='docblock'><p>Returns true if the top-most elements of this stack are the same as
  76. the ones passed as parameter.</p>
  77. </div><h4 id='method.top' class="method"><span id='top.v' class='invisible'><code>pub fn <a href='#method.top' class='fnname'>top</a>&lt;'l&gt;(&amp;'l 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;<a class="enum" href="../../rustc_serialize/json/enum.StackElement.html" title="enum rustc_serialize::json::StackElement">StackElement</a>&lt;'l&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1335-1345' title='goto source code'>[src]</a></span></h4>
  78. <div class='docblock'><p>Returns the top-most element (if any).</p>
  79. </div></div></section>
  80. <section id='search' class="content hidden"></section>
  81. <section class="footer"></section>
  82. <aside id="help" class="hidden">
  83. <div>
  84. <h1 class="hidden">Help</h1>
  85. <div class="shortcuts">
  86. <h2>Keyboard Shortcuts</h2>
  87. <dl>
  88. <dt><kbd>?</kbd></dt>
  89. <dd>Show this help dialog</dd>
  90. <dt><kbd>S</kbd></dt>
  91. <dd>Focus the search field</dd>
  92. <dt><kbd>↑</kbd></dt>
  93. <dd>Move up in search results</dd>
  94. <dt><kbd>↓</kbd></dt>
  95. <dd>Move down in search results</dd>
  96. <dt><kbd>↹</kbd></dt>
  97. <dd>Switch tab</dd>
  98. <dt><kbd>&#9166;</kbd></dt>
  99. <dd>Go to active search result</dd>
  100. <dt><kbd>+</kbd></dt>
  101. <dd>Expand all sections</dd>
  102. <dt><kbd>-</kbd></dt>
  103. <dd>Collapse all sections</dd>
  104. </dl>
  105. </div>
  106. <div class="infos">
  107. <h2>Search Tricks</h2>
  108. <p>
  109. Prefix searches with a type followed by a colon (e.g.
  110. <code>fn:</code>) to restrict the search to a given type.
  111. </p>
  112. <p>
  113. Accepted types are: <code>fn</code>, <code>mod</code>,
  114. <code>struct</code>, <code>enum</code>,
  115. <code>trait</code>, <code>type</code>, <code>macro</code>,
  116. and <code>const</code>.
  117. </p>
  118. <p>
  119. Search functions by type signature (e.g.
  120. <code>vec -> usize</code> or <code>* -> vec</code>)
  121. </p>
  122. </div>
  123. </div>
  124. </aside>
  125. <script>
  126. window.rootPath = "../../";
  127. window.currentCrate = "rustc_serialize";
  128. </script>
  129. <script src="../../main.js"></script>
  130. <script defer src="../../search-index.js"></script>
  131. </body>
  132. </html>