index.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 `rustc_demangle` crate.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, rustc_demangle">
  9. <title>rustc_demangle - 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 mod">
  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'>Crate rustc_demangle</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'rustc_demangle', ty: 'mod', relpath: '../'};</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'>Crate <a class="mod" href=''>rustc_demangle</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/rustc_demangle/lib.rs.html#1-413' title='goto source code'>[src]</a></span></h1>
  50. <div class='docblock'><p>Demangle Rust compiler symbol names.</p>
  51. <p>This crate provides a <code>demangle</code> function which will return a <code>Demangle</code>
  52. sentinel value that can be used to learn about the demangled version of a
  53. symbol name. The demangled representation will be the same as the original
  54. if it doesn't look like a mangled symbol name.</p>
  55. <p><code>Demangle</code> can be formatted with the <code>Display</code> trait. The alternate
  56. modifier (<code>#</code>) can be used to format the symbol name without the
  57. trailing hash value.</p>
  58. <h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
  59. <pre class="rust rust-example-rendered">
  60. <span class="kw">use</span> <span class="ident">rustc_demangle</span>::<span class="ident">demangle</span>;
  61. <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">demangle</span>(<span class="string">&quot;_ZN4testE&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;test&quot;</span>);
  62. <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">demangle</span>(<span class="string">&quot;_ZN3foo3barE&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;foo::bar&quot;</span>);
  63. <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">demangle</span>(<span class="string">&quot;foo&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;foo&quot;</span>);
  64. <span class="comment">// With hash</span>
  65. <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">demangle</span>(<span class="string">&quot;_ZN3foo17h05af221e174051e9E&quot;</span>)), <span class="string">&quot;foo::h05af221e174051e9&quot;</span>);
  66. <span class="comment">// Without hash</span>
  67. <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:#}&quot;</span>, <span class="ident">demangle</span>(<span class="string">&quot;_ZN3foo17h05af221e174051e9E&quot;</span>)), <span class="string">&quot;foo&quot;</span>);</pre>
  68. </div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
  69. <table>
  70. <tr class=' module-item'>
  71. <td><a class="struct" href="struct.Demangle.html"
  72. title='struct rustc_demangle::Demangle'>Demangle</a></td>
  73. <td class='docblock-short'>
  74. <p>Representation of a demangled symbol name.</p>
  75. </td>
  76. </tr>
  77. <tr class=' module-item'>
  78. <td><a class="struct" href="struct.TryDemangleError.html"
  79. title='struct rustc_demangle::TryDemangleError'>TryDemangleError</a></td>
  80. <td class='docblock-short'>
  81. <p>Error returned from the <code>try_demangle</code> function below when demangling fails.</p>
  82. </td>
  83. </tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
  84. <table>
  85. <tr class=' module-item'>
  86. <td><a class="fn" href="fn.demangle.html"
  87. title='fn rustc_demangle::demangle'>demangle</a></td>
  88. <td class='docblock-short'>
  89. <p>De-mangles a Rust symbol into a more readable version</p>
  90. </td>
  91. </tr>
  92. <tr class=' module-item'>
  93. <td><a class="fn" href="fn.try_demangle.html"
  94. title='fn rustc_demangle::try_demangle'>try_demangle</a></td>
  95. <td class='docblock-short'>
  96. <p>The same as <code>demangle</code>, except return an <code>Err</code> if the string does not appear
  97. to be a Rust symbol, rather than &quot;demangling&quot; the given string as a no-op.</p>
  98. </td>
  99. </tr></table></section>
  100. <section id='search' class="content hidden"></section>
  101. <section class="footer"></section>
  102. <aside id="help" class="hidden">
  103. <div>
  104. <h1 class="hidden">Help</h1>
  105. <div class="shortcuts">
  106. <h2>Keyboard Shortcuts</h2>
  107. <dl>
  108. <dt><kbd>?</kbd></dt>
  109. <dd>Show this help dialog</dd>
  110. <dt><kbd>S</kbd></dt>
  111. <dd>Focus the search field</dd>
  112. <dt><kbd>↑</kbd></dt>
  113. <dd>Move up in search results</dd>
  114. <dt><kbd>↓</kbd></dt>
  115. <dd>Move down in search results</dd>
  116. <dt><kbd>↹</kbd></dt>
  117. <dd>Switch tab</dd>
  118. <dt><kbd>&#9166;</kbd></dt>
  119. <dd>Go to active search result</dd>
  120. <dt><kbd>+</kbd></dt>
  121. <dd>Expand all sections</dd>
  122. <dt><kbd>-</kbd></dt>
  123. <dd>Collapse all sections</dd>
  124. </dl>
  125. </div>
  126. <div class="infos">
  127. <h2>Search Tricks</h2>
  128. <p>
  129. Prefix searches with a type followed by a colon (e.g.
  130. <code>fn:</code>) to restrict the search to a given type.
  131. </p>
  132. <p>
  133. Accepted types are: <code>fn</code>, <code>mod</code>,
  134. <code>struct</code>, <code>enum</code>,
  135. <code>trait</code>, <code>type</code>, <code>macro</code>,
  136. and <code>const</code>.
  137. </p>
  138. <p>
  139. Search functions by type signature (e.g.
  140. <code>vec -> usize</code> or <code>* -> vec</code>)
  141. </p>
  142. </div>
  143. </div>
  144. </aside>
  145. <script>
  146. window.rootPath = "../";
  147. window.currentCrate = "rustc_demangle";
  148. </script>
  149. <script src="../main.js"></script>
  150. <script defer src="../search-index.js"></script>
  151. </body>
  152. </html>