40 lines
9.4 KiB
HTML
40 lines
9.4 KiB
HTML
<!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 `cmp` mod in crate `nom`."><meta name="keywords" content="rust, rustlang, rust-lang, cmp"><title>nom::lib::std::cmp - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../nom/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module cmp</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#macros">Macros</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../../index.html'>nom</a>::<wbr><a href='../../index.html'>lib</a>::<wbr><a href='../index.html'>std</a></p><script>window.sidebarCurrent = {name: 'cmp', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><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='https://doc.rust-lang.org/nightly/src/core/lib.rs.html#211' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../../index.html'>nom</a>::<wbr><a href='../../index.html'>lib</a>::<wbr><a href='../index.html'>std</a>::<wbr><a class="mod" href=''>cmp</a></span></h1><div class='docblock'><p>Functionality for ordering and comparison.</p>
|
||
<p>This module contains various tools for ordering and comparing values. In
|
||
summary:</p>
|
||
<ul>
|
||
<li><a href="trait.Eq.html"><code>Eq</code></a> and <a href="trait.PartialEq.html"><code>PartialEq</code></a> are traits that allow you to define total and
|
||
partial equality between values, respectively. Implementing them overloads
|
||
the <code>==</code> and <code>!=</code> operators.</li>
|
||
<li><a href="trait.Ord.html"><code>Ord</code></a> and <a href="trait.PartialOrd.html"><code>PartialOrd</code></a> are traits that allow you to define total and
|
||
partial orderings between values, respectively. Implementing them overloads
|
||
the <code><</code>, <code><=</code>, <code>></code>, and <code>>=</code> operators.</li>
|
||
<li><a href="enum.Ordering.html"><code>Ordering</code></a> is an enum returned by the main functions of <a href="trait.Ord.html"><code>Ord</code></a> and
|
||
<a href="trait.PartialOrd.html"><code>PartialOrd</code></a>, and describes an ordering.</li>
|
||
<li><a href="struct.Reverse.html"><code>Reverse</code></a> is a struct that allows you to easily reverse an ordering.</li>
|
||
<li><a href="fn.max.html"><code>max</code></a> and <a href="fn.min.html"><code>min</code></a> are functions that build off of <a href="trait.Ord.html"><code>Ord</code></a> and allow you
|
||
to find the maximum or minimum of two values.</li>
|
||
</ul>
|
||
<p>For more details, see the respective documentation of each item in the list.</p>
|
||
</div><h2 id='macros' class='section-header'><a href="#macros">Macros</a></h2>
|
||
<table><tr class='module-item'><td><a class="macro" href="macro.Eq.html" title='nom::lib::std::cmp::Eq macro'>Eq</a></td><td class='docblock-short'><p>Derive macro generating an impl of the trait <code>Eq</code>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="macro" href="macro.Ord.html" title='nom::lib::std::cmp::Ord macro'>Ord</a></td><td class='docblock-short'><p>Derive macro generating an impl of the trait <code>Ord</code>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="macro" href="macro.PartialEq.html" title='nom::lib::std::cmp::PartialEq macro'>PartialEq</a></td><td class='docblock-short'><p>Derive macro generating an impl of the trait <code>PartialEq</code>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="macro" href="macro.PartialOrd.html" title='nom::lib::std::cmp::PartialOrd macro'>PartialOrd</a></td><td class='docblock-short'><p>Derive macro generating an impl of the trait <code>PartialOrd</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.Reverse.html" title='nom::lib::std::cmp::Reverse struct'>Reverse</a></td><td class='docblock-short'><p>A helper struct for reverse ordering.</p>
|
||
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||
<table><tr class='module-item'><td><a class="enum" href="enum.Ordering.html" title='nom::lib::std::cmp::Ordering enum'>Ordering</a></td><td class='docblock-short'><p>An <code>Ordering</code> is the result of a comparison between two values.</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.Eq.html" title='nom::lib::std::cmp::Eq trait'>Eq</a></td><td class='docblock-short'><p>Trait for equality comparisons which are <a href="https://en.wikipedia.org/wiki/Equivalence_relation">equivalence relations</a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="trait" href="trait.Ord.html" title='nom::lib::std::cmp::Ord trait'>Ord</a></td><td class='docblock-short'><p>Trait for types that form a <a href="https://en.wikipedia.org/wiki/Total_order">total order</a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="trait" href="trait.PartialEq.html" title='nom::lib::std::cmp::PartialEq trait'>PartialEq</a></td><td class='docblock-short'><p>Trait for equality comparisons which are <a href="http://en.wikipedia.org/wiki/Partial_equivalence_relation">partial equivalence
|
||
relations</a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="trait" href="trait.PartialOrd.html" title='nom::lib::std::cmp::PartialOrd trait'>PartialOrd</a></td><td class='docblock-short'><p>Trait for values that can be compared for a sort-order.</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.max.html" title='nom::lib::std::cmp::max fn'>max</a></td><td class='docblock-short'><p>Compares and returns the maximum of two values.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.min.html" title='nom::lib::std::cmp::min fn'>min</a></td><td class='docblock-short'><p>Compares and returns the minimum of two values.</p>
|
||
</td></tr><tr class='unstable module-item'><td><a class="fn" href="fn.max_by.html" title='nom::lib::std::cmp::max_by fn'>max_by</a></td><td class='docblock-short'><span class="stab unstable">Experimental</span><p>Returns the maximum of two values with respect to the specified comparison function.</p>
|
||
</td></tr><tr class='unstable module-item'><td><a class="fn" href="fn.max_by_key.html" title='nom::lib::std::cmp::max_by_key fn'>max_by_key</a></td><td class='docblock-short'><span class="stab unstable">Experimental</span><p>Returns the element that gives the maximum value from the specified function.</p>
|
||
</td></tr><tr class='unstable module-item'><td><a class="fn" href="fn.min_by.html" title='nom::lib::std::cmp::min_by fn'>min_by</a></td><td class='docblock-short'><span class="stab unstable">Experimental</span><p>Returns the minimum of two values with respect to the specified comparison function.</p>
|
||
</td></tr><tr class='unstable module-item'><td><a class="fn" href="fn.min_by_key.html" title='nom::lib::std::cmp::min_by_key fn'>min_by_key</a></td><td class='docblock-short'><span class="stab unstable">Experimental</span><p>Returns the element that gives the minimum value from the specified function.</p>
|
||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "nom";</script><script src="../../../../aliases.js"></script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html> |