index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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 `util` mod in crate `ocl_core`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, util">
  9. <title>ocl_core::util - 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'>Module util</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>ocl_core</a></p><script>window.sidebarCurrent = {name: 'util', ty: 'mod', 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'>Module <a href='../index.html'>ocl_core</a>::<wbr><a class="mod" href=''>util</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/ocl_core/util.rs.html#1-531' title='goto source code'>[src]</a></span></h1>
  50. <div class='docblock'><p>Utility and debugging functions.</p>
  51. <h2 id="stability" class="section-header"><a href="#stability">Stability</a></h2>
  52. <p>Printing functions may be moved/renamed/removed at any time.</p>
  53. </div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
  54. <table>
  55. <tr class=' module-item'>
  56. <td><a class="mod" href="colors/index.html"
  57. title='mod ocl_core::util::colors'>colors</a></td>
  58. <td class='docblock-short'>
  59. <p>ASCII Color Palette</p>
  60. </td>
  61. </tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
  62. <table>
  63. <tr class=' module-item'>
  64. <td><a class="enum" href="enum.UtilError.html"
  65. title='enum ocl_core::util::UtilError'>UtilError</a></td>
  66. <td class='docblock-short'>
  67. <p>An error caused by a utility function.</p>
  68. </td>
  69. </tr>
  70. <tr class=' module-item'>
  71. <td><a class="enum" href="enum.VecRemoveRebuildError.html"
  72. title='enum ocl_core::util::VecRemoveRebuildError'>VecRemoveRebuildError</a></td>
  73. <td class='docblock-short'>
  74. <p>An error caused by <code>util::vec_remove_rebuild</code>.</p>
  75. </td>
  76. </tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
  77. <table>
  78. <tr class=' module-item'>
  79. <td><a class="fn" href="fn.bytes_into.html"
  80. title='fn ocl_core::util::bytes_into'>bytes_into</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
  81. <td class='docblock-short'>
  82. <p>Converts a vector of bytes into a value of arbitrary type.</p>
  83. </td>
  84. </tr>
  85. <tr class=' module-item'>
  86. <td><a class="fn" href="fn.bytes_into_string.html"
  87. title='fn ocl_core::util::bytes_into_string'>bytes_into_string</a></td>
  88. <td class='docblock-short'>
  89. <p>Converts a byte Vec into a string, removing the trailing null byte if it
  90. exists.</p>
  91. </td>
  92. </tr>
  93. <tr class=' module-item'>
  94. <td><a class="fn" href="fn.bytes_into_vec.html"
  95. title='fn ocl_core::util::bytes_into_vec'>bytes_into_vec</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
  96. <td class='docblock-short'>
  97. <p>Converts a vector of bytes into a vector of arbitrary type.</p>
  98. </td>
  99. </tr>
  100. <tr class=' module-item'>
  101. <td><a class="fn" href="fn.bytes_to.html"
  102. title='fn ocl_core::util::bytes_to'>bytes_to</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
  103. <td class='docblock-short'>
  104. <p>Copies a slice of bytes to a new value of arbitrary type.</p>
  105. </td>
  106. </tr>
  107. <tr class=' module-item'>
  108. <td><a class="fn" href="fn.bytes_to_u32.html"
  109. title='fn ocl_core::util::bytes_to_u32'>bytes_to_u32</a></td>
  110. <td class='docblock-short'>
  111. <p>Copies a byte slice to a new <code>u32</code>.</p>
  112. </td>
  113. </tr>
  114. <tr class=' module-item'>
  115. <td><a class="fn" href="fn.bytes_to_vec.html"
  116. title='fn ocl_core::util::bytes_to_vec'>bytes_to_vec</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
  117. <td class='docblock-short'>
  118. <p>Copies a slice of bytes into a vector of arbitrary type.</p>
  119. </td>
  120. </tr>
  121. <tr class=' module-item'>
  122. <td><a class="fn" href="fn.into_bytes.html"
  123. title='fn ocl_core::util::into_bytes'>into_bytes</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
  124. <td class='docblock-short'>
  125. <p>[UNTESTED] Copies an arbitrary primitive or struct into core bytes.</p>
  126. </td>
  127. </tr>
  128. <tr class=' module-item'>
  129. <td><a class="fn" href="fn.padded_len.html"
  130. title='fn ocl_core::util::padded_len'>padded_len</a></td>
  131. <td class='docblock-short'>
  132. <p>Pads <code>len</code> to make it evenly divisible by <code>incr</code>.</p>
  133. </td>
  134. </tr>
  135. <tr class=' module-item'>
  136. <td><a class="fn" href="fn.print_bytes_as_hex.html"
  137. title='fn ocl_core::util::print_bytes_as_hex'>print_bytes_as_hex</a></td>
  138. <td class='docblock-short'>
  139. <p>Prints bytes as hex.</p>
  140. </td>
  141. </tr>
  142. <tr class=' module-item'>
  143. <td><a class="fn" href="fn.print_simple.html"
  144. title='fn ocl_core::util::print_simple'>print_simple</a></td>
  145. <td class='docblock-short'>
  146. </td>
  147. </tr>
  148. <tr class=' module-item'>
  149. <td><a class="fn" href="fn.print_slice.html"
  150. title='fn ocl_core::util::print_slice'>print_slice</a></td>
  151. <td class='docblock-short'>
  152. <p>[UNSTABLE]: MAY BE REMOVED AT ANY TIME
  153. Prints a vector to stdout. Used for debugging.</p>
  154. </td>
  155. </tr>
  156. <tr class=' module-item'>
  157. <td><a class="fn" href="fn.print_val_range.html"
  158. title='fn ocl_core::util::print_val_range'>print_val_range</a></td>
  159. <td class='docblock-short'>
  160. </td>
  161. </tr>
  162. <tr class=' module-item'>
  163. <td><a class="fn" href="fn.vec_remove_rebuild.html"
  164. title='fn ocl_core::util::vec_remove_rebuild'>vec_remove_rebuild</a></td>
  165. <td class='docblock-short'>
  166. <p>Batch removes elements from a vector using a list of indices to remove.</p>
  167. </td>
  168. </tr>
  169. <tr class=' module-item'>
  170. <td><a class="fn" href="fn.wrap_vals.html"
  171. title='fn ocl_core::util::wrap_vals'>wrap_vals</a></td>
  172. <td class='docblock-short'>
  173. <p>Wraps (<code>%</code>) each value in the list <code>vals</code> if it equals or exceeds <code>val_n</code>.</p>
  174. </td>
  175. </tr></table></section>
  176. <section id='search' class="content hidden"></section>
  177. <section class="footer"></section>
  178. <aside id="help" class="hidden">
  179. <div>
  180. <h1 class="hidden">Help</h1>
  181. <div class="shortcuts">
  182. <h2>Keyboard Shortcuts</h2>
  183. <dl>
  184. <dt><kbd>?</kbd></dt>
  185. <dd>Show this help dialog</dd>
  186. <dt><kbd>S</kbd></dt>
  187. <dd>Focus the search field</dd>
  188. <dt><kbd>↑</kbd></dt>
  189. <dd>Move up in search results</dd>
  190. <dt><kbd>↓</kbd></dt>
  191. <dd>Move down in search results</dd>
  192. <dt><kbd>↹</kbd></dt>
  193. <dd>Switch tab</dd>
  194. <dt><kbd>&#9166;</kbd></dt>
  195. <dd>Go to active search result</dd>
  196. <dt><kbd>+</kbd></dt>
  197. <dd>Expand all sections</dd>
  198. <dt><kbd>-</kbd></dt>
  199. <dd>Collapse all sections</dd>
  200. </dl>
  201. </div>
  202. <div class="infos">
  203. <h2>Search Tricks</h2>
  204. <p>
  205. Prefix searches with a type followed by a colon (e.g.
  206. <code>fn:</code>) to restrict the search to a given type.
  207. </p>
  208. <p>
  209. Accepted types are: <code>fn</code>, <code>mod</code>,
  210. <code>struct</code>, <code>enum</code>,
  211. <code>trait</code>, <code>type</code>, <code>macro</code>,
  212. and <code>const</code>.
  213. </p>
  214. <p>
  215. Search functions by type signature (e.g.
  216. <code>vec -> usize</code> or <code>* -> vec</code>)
  217. </p>
  218. </div>
  219. </div>
  220. </aside>
  221. <script>
  222. window.rootPath = "../../";
  223. window.currentCrate = "ocl_core";
  224. </script>
  225. <script src="../../main.js"></script>
  226. <script defer src="../../search-index.js"></script>
  227. </body>
  228. </html>