juniper/iron/headers/struct.AccessControlMaxAge.html
Juniper Documentation Builder cb596a6b6b Update documentation for Juniper
2016-10-09 12:40:00 +00:00

662 lines
No EOL
67 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 `AccessControlMaxAge` struct in crate `iron`.">
<meta name="keywords" content="rust, rustlang, rust-lang, AccessControlMaxAge">
<title>iron::headers::AccessControlMaxAge - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
<link rel="shortcut icon" href="https://avatars0.githubusercontent.com/u/7853871?s=256">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<a href='../../iron/index.html'><img src='https://avatars0.githubusercontent.com/u/7853871?s=128' alt='logo' width='100'></a>
<p class='location'><a href='../index.html'>iron</a>::<wbr><a href='index.html'>headers</a></p><script>window.sidebarCurrent = {name: 'AccessControlMaxAge', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></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 struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>iron</a>::<wbr><a href='index.html'>headers</a>::<wbr><a class='struct' href=''>AccessControlMaxAge</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'>&#x2212;</span>]
</a>
</span><a id='src-1462' class='srclink' href='../../hyper/header/common/access_control_max_age/struct.AccessControlMaxAge.html?gotosrc=1462' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct AccessControlMaxAge(pub <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>);</pre><div class='docblock'><p><code>Access-Control-Max-Age</code> header, part of
<a href="http://www.w3.org/TR/cors/#access-control-max-age-response-header">CORS</a></p>
<p>The <code>Access-Control-Max-Age</code> header indicates how long the results of a
preflight request can be cached in a preflight result cache.</p>
<h1 id='abnf' class='section-header'><a href='#abnf'>ABNF</a></h1>
<pre><code class="language-plain">Access-Control-Max-Age = \&quot;Access-Control-Max-Age\&quot; \&quot;:\&quot; delta-seconds
</code></pre>
<h1 id='example-values' class='section-header'><a href='#example-values'>Example values</a></h1>
<ul>
<li><code>531</code></li>
</ul>
<h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>hyper</span>::<span class='ident'>header</span>::{<span class='ident'>Headers</span>, <span class='ident'>AccessControlMaxAge</span>};
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>headers</span> <span class='op'>=</span> <span class='ident'>Headers</span>::<span class='ident'>new</span>();
<span class='ident'>headers</span>.<span class='ident'>set</span>(<span class='ident'>AccessControlMaxAge</span>(<span class='number'>1728000u32</span>));</pre>
</div><h2 id='deref-methods'>Methods from <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Deref.html' title='core::ops::Deref'>Deref</a>&lt;Target=<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</h2><div class='impl-items'><h4 id='method.count_ones' class='method'><code>fn <a href='#method.count_ones' class='fnname'>count_ones</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the number of ones in the binary representation of <code>self</code>.</p>
<h1 id='examples-1' class='section-header'><a href='#examples-1'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0b01001100u8</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>count_ones</span>(), <span class='number'>3</span>);</pre>
</div><h4 id='method.count_zeros' class='method'><code>fn <a href='#method.count_zeros' class='fnname'>count_zeros</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the number of zeros in the binary representation of <code>self</code>.</p>
<h1 id='examples-2' class='section-header'><a href='#examples-2'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0b01001100u8</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>count_zeros</span>(), <span class='number'>5</span>);</pre>
</div><h4 id='method.leading_zeros' class='method'><code>fn <a href='#method.leading_zeros' class='fnname'>leading_zeros</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the number of leading zeros in the binary representation
of <code>self</code>.</p>
<h1 id='examples-3' class='section-header'><a href='#examples-3'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0b0101000u16</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>leading_zeros</span>(), <span class='number'>10</span>);</pre>
</div><h4 id='method.trailing_zeros' class='method'><code>fn <a href='#method.trailing_zeros' class='fnname'>trailing_zeros</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the number of trailing zeros in the binary representation
of <code>self</code>.</p>
<h1 id='examples-4' class='section-header'><a href='#examples-4'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0b0101000u16</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>trailing_zeros</span>(), <span class='number'>3</span>);</pre>
</div><h4 id='method.rotate_left' class='method'><code>fn <a href='#method.rotate_left' class='fnname'>rotate_left</a>(self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Shifts the bits to the left by a specified amount, <code>n</code>,
wrapping the truncated bits to the end of the resulting integer.</p>
<p>Please note this isn&#39;t the same operation as <code>&lt;&lt;</code>!</p>
<h1 id='examples-5' class='section-header'><a href='#examples-5'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0x0123456789ABCDEFu64</span>;
<span class='kw'>let</span> <span class='ident'>m</span> <span class='op'>=</span> <span class='number'>0x3456789ABCDEF012u64</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>rotate_left</span>(<span class='number'>12</span>), <span class='ident'>m</span>);</pre>
</div><h4 id='method.rotate_right' class='method'><code>fn <a href='#method.rotate_right' class='fnname'>rotate_right</a>(self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Shifts the bits to the right by a specified amount, <code>n</code>,
wrapping the truncated bits to the beginning of the resulting
integer.</p>
<p>Please note this isn&#39;t the same operation as <code>&gt;&gt;</code>!</p>
<h1 id='examples-6' class='section-header'><a href='#examples-6'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0x0123456789ABCDEFu64</span>;
<span class='kw'>let</span> <span class='ident'>m</span> <span class='op'>=</span> <span class='number'>0xDEF0123456789ABCu64</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>rotate_right</span>(<span class='number'>12</span>), <span class='ident'>m</span>);</pre>
</div><h4 id='method.swap_bytes' class='method'><code>fn <a href='#method.swap_bytes' class='fnname'>swap_bytes</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Reverses the byte order of the integer.</p>
<h1 id='examples-7' class='section-header'><a href='#examples-7'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0x0123456789ABCDEFu64</span>;
<span class='kw'>let</span> <span class='ident'>m</span> <span class='op'>=</span> <span class='number'>0xEFCDAB8967452301u64</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>swap_bytes</span>(), <span class='ident'>m</span>);</pre>
</div><h4 id='method.to_be' class='method'><code>fn <a href='#method.to_be' class='fnname'>to_be</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Converts <code>self</code> to big endian from the target&#39;s endianness.</p>
<p>On big endian this is a no-op. On little endian the bytes are
swapped.</p>
<h1 id='examples-8' class='section-header'><a href='#examples-8'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0x0123456789ABCDEFu64</span>;
<span class='kw'>if</span> <span class='macro'>cfg</span><span class='macro'>!</span>(<span class='ident'>target_endian</span> <span class='op'>=</span> <span class='string'>&quot;big&quot;</span>) {
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>to_be</span>(), <span class='ident'>n</span>)
} <span class='kw'>else</span> {
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>to_be</span>(), <span class='ident'>n</span>.<span class='ident'>swap_bytes</span>())
}</pre>
</div><h4 id='method.to_le' class='method'><code>fn <a href='#method.to_le' class='fnname'>to_le</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Converts <code>self</code> to little endian from the target&#39;s endianness.</p>
<p>On little endian this is a no-op. On big endian the bytes are
swapped.</p>
<h1 id='examples-9' class='section-header'><a href='#examples-9'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='number'>0x0123456789ABCDEFu64</span>;
<span class='kw'>if</span> <span class='macro'>cfg</span><span class='macro'>!</span>(<span class='ident'>target_endian</span> <span class='op'>=</span> <span class='string'>&quot;little&quot;</span>) {
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>to_le</span>(), <span class='ident'>n</span>)
} <span class='kw'>else</span> {
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>n</span>.<span class='ident'>to_le</span>(), <span class='ident'>n</span>.<span class='ident'>swap_bytes</span>())
}</pre>
</div><h4 id='method.checked_add' class='method'><code>fn <a href='#method.checked_add' class='fnname'>checked_add</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Checked integer addition. Computes <code>self + other</code>, returning <code>None</code>
if overflow occurred.</p>
<h1 id='examples-10' class='section-header'><a href='#examples-10'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u16</span>.<span class='ident'>checked_add</span>(<span class='number'>65530</span>), <span class='prelude-val'>Some</span>(<span class='number'>65535</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>6u16</span>.<span class='ident'>checked_add</span>(<span class='number'>65530</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_sub' class='method'><code>fn <a href='#method.checked_sub' class='fnname'>checked_sub</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Checked integer subtraction. Computes <code>self - other</code>, returning
<code>None</code> if underflow occurred.</p>
<h1 id='examples-11' class='section-header'><a href='#examples-11'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>1u8</span>.<span class='ident'>checked_sub</span>(<span class='number'>1</span>), <span class='prelude-val'>Some</span>(<span class='number'>0</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0u8</span>.<span class='ident'>checked_sub</span>(<span class='number'>1</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_mul' class='method'><code>fn <a href='#method.checked_mul' class='fnname'>checked_mul</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Checked integer multiplication. Computes <code>self * other</code>, returning
<code>None</code> if underflow or overflow occurred.</p>
<h1 id='examples-12' class='section-header'><a href='#examples-12'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u8</span>.<span class='ident'>checked_mul</span>(<span class='number'>51</span>), <span class='prelude-val'>Some</span>(<span class='number'>255</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u8</span>.<span class='ident'>checked_mul</span>(<span class='number'>52</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_div' class='method'><code>fn <a href='#method.checked_div' class='fnname'>checked_div</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Checked integer division. Computes <code>self / other</code>, returning <code>None</code>
if <code>other == 0</code> or the operation results in underflow or overflow.</p>
<h1 id='examples-13' class='section-header'><a href='#examples-13'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>128u8</span>.<span class='ident'>checked_div</span>(<span class='number'>2</span>), <span class='prelude-val'>Some</span>(<span class='number'>64</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>1u8</span>.<span class='ident'>checked_div</span>(<span class='number'>0</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_rem' class='method'><code>fn <a href='#method.checked_rem' class='fnname'>checked_rem</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Checked integer remainder. Computes <code>self % other</code>, returning <code>None</code>
if <code>other == 0</code> or the operation results in underflow or overflow.</p>
<h1 id='examples-14' class='section-header'><a href='#examples-14'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>checked_rem</span>(<span class='number'>2</span>), <span class='prelude-val'>Some</span>(<span class='number'>1</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>checked_rem</span>(<span class='number'>0</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_neg' class='method'><code>fn <a href='#method.checked_neg' class='fnname'>checked_neg</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Checked negation. Computes <code>-self</code>, returning <code>None</code> unless <code>self == 0</code>.</p>
<p>Note that negating any positive integer will overflow.</p>
<h1 id='examples-15' class='section-header'><a href='#examples-15'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0u32</span>.<span class='ident'>checked_neg</span>(), <span class='prelude-val'>Some</span>(<span class='number'>0</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>1u32</span>.<span class='ident'>checked_neg</span>(), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_shl' class='method'><code>fn <a href='#method.checked_shl' class='fnname'>checked_shl</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Checked shift left. Computes <code>self &lt;&lt; rhs</code>, returning <code>None</code>
if <code>rhs</code> is larger than or equal to the number of bits in <code>self</code>.</p>
<h1 id='examples-16' class='section-header'><a href='#examples-16'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>checked_shl</span>(<span class='number'>4</span>), <span class='prelude-val'>Some</span>(<span class='number'>0x100</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>checked_shl</span>(<span class='number'>33</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.checked_shr' class='method'><code>fn <a href='#method.checked_shr' class='fnname'>checked_shr</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Checked shift right. Computes <code>self &gt;&gt; rhs</code>, returning <code>None</code>
if <code>rhs</code> is larger than or equal to the number of bits in <code>self</code>.</p>
<h1 id='examples-17' class='section-header'><a href='#examples-17'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>checked_shr</span>(<span class='number'>4</span>), <span class='prelude-val'>Some</span>(<span class='number'>0x1</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>checked_shr</span>(<span class='number'>33</span>), <span class='prelude-val'>None</span>);</pre>
</div><h4 id='method.saturating_add' class='method'><code>fn <a href='#method.saturating_add' class='fnname'>saturating_add</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Saturating integer addition. Computes <code>self + other</code>, saturating at
the numeric bounds instead of overflowing.</p>
<h1 id='examples-18' class='section-header'><a href='#examples-18'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>saturating_add</span>(<span class='number'>1</span>), <span class='number'>101</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>200u8</span>.<span class='ident'>saturating_add</span>(<span class='number'>127</span>), <span class='number'>255</span>);</pre>
</div><h4 id='method.saturating_sub' class='method'><code>fn <a href='#method.saturating_sub' class='fnname'>saturating_sub</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Saturating integer subtraction. Computes <code>self - other</code>, saturating
at the numeric bounds instead of overflowing.</p>
<h1 id='examples-19' class='section-header'><a href='#examples-19'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>saturating_sub</span>(<span class='number'>27</span>), <span class='number'>73</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>13u8</span>.<span class='ident'>saturating_sub</span>(<span class='number'>127</span>), <span class='number'>0</span>);</pre>
</div><h4 id='method.saturating_mul' class='method'><code>fn <a href='#method.saturating_mul' class='fnname'>saturating_mul</a>(self, other: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Saturating integer multiplication. Computes <code>self * other</code>,
saturating at the numeric bounds instead of overflowing.</p>
<h1 id='examples-20' class='section-header'><a href='#examples-20'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>u32</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u32</span>.<span class='ident'>saturating_mul</span>(<span class='number'>127</span>), <span class='number'>12700</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>((<span class='number'>1u32</span> <span class='op'>&lt;&lt;</span> <span class='number'>23</span>).<span class='ident'>saturating_mul</span>(<span class='number'>1</span> <span class='op'>&lt;&lt;</span> <span class='number'>23</span>), <span class='ident'>u32</span>::<span class='ident'>MAX</span>);</pre>
</div><h4 id='method.wrapping_add' class='method'><code>fn <a href='#method.wrapping_add' class='fnname'>wrapping_add</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Wrapping (modular) addition. Computes <code>self + other</code>,
wrapping around at the boundary of the type.</p>
<h1 id='examples-21' class='section-header'><a href='#examples-21'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>200u8</span>.<span class='ident'>wrapping_add</span>(<span class='number'>55</span>), <span class='number'>255</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>200u8</span>.<span class='ident'>wrapping_add</span>(<span class='number'>155</span>), <span class='number'>99</span>);</pre>
</div><h4 id='method.wrapping_sub' class='method'><code>fn <a href='#method.wrapping_sub' class='fnname'>wrapping_sub</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Wrapping (modular) subtraction. Computes <code>self - other</code>,
wrapping around at the boundary of the type.</p>
<h1 id='examples-22' class='section-header'><a href='#examples-22'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>wrapping_sub</span>(<span class='number'>100</span>), <span class='number'>0</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>wrapping_sub</span>(<span class='number'>155</span>), <span class='number'>201</span>);</pre>
</div><h4 id='method.wrapping_mul' class='method'><code>fn <a href='#method.wrapping_mul' class='fnname'>wrapping_mul</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Wrapping (modular) multiplication. Computes <code>self * other</code>, wrapping around at the boundary of the type.</p>
<h1 id='examples-23' class='section-header'><a href='#examples-23'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>10u8</span>.<span class='ident'>wrapping_mul</span>(<span class='number'>12</span>), <span class='number'>120</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>25u8</span>.<span class='ident'>wrapping_mul</span>(<span class='number'>12</span>), <span class='number'>44</span>);</pre>
</div><h4 id='method.wrapping_div' class='method'><code>fn <a href='#method.wrapping_div' class='fnname'>wrapping_div</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div></h4>
<div class='docblock'><p>Wrapping (modular) division. Computes <code>self / other</code>.
Wrapped division on unsigned types is just normal division.
There&#39;s no way wrapping could ever happen.
This function exists, so that all operations
are accounted for in the wrapping operations.</p>
<h1 id='examples-24' class='section-header'><a href='#examples-24'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>wrapping_div</span>(<span class='number'>10</span>), <span class='number'>10</span>);</pre>
</div><h4 id='method.wrapping_rem' class='method'><code>fn <a href='#method.wrapping_rem' class='fnname'>wrapping_rem</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div></h4>
<div class='docblock'><p>Wrapping (modular) remainder. Computes <code>self % other</code>.
Wrapped remainder calculation on unsigned types is
just the regular remainder calculation.
There&#39;s no way wrapping could ever happen.
This function exists, so that all operations
are accounted for in the wrapping operations.</p>
<h1 id='examples-25' class='section-header'><a href='#examples-25'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>wrapping_rem</span>(<span class='number'>10</span>), <span class='number'>0</span>);</pre>
</div><h4 id='method.wrapping_neg' class='method'><code>fn <a href='#method.wrapping_neg' class='fnname'>wrapping_neg</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div></h4>
<div class='docblock'><p>Wrapping (modular) negation. Computes <code>-self</code>,
wrapping around at the boundary of the type.</p>
<p>Since unsigned types do not have negative equivalents
all applications of this function will wrap (except for <code>-0</code>).
For values smaller than the corresponding signed type&#39;s maximum
the result is the same as casting the corresponding signed value.
Any larger values are equivalent to <code>MAX + 1 - (val - MAX - 1)</code> where
<code>MAX</code> is the corresponding signed type&#39;s maximum.</p>
<h1 id='examples-26' class='section-header'><a href='#examples-26'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>100u8</span>.<span class='ident'>wrapping_neg</span>(), <span class='number'>156</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0u8</span>.<span class='ident'>wrapping_neg</span>(), <span class='number'>0</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>180u8</span>.<span class='ident'>wrapping_neg</span>(), <span class='number'>76</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>180u8</span>.<span class='ident'>wrapping_neg</span>(), (<span class='number'>127</span> <span class='op'>+</span> <span class='number'>1</span>) <span class='op'>-</span> (<span class='number'>180u8</span> <span class='op'>-</span> (<span class='number'>127</span> <span class='op'>+</span> <span class='number'>1</span>)));</pre>
</div><h4 id='method.wrapping_shl' class='method'><code>fn <a href='#method.wrapping_shl' class='fnname'>wrapping_shl</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div></h4>
<div class='docblock'><p>Panic-free bitwise shift-left; yields <code>self &lt;&lt; mask(rhs)</code>,
where <code>mask</code> removes any high-order bits of <code>rhs</code> that
would cause the shift to exceed the bitwidth of the type.</p>
<p>Note that this is <em>not</em> the same as a rotate-left; the
RHS of a wrapping shift-left is restricted to the range
of the type, rather than the bits shifted out of the LHS
being returned to the other end. The primitive integer
types all implement a <code>rotate_left</code> function, which may
be what you want instead.</p>
<h1 id='examples-27' class='section-header'><a href='#examples-27'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>1u8</span>.<span class='ident'>wrapping_shl</span>(<span class='number'>7</span>), <span class='number'>128</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>1u8</span>.<span class='ident'>wrapping_shl</span>(<span class='number'>8</span>), <span class='number'>1</span>);</pre>
</div><h4 id='method.wrapping_shr' class='method'><code>fn <a href='#method.wrapping_shr' class='fnname'>wrapping_shr</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div></h4>
<div class='docblock'><p>Panic-free bitwise shift-right; yields <code>self &gt;&gt; mask(rhs)</code>,
where <code>mask</code> removes any high-order bits of <code>rhs</code> that
would cause the shift to exceed the bitwidth of the type.</p>
<p>Note that this is <em>not</em> the same as a rotate-right; the
RHS of a wrapping shift-right is restricted to the range
of the type, rather than the bits shifted out of the LHS
being returned to the other end. The primitive integer
types all implement a <code>rotate_right</code> function, which may
be what you want instead.</p>
<h1 id='examples-28' class='section-header'><a href='#examples-28'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>128u8</span>.<span class='ident'>wrapping_shr</span>(<span class='number'>7</span>), <span class='number'>1</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>128u8</span>.<span class='ident'>wrapping_shr</span>(<span class='number'>8</span>), <span class='number'>128</span>);</pre>
</div><h4 id='method.overflowing_add' class='method'><code>fn <a href='#method.overflowing_add' class='fnname'>overflowing_add</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Calculates <code>self</code> + <code>rhs</code></p>
<p>Returns a tuple of the addition along with a boolean indicating
whether an arithmetic overflow would occur. If an overflow would
have occurred then the wrapped value is returned.</p>
<h1 id='examples-29' class='section-header'><a href='#examples-29'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>u32</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>overflowing_add</span>(<span class='number'>2</span>), (<span class='number'>7</span>, <span class='bool-val'>false</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>u32</span>::<span class='ident'>MAX</span>.<span class='ident'>overflowing_add</span>(<span class='number'>1</span>), (<span class='number'>0</span>, <span class='bool-val'>true</span>));</pre>
</div><h4 id='method.overflowing_sub' class='method'><code>fn <a href='#method.overflowing_sub' class='fnname'>overflowing_sub</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Calculates <code>self</code> - <code>rhs</code></p>
<p>Returns a tuple of the subtraction along with a boolean indicating
whether an arithmetic overflow would occur. If an overflow would
have occurred then the wrapped value is returned.</p>
<h1 id='examples-30' class='section-header'><a href='#examples-30'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>u32</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>overflowing_sub</span>(<span class='number'>2</span>), (<span class='number'>3</span>, <span class='bool-val'>false</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0u32</span>.<span class='ident'>overflowing_sub</span>(<span class='number'>1</span>), (<span class='ident'>u32</span>::<span class='ident'>MAX</span>, <span class='bool-val'>true</span>));</pre>
</div><h4 id='method.overflowing_mul' class='method'><code>fn <a href='#method.overflowing_mul' class='fnname'>overflowing_mul</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Calculates the multiplication of <code>self</code> and <code>rhs</code>.</p>
<p>Returns a tuple of the multiplication along with a boolean
indicating whether an arithmetic overflow would occur. If an
overflow would have occurred then the wrapped value is returned.</p>
<h1 id='examples-31' class='section-header'><a href='#examples-31'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>overflowing_mul</span>(<span class='number'>2</span>), (<span class='number'>10</span>, <span class='bool-val'>false</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>1_000_000_000u32</span>.<span class='ident'>overflowing_mul</span>(<span class='number'>10</span>), (<span class='number'>1410065408</span>, <span class='bool-val'>true</span>));</pre>
</div><h4 id='method.overflowing_div' class='method'><code>fn <a href='#method.overflowing_div' class='fnname'>overflowing_div</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Calculates the divisor when <code>self</code> is divided by <code>rhs</code>.</p>
<p>Returns a tuple of the divisor along with a boolean indicating
whether an arithmetic overflow would occur. Note that for unsigned
integers overflow never occurs, so the second value is always
<code>false</code>.</p>
<h1 id='panics' class='section-header'><a href='#panics'>Panics</a></h1>
<p>This function will panic if <code>rhs</code> is 0.</p>
<h1 id='examples-32' class='section-header'><a href='#examples-32'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>overflowing_div</span>(<span class='number'>2</span>), (<span class='number'>2</span>, <span class='bool-val'>false</span>));</pre>
</div><h4 id='method.overflowing_rem' class='method'><code>fn <a href='#method.overflowing_rem' class='fnname'>overflowing_rem</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Calculates the remainder when <code>self</code> is divided by <code>rhs</code>.</p>
<p>Returns a tuple of the remainder after dividing along with a boolean
indicating whether an arithmetic overflow would occur. Note that for
unsigned integers overflow never occurs, so the second value is
always <code>false</code>.</p>
<h1 id='panics-1' class='section-header'><a href='#panics-1'>Panics</a></h1>
<p>This function will panic if <code>rhs</code> is 0.</p>
<h1 id='examples-33' class='section-header'><a href='#examples-33'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5u32</span>.<span class='ident'>overflowing_rem</span>(<span class='number'>2</span>), (<span class='number'>1</span>, <span class='bool-val'>false</span>));</pre>
</div><h4 id='method.overflowing_neg' class='method'><code>fn <a href='#method.overflowing_neg' class='fnname'>overflowing_neg</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Negates self in an overflowing fashion.</p>
<p>Returns <code>!self + 1</code> using wrapping operations to return the value
that represents the negation of this unsigned value. Note that for
positive unsigned values overflow always occurs, but negating 0 does
not overflow.</p>
<h1 id='examples-34' class='section-header'><a href='#examples-34'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0u32</span>.<span class='ident'>overflowing_neg</span>(), (<span class='number'>0</span>, <span class='bool-val'>false</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>2u32</span>.<span class='ident'>overflowing_neg</span>(), (<span class='op'>-</span><span class='number'>2i32</span> <span class='kw'>as</span> <span class='ident'>u32</span>, <span class='bool-val'>true</span>));</pre>
</div><h4 id='method.overflowing_shl' class='method'><code>fn <a href='#method.overflowing_shl' class='fnname'>overflowing_shl</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Shifts self left by <code>rhs</code> bits.</p>
<p>Returns a tuple of the shifted version of self along with a boolean
indicating whether the shift value was larger than or equal to the
number of bits. If the shift value is too large, then value is
masked (N-1) where N is the number of bits, and this value is then
used to perform the shift.</p>
<h1 id='examples-35' class='section-header'><a href='#examples-35'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>overflowing_shl</span>(<span class='number'>4</span>), (<span class='number'>0x100</span>, <span class='bool-val'>false</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>overflowing_shl</span>(<span class='number'>36</span>), (<span class='number'>0x100</span>, <span class='bool-val'>true</span>));</pre>
</div><h4 id='method.overflowing_shr' class='method'><code>fn <a href='#method.overflowing_shr' class='fnname'>overflowing_shr</a>(self, rhs: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div></h4>
<div class='docblock'><p>Shifts self right by <code>rhs</code> bits.</p>
<p>Returns a tuple of the shifted version of self along with a boolean
indicating whether the shift value was larger than or equal to the
number of bits. If the shift value is too large, then value is
masked (N-1) where N is the number of bits, and this value is then
used to perform the shift.</p>
<h1 id='examples-36' class='section-header'><a href='#examples-36'>Examples</a></h1>
<p>Basic usage</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>overflowing_shr</span>(<span class='number'>4</span>), (<span class='number'>0x1</span>, <span class='bool-val'>false</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>0x10u32</span>.<span class='ident'>overflowing_shr</span>(<span class='number'>36</span>), (<span class='number'>0x1</span>, <span class='bool-val'>true</span>));</pre>
</div><h4 id='method.pow' class='method'><code>fn <a href='#method.pow' class='fnname'>pow</a>(self, exp: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Raises self to the power of <code>exp</code>, using exponentiation by squaring.</p>
<h1 id='examples-37' class='section-header'><a href='#examples-37'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>2u32</span>.<span class='ident'>pow</span>(<span class='number'>4</span>), <span class='number'>16</span>);</pre>
</div><h4 id='method.is_power_of_two' class='method'><code>fn <a href='#method.is_power_of_two' class='fnname'>is_power_of_two</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns <code>true</code> if and only if <code>self == 2^k</code> for some <code>k</code>.</p>
<h1 id='examples-38' class='section-header'><a href='#examples-38'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='number'>16u8</span>.<span class='ident'>is_power_of_two</span>());
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='number'>10u8</span>.<span class='ident'>is_power_of_two</span>());</pre>
</div><h4 id='method.next_power_of_two' class='method'><code>fn <a href='#method.next_power_of_two' class='fnname'>next_power_of_two</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the smallest power of two greater than or equal to <code>self</code>.
Unspecified behavior on overflow.</p>
<h1 id='examples-39' class='section-header'><a href='#examples-39'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>2u8</span>.<span class='ident'>next_power_of_two</span>(), <span class='number'>2</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>3u8</span>.<span class='ident'>next_power_of_two</span>(), <span class='number'>4</span>);</pre>
</div><h4 id='method.checked_next_power_of_two' class='method'><code>fn <a href='#method.checked_next_power_of_two' class='fnname'>checked_next_power_of_two</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the smallest power of two greater than or equal to <code>n</code>. If
the next power of two is greater than the type&#39;s maximum value,
<code>None</code> is returned, otherwise the power of two is wrapped in <code>Some</code>.</p>
<h1 id='examples-40' class='section-header'><a href='#examples-40'>Examples</a></h1>
<p>Basic usage:</p>
<pre class='rust rust-example-rendered'>
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>2u8</span>.<span class='ident'>checked_next_power_of_two</span>(), <span class='prelude-val'>Some</span>(<span class='number'>2</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>3u8</span>.<span class='ident'>checked_next_power_of_two</span>(), <span class='prelude-val'>Some</span>(<span class='number'>4</span>));
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>200u8</span>.<span class='ident'>checked_next_power_of_two</span>(), <span class='prelude-val'>None</span>);</pre>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>&lt;<a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a>&gt; for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>,&nbsp;<a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt;</code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Deref.html' title='core::ops::Deref'>Deref</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='associatedtype.Target' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Deref.html#associatedtype.Target' class='type'>Target</a> = <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code></h4>
<div class='docblock'><p>The resulting type after dereferencing</p>
</div><h4 id='method.deref' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code></h4>
<div class='docblock'><p>The method called to dereference a value</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.DerefMut.html' title='core::ops::DerefMut'>DerefMut</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.deref_mut' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&amp;mut self) -&gt; &amp;mut <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code></h4>
</div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../iron/headers/trait.Header.html' title='iron::headers::Header'>Header</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.header_name' class='method'><code>fn <a href='../../iron/headers/trait.Header.html#tymethod.header_name' class='fnname'>header_name</a>() -&gt; &amp;'static <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a></code></h4>
<div class='docblock'><p>Returns the name of the header field this belongs to. <a href="../../iron/headers/trait.Header.html#tymethod.header_name">Read more</a></p>
</div><h4 id='method.parse_header' class='method'><code>fn <a href='../../iron/headers/trait.Header.html#tymethod.parse_header' class='fnname'>parse_header</a>(raw: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>&gt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a>,&nbsp;<a class='enum' href='../../iron/error/enum.HttpError.html' title='iron::error::HttpError'>Error</a>&gt;</code></h4>
<div class='docblock'><p>Parse a header from a raw stream of bytes. <a href="../../iron/headers/trait.Header.html#tymethod.parse_header">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../iron/headers/trait.HeaderFormat.html' title='iron::headers::HeaderFormat'>HeaderFormat</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.fmt_header' class='method'><code>fn <a href='../../iron/headers/trait.HeaderFormat.html#tymethod.fmt_header' class='fnname'>fmt_header</a>(&amp;self, f: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>,&nbsp;<a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt;</code></h4>
<div class='docblock'><p>Format a header to be output into a TcpStream. <a href="../../iron/headers/trait.HeaderFormat.html#tymethod.fmt_header">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='struct' href='../../iron/headers/struct.AccessControlMaxAge.html' title='iron::headers::AccessControlMaxAge'>AccessControlMaxAge</a></code></span><span class='out-of-band'></span></h3>
<div class='impl-items'><h4 id='method.fmt-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>,&nbsp;<a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt;</code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></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>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</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 = "iron";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>