<!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 `odds` crate.">
<meta name="keywords" content="rust, rustlang, rust-lang, odds">
<title>odds - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc mod">
<nav class="sidebar">
<p class='location'></p><script>window.sidebarCurrent = {name: 'odds', ty: 'mod', relpath: '../'};</script>
</nav>
<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'>Crate <a class="mod" href=''>odds</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a class='srclink' href='../src/odds/lib.rs.html#1-197' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>Odds and ends — collection miscellania.</p>
<ul>
<li>Utilities for debug-checked, release-unchecked indexing and slicing</li>
<li>Fixpoint combinator for closures</li>
<li>String and Vec extensions</li>
</ul>
<p>The <strong>odds</strong> crate has the following crate feature flags:</p>
<ul>
<li><code>std</code>
<ul>
<li>Default</li>
<li>Requires Rust 1.6 <em>to opt out of</em></li>
<li>Use libstd and std features.</li>
</ul>
</li>
<li><code>unstable</code>.
<ul>
<li>Optional.</li>
<li>Requires nightly channel.</li>
<li>Implement the closure traits for <strong>Fix</strong>.</li>
</ul>
</li>
</ul>
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
<tr class=' module-item'>
<td><a class="mod" href="char/index.html"
title='mod odds::char'>char</a></td>
<td class='docblock-short'>
<p>Extra functions for <code>char</code></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="mod" href="prelude/index.html"
title='mod odds::prelude'>prelude</a></td>
<td class='docblock-short'>
<p>prelude of often used traits and functions</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="mod" href="slice/index.html"
title='mod odds::slice'>slice</a></td>
<td class='docblock-short'>
<p>Extra functions for slices</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="mod" href="stride/index.html"
title='mod odds::stride'>stride</a></td>
<td class='docblock-short'>
<p>Slice iterator with custom step size</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="mod" href="string/index.html"
title='mod odds::string'>string</a></td>
<td class='docblock-short'>
<p>Extensions to <code>&str</code> and <code>String</code></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="mod" href="vec/index.html"
title='mod odds::vec'>vec</a></td>
<td class='docblock-short'>
<p>Extensions to <code>Vec</code></p>
</td>
</tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class="struct" href="struct.Fix.html"
title='struct odds::Fix'>Fix</a></td>
<td class='docblock-short'>
<p>Fixpoint combinator for rust closures, generalized over the return type.</p>
</td>
</tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table>
<tr class=' module-item'>
<td><a class="trait" href="trait.IndexRange.html"
title='trait odds::IndexRange'>IndexRange</a></td>
<td class='docblock-short'>
<p><strong>IndexRange</strong> is implemented by Rust's built-in range types, produced
by range syntax like <code>..</code>, <code>a..</code>, <code>..b</code> or <code>c..d</code>.</p>
</td>
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class="fn" href="fn.debug_assert_unreachable.html"
title='fn odds::debug_assert_unreachable'>debug_assert_unreachable</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
<p>Act as <code>debug_assert!</code> in debug mode, asserting that this point is not reached.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.fix.html"
title='fn odds::fix'>fix</a></td>
<td class='docblock-short'>
<p>Fixpoint combinator for rust closures, generalized over the return type.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.get_unchecked.html"
title='fn odds::get_unchecked'>get_unchecked</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
<p>Use <code>debug_assert!</code> to check indexing in debug mode. In release mode, no checks are done.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.get_unchecked_mut.html"
title='fn odds::get_unchecked_mut'>get_unchecked_mut</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
<p>Use <code>debug_assert!</code> to check indexing in debug mode. In release mode, no checks are done.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ptr_eq.html"
title='fn odds::ptr_eq'>ptr_eq</a></td>
<td class='docblock-short'>
<p>Compare if <strong>a</strong> and <strong>b</strong> are equal pointers.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.raw_byte_repr.html"
title='fn odds::raw_byte_repr'>raw_byte_repr</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
<p>Safe to use with any wholly initialized memory <code>ptr</code></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ref_eq.html"
title='fn odds::ref_eq'>ref_eq</a></td>
<td class='docblock-short'>
<p>Compare if <strong>a</strong> and <strong>b</strong> are equal <em>as pointers</em>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ref_slice.html"
title='fn odds::ref_slice'>ref_slice</a></td>
<td class='docblock-short'>
<p>Create a length 1 slice out of a reference</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ref_slice_mut.html"
title='fn odds::ref_slice_mut'>ref_slice_mut</a></td>
<td class='docblock-short'>
<p>Create a length 1 mutable slice out of a reference</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.slice_unchecked.html"
title='fn odds::slice_unchecked'>slice_unchecked</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
<p>Check slicing bounds in debug mode, otherwise just act as an unchecked
slice call.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.slice_unchecked_mut.html"
title='fn odds::slice_unchecked_mut'>slice_unchecked_mut</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
<p>Check slicing bounds in debug mode, otherwise just act as an unchecked
slice call.</p>
</td>
</tr></table></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>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand 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 = "odds";
</script>
<script src="../jquery.js"></script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>