Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 4e2dbb669434a7691662cb2f0ad38972 > files > 14198

rust-doc-1.28.0-1.mga6.armv7hl.rpm

<!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 `char` primitive in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, char"><title>char - 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><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"></head><body class="rustdoc primitive"><!--[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">&#9776;</div><a href='../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a><p class='location'>Primitive Type char</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.is_digit">is_digit</a><a href="#method.to_digit">to_digit</a><a href="#method.escape_unicode">escape_unicode</a><a href="#method.escape_debug">escape_debug</a><a href="#method.escape_default">escape_default</a><a href="#method.len_utf8">len_utf8</a><a href="#method.len_utf16">len_utf16</a><a href="#method.encode_utf8">encode_utf8</a><a href="#method.encode_utf16">encode_utf16</a><a href="#method.is_alphabetic">is_alphabetic</a><a href="#method.is_xid_start">is_xid_start</a><a href="#method.is_xid_continue">is_xid_continue</a><a href="#method.is_lowercase">is_lowercase</a><a href="#method.is_uppercase">is_uppercase</a><a href="#method.is_whitespace">is_whitespace</a><a href="#method.is_alphanumeric">is_alphanumeric</a><a href="#method.is_control">is_control</a><a href="#method.is_numeric">is_numeric</a><a href="#method.to_lowercase">to_lowercase</a><a href="#method.to_uppercase">to_uppercase</a><a href="#method.is_ascii">is_ascii</a><a href="#method.to_ascii_uppercase">to_ascii_uppercase</a><a href="#method.to_ascii_lowercase">to_ascii_lowercase</a><a href="#method.eq_ignore_ascii_case">eq_ignore_ascii_case</a><a href="#method.make_ascii_uppercase">make_ascii_uppercase</a><a href="#method.make_ascii_lowercase">make_ascii_lowercase</a><a href="#method.is_ascii_alphabetic">is_ascii_alphabetic</a><a href="#method.is_ascii_uppercase">is_ascii_uppercase</a><a href="#method.is_ascii_lowercase">is_ascii_lowercase</a><a href="#method.is_ascii_alphanumeric">is_ascii_alphanumeric</a><a href="#method.is_ascii_digit">is_ascii_digit</a><a href="#method.is_ascii_hexdigit">is_ascii_hexdigit</a><a href="#method.is_ascii_punctuation">is_ascii_punctuation</a><a href="#method.is_ascii_graphic">is_ascii_graphic</a><a href="#method.is_ascii_whitespace">is_ascii_whitespace</a><a href="#method.is_ascii_control">is_ascii_control</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Display">Display</a><a href="#impl-PartialEq%3Cchar%3E">PartialEq&lt;char&gt;</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialOrd%3Cchar%3E">PartialOrd&lt;char&gt;</a><a href="#impl-Debug">Debug</a><a href="#impl-TryFrom%3Cu32%3E">TryFrom&lt;u32&gt;</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-Eq">Eq</a><a href="#impl-Clone">Clone</a><a href="#impl-From%3Cu8%3E">From&lt;u8&gt;</a><a href="#impl-Copy">Copy</a><a href="#impl-Pattern%3C%27a%3E">Pattern&lt;&#39;a&gt;</a><a href="#impl-Default">Default</a><a href="#impl-AsciiExt">AsciiExt</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>std</a></p><script>window.sidebarCurrent = {name: 'char', ty: 'primitive', 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 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"><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='in-band'>Primitive Type <a class="primitive" href=''>char</a></span><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'>&#x2212;</span>]</a></span></span></h1><div class='docblock'><p>A character type.</p>
<p>The <code>char</code> type represents a single character. More specifically, since
'character' isn't a well-defined concept in Unicode, <code>char</code> is a '<a href="http://www.unicode.org/glossary/#unicode_scalar_value">Unicode
scalar value</a>', which is similar to, but not the same as, a '<a href="http://www.unicode.org/glossary/#code_point">Unicode code
point</a>'.</p>
<p>This documentation describes a number of methods and trait implementations on the
<code>char</code> type. For technical reasons, there is additional, separate
documentation in <a href="char/index.html">the <code>std::char</code> module</a> as well.</p>
<h1 id="representation" class="section-header"><a href="#representation">Representation</a></h1>
<p><code>char</code> is always four bytes in size. This is a different representation than
a given character would have as part of a <a href="string/struct.String.html"><code>String</code></a>. For example:</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">v</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&#39;h&#39;</span>, <span class="string">&#39;e&#39;</span>, <span class="string">&#39;l&#39;</span>, <span class="string">&#39;l&#39;</span>, <span class="string">&#39;o&#39;</span>];

<span class="comment">// five elements times four bytes for each element</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">20</span>, <span class="ident">v</span>.<span class="ident">len</span>() <span class="op">*</span> <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">size_of</span>::<span class="op">&lt;</span><span class="ident">char</span><span class="op">&gt;</span>());

<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;hello&quot;</span>);

<span class="comment">// five elements times one byte per element</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">5</span>, <span class="ident">s</span>.<span class="ident">len</span>() <span class="op">*</span> <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">size_of</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20v%20%3D%20vec!%5B'h'%2C%20'e'%2C%20'l'%2C%20'l'%2C%20'o'%5D%3B%0A%0A%2F%2F%20five%20elements%20times%20four%20bytes%20for%20each%20element%0Aassert_eq!(20%2C%20v.len()%20*%20std%3A%3Amem%3A%3Asize_of%3A%3A%3Cchar%3E())%3B%0A%0Alet%20s%20%3D%20String%3A%3Afrom(%22hello%22)%3B%0A%0A%2F%2F%20five%20elements%20times%20one%20byte%20per%20element%0Aassert_eq!(5%2C%20s.len()%20*%20std%3A%3Amem%3A%3Asize_of%3A%3A%3Cu8%3E())%3B%0A%7D">Run</a></pre>
<p>As always, remember that a human intuition for 'character' may not map to
Unicode's definitions. For example, despite looking similar, the 'é'
character is one Unicode code point while 'é' is two Unicode code points:</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">chars</span> <span class="op">=</span> <span class="string">&quot;é&quot;</span>.<span class="ident">chars</span>();
<span class="comment">// U+00e9: &#39;latin small letter e with acute&#39;</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="string">&#39;\u{00e9}&#39;</span>), <span class="ident">chars</span>.<span class="ident">next</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">chars</span>.<span class="ident">next</span>());

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">chars</span> <span class="op">=</span> <span class="string">&quot;é&quot;</span>.<span class="ident">chars</span>();
<span class="comment">// U+0065: &#39;latin small letter e&#39;</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="string">&#39;\u{0065}&#39;</span>), <span class="ident">chars</span>.<span class="ident">next</span>());
<span class="comment">// U+0301: &#39;combining acute accent&#39;</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="string">&#39;\u{0301}&#39;</span>), <span class="ident">chars</span>.<span class="ident">next</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">chars</span>.<span class="ident">next</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20mut%20chars%20%3D%20%22%C3%A9%22.chars()%3B%0A%2F%2F%20U%2B00e9%3A%20'latin%20small%20letter%20e%20with%20acute'%0Aassert_eq!(Some('%5Cu%7B00e9%7D')%2C%20chars.next())%3B%0Aassert_eq!(None%2C%20chars.next())%3B%0A%0Alet%20mut%20chars%20%3D%20%22e%CC%81%22.chars()%3B%0A%2F%2F%20U%2B0065%3A%20'latin%20small%20letter%20e'%0Aassert_eq!(Some('%5Cu%7B0065%7D')%2C%20chars.next())%3B%0A%2F%2F%20U%2B0301%3A%20'combining%20acute%20accent'%0Aassert_eq!(Some('%5Cu%7B0301%7D')%2C%20chars.next())%3B%0Aassert_eq!(None%2C%20chars.next())%3B%0A%7D">Run</a></pre>
<p>This means that the contents of the first string above <em>will</em> fit into a
<code>char</code> while the contents of the second string <em>will not</em>. Trying to create
a <code>char</code> literal with the contents of the second string gives an error:</p>
<pre><code class="language-text">error: character literal may only contain one codepoint: 'é'
let c = 'é';
        ^^^^
</code></pre>
<p>Another implication of the 4-byte fixed size of a <code>char</code> is that
per-<code>char</code> processing can end up using a lot more memory:</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;love: ❤️&quot;</span>);
<span class="kw">let</span> <span class="ident">v</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">char</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">s</span>.<span class="ident">chars</span>().<span class="ident">collect</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">12</span>, <span class="ident">s</span>.<span class="ident">len</span>() <span class="op">*</span> <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">size_of</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">32</span>, <span class="ident">v</span>.<span class="ident">len</span>() <span class="op">*</span> <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">size_of</span>::<span class="op">&lt;</span><span class="ident">char</span><span class="op">&gt;</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20s%20%3D%20String%3A%3Afrom(%22love%3A%20%E2%9D%A4%EF%B8%8F%22)%3B%0Alet%20v%3A%20Vec%3Cchar%3E%20%3D%20s.chars().collect()%3B%0A%0Aassert_eq!(12%2C%20s.len()%20*%20std%3A%3Amem%3A%3Asize_of%3A%3A%3Cu8%3E())%3B%0Aassert_eq!(32%2C%20v.len()%20*%20std%3A%3Amem%3A%3Asize_of%3A%3A%3Cchar%3E())%3B%0A%7D">Run</a></pre>
</div>
                    <h2 id='methods' class='small-section-header'>
                      Methods<a href='#methods' class='anchor'></a>
                    </h2>
                <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#20-1415' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.is_digit' class="method"><span id='is_digit.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_digit' class='fnname'>is_digit</a>(self, radix: <a class="primitive" href="primitive.u32.html">u32</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#69-71' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if a <code>char</code> is a digit in the given radix.</p>
<p>A 'radix' here is sometimes also called a 'base'. A radix of two
indicates a binary number, a radix of ten, decimal, and a radix of
sixteen, hexadecimal, to give some common values. Arbitrary
radices are supported.</p>
<p>Compared to <code>is_numeric()</code>, this function only recognizes the characters
<code>0-9</code>, <code>a-z</code> and <code>A-Z</code>.</p>
<p>'Digit' is defined to be only the following characters:</p>
<ul>
<li><code>0-9</code></li>
<li><code>a-z</code></li>
<li><code>A-Z</code></li>
</ul>
<p>For a more comprehensive understanding of 'digit', see <a href="#method.is_numeric"><code>is_numeric</code></a>.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Panics if given a radix larger than 36.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;1&#39;</span>.<span class="ident">is_digit</span>(<span class="number">10</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;f&#39;</span>.<span class="ident">is_digit</span>(<span class="number">16</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;f&#39;</span>.<span class="ident">is_digit</span>(<span class="number">10</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!('1'.is_digit(10))%3B%0Aassert!('f'.is_digit(16))%3B%0Aassert!(!'f'.is_digit(10))%3B%0A%7D">Run</a></pre>
<p>Passing a large radix, causing a panic:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="comment">// this panics</span>
    <span class="string">&#39;1&#39;</span>.<span class="ident">is_digit</span>(<span class="number">37</span>);
}).<span class="ident">join</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">is_err</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Athread%3B%0A%0Alet%20result%20%3D%20thread%3A%3Aspawn(%7C%7C%20%7B%0A%20%20%20%20%2F%2F%20this%20panics%0A%20%20%20%20'1'.is_digit(37)%3B%0A%7D).join()%3B%0A%0Aassert!(result.is_err())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.to_digit' class="method"><span id='to_digit.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.to_digit' class='fnname'>to_digit</a>(self, radix: <a class="primitive" href="primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="primitive.u32.html">u32</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#123-135' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Converts a <code>char</code> to a digit in the given radix.</p>
<p>A 'radix' here is sometimes also called a 'base'. A radix of two
indicates a binary number, a radix of ten, decimal, and a radix of
sixteen, hexadecimal, to give some common values. Arbitrary
radices are supported.</p>
<p>'Digit' is defined to be only the following characters:</p>
<ul>
<li><code>0-9</code></li>
<li><code>a-z</code></li>
<li><code>A-Z</code></li>
</ul>
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
<p>Returns <code>None</code> if the <code>char</code> does not refer to a digit in the given radix.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<p>Panics if given a radix larger than 36.</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="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;1&#39;</span>.<span class="ident">to_digit</span>(<span class="number">10</span>), <span class="prelude-val">Some</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;f&#39;</span>.<span class="ident">to_digit</span>(<span class="number">16</span>), <span class="prelude-val">Some</span>(<span class="number">15</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('1'.to_digit(10)%2C%20Some(1))%3B%0Aassert_eq!('f'.to_digit(16)%2C%20Some(15))%3B%0A%7D">Run</a></pre>
<p>Passing a non-digit results in failure:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;f&#39;</span>.<span class="ident">to_digit</span>(<span class="number">10</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;z&#39;</span>.<span class="ident">to_digit</span>(<span class="number">16</span>), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('f'.to_digit(10)%2C%20None)%3B%0Aassert_eq!('z'.to_digit(16)%2C%20None)%3B%0A%7D">Run</a></pre>
<p>Passing a large radix, causing a panic:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="string">&#39;1&#39;</span>.<span class="ident">to_digit</span>(<span class="number">37</span>);
}).<span class="ident">join</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">is_err</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Athread%3B%0A%0Alet%20result%20%3D%20thread%3A%3Aspawn(%7C%7C%20%7B%0A%20%20%20%20'1'.to_digit(37)%3B%0A%7D).join()%3B%0A%0Aassert!(result.is_err())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.escape_unicode' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../std/char/struct.EscapeUnicode.html" title="struct std::char::EscapeUnicode">EscapeUnicode</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../std/char/struct.EscapeUnicode.html" title="struct std::char::EscapeUnicode">EscapeUnicode</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../std/char/struct.EscapeUnicode.html" title="struct std::char::EscapeUnicode">EscapeUnicode</a></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="primitive.char.html">char</a>;</span></code></div></div><span id='escape_unicode.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.escape_unicode' class='fnname'>escape_unicode</a>(self) -&gt; <a class="struct" href="../std/char/struct.EscapeUnicode.html" title="struct std::char::EscapeUnicode">EscapeUnicode</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#173-188' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns an iterator that yields the hexadecimal Unicode escape of a
character as <code>char</code>s.</p>
<p>This will escape characters with the Rust syntax of the form
<code>\u{NNNNNN}</code> where <code>NNNNNN</code> is a hexadecimal representation.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<p>As an iterator:</p>

<pre class="rust rust-example-rendered">
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="string">&#39;❤&#39;</span>.<span class="ident">escape_unicode</span>() {
    <span class="macro">print</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">c</span>);
}
<span class="macro">println</span><span class="macro">!</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Afor%20c%20in%20'%E2%9D%A4'.escape_unicode()%20%7B%0A%20%20%20%20print!(%22%7B%7D%22%2C%20c)%3B%0A%7D%0Aprintln!()%3B%0A%7D">Run</a></pre>
<p>Using <code>println!</code> directly:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="string">&#39;❤&#39;</span>.<span class="ident">escape_unicode</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%7B%7D%22%2C%20'%E2%9D%A4'.escape_unicode())%3B%0A%7D">Run</a></pre>
<p>Both are equivalent to:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;\\u{{2764}}&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%5C%5Cu%7B%7B2764%7D%7D%22)%3B%0A%7D">Run</a></pre>
<p>Using <code>to_string</code>:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;❤&#39;</span>.<span class="ident">escape_unicode</span>().<span class="ident">to_string</span>(), <span class="string">&quot;\\u{2764}&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('%E2%9D%A4'.escape_unicode().to_string()%2C%20%22%5C%5Cu%7B2764%7D%22)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.escape_debug' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../std/char/struct.EscapeDebug.html" title="struct std::char::EscapeDebug">EscapeDebug</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../std/char/struct.EscapeDebug.html" title="struct std::char::EscapeDebug">EscapeDebug</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../std/char/struct.EscapeDebug.html" title="struct std::char::EscapeDebug">EscapeDebug</a></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="primitive.char.html">char</a>;</span></code></div></div><span id='escape_debug.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.escape_debug' class='fnname'>escape_debug</a>(self) -&gt; <a class="struct" href="../std/char/struct.EscapeDebug.html" title="struct std::char::EscapeDebug">EscapeDebug</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.20.0'>1.20.0</div><a class='srclink' href='../src/core/char/methods.rs.html#247-249' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns an iterator that yields the literal escape code of a character
as <code>char</code>s.</p>
<p>This will escape the characters similar to the <code>Debug</code> implementations
of <code>str</code> or <code>char</code>.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<p>As an iterator:</p>

<pre class="rust rust-example-rendered">
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="string">&#39;\n&#39;</span>.<span class="ident">escape_debug</span>() {
    <span class="macro">print</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">c</span>);
}
<span class="macro">println</span><span class="macro">!</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Afor%20c%20in%20'%5Cn'.escape_debug()%20%7B%0A%20%20%20%20print!(%22%7B%7D%22%2C%20c)%3B%0A%7D%0Aprintln!()%3B%0A%7D">Run</a></pre>
<p>Using <code>println!</code> directly:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="string">&#39;\n&#39;</span>.<span class="ident">escape_debug</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%7B%7D%22%2C%20'%5Cn'.escape_debug())%3B%0A%7D">Run</a></pre>
<p>Both are equivalent to:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;\\n&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%5C%5Cn%22)%3B%0A%7D">Run</a></pre>
<p>Using <code>to_string</code>:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;\n&#39;</span>.<span class="ident">escape_debug</span>().<span class="ident">to_string</span>(), <span class="string">&quot;\\n&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('%5Cn'.escape_debug().to_string()%2C%20%22%5C%5Cn%22)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.escape_default' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../std/char/struct.EscapeDefault.html" title="struct std::char::EscapeDefault">EscapeDefault</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../std/char/struct.EscapeDefault.html" title="struct std::char::EscapeDefault">EscapeDefault</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../std/char/struct.EscapeDefault.html" title="struct std::char::EscapeDefault">EscapeDefault</a></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="primitive.char.html">char</a>;</span></code></div></div><span id='escape_default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.escape_default' class='fnname'>escape_default</a>(self) -&gt; <a class="struct" href="../std/char/struct.EscapeDefault.html" title="struct std::char::EscapeDefault">EscapeDefault</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#302-312' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns an iterator that yields the literal escape code of a character
as <code>char</code>s.</p>
<p>The default is chosen with a bias toward producing literals that are
legal in a variety of languages, including C++11 and similar C-family
languages. The exact rules are:</p>
<ul>
<li>Tab is escaped as <code>\t</code>.</li>
<li>Carriage return is escaped as <code>\r</code>.</li>
<li>Line feed is escaped as <code>\n</code>.</li>
<li>Single quote is escaped as <code>\'</code>.</li>
<li>Double quote is escaped as <code>\&quot;</code>.</li>
<li>Backslash is escaped as <code>\\</code>.</li>
<li>Any character in the 'printable ASCII' range <code>0x20</code> .. <code>0x7e</code>
inclusive is not escaped.</li>
<li>All other characters are given hexadecimal Unicode escapes; see
<a href="#method.escape_unicode"><code>escape_unicode</code></a>.</li>
</ul>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<p>As an iterator:</p>

<pre class="rust rust-example-rendered">
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="string">&#39;&quot;&#39;</span>.<span class="ident">escape_default</span>() {
    <span class="macro">print</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">c</span>);
}
<span class="macro">println</span><span class="macro">!</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Afor%20c%20in%20'%22'.escape_default()%20%7B%0A%20%20%20%20print!(%22%7B%7D%22%2C%20c)%3B%0A%7D%0Aprintln!()%3B%0A%7D">Run</a></pre>
<p>Using <code>println!</code> directly:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="string">&#39;&quot;&#39;</span>.<span class="ident">escape_default</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%7B%7D%22%2C%20'%22'.escape_default())%3B%0A%7D">Run</a></pre>
<p>Both are equivalent to:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;\\\&quot;&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%5C%5C%5C%22%22)%3B%0A%7D">Run</a></pre>
<p>Using <code>to_string</code>:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;&quot;&#39;</span>.<span class="ident">escape_default</span>().<span class="ident">to_string</span>(), <span class="string">&quot;\\\&quot;&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('%22'.escape_default().to_string()%2C%20%22%5C%5C%5C%22%22)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.len_utf8' class="method"><span id='len_utf8.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.len_utf8' class='fnname'>len_utf8</a>(self) -&gt; <a class="primitive" href="primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#361-372' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the number of bytes this <code>char</code> would need if encoded in UTF-8.</p>
<p>That number of bytes is always between 1 and 4, inclusive.</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">len</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>.<span class="ident">len_utf8</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">len</span>, <span class="number">1</span>);

<span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="string">&#39;ß&#39;</span>.<span class="ident">len_utf8</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">len</span>, <span class="number">2</span>);

<span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="string">&#39;ℝ&#39;</span>.<span class="ident">len_utf8</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">len</span>, <span class="number">3</span>);

<span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="string">&#39;💣&#39;</span>.<span class="ident">len_utf8</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">len</span>, <span class="number">4</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20len%20%3D%20'A'.len_utf8()%3B%0Aassert_eq!(len%2C%201)%3B%0A%0Alet%20len%20%3D%20'%C3%9F'.len_utf8()%3B%0Aassert_eq!(len%2C%202)%3B%0A%0Alet%20len%20%3D%20'%E2%84%9D'.len_utf8()%3B%0Aassert_eq!(len%2C%203)%3B%0A%0Alet%20len%20%3D%20'%F0%9F%92%A3'.len_utf8()%3B%0Aassert_eq!(len%2C%204)%3B%0A%7D">Run</a></pre>
<p>The <code>&amp;str</code> type guarantees that its contents are UTF-8, and so we can compare the length it
would take if each code point was represented as a <code>char</code> vs in the <code>&amp;str</code> itself:</p>

<pre class="rust rust-example-rendered">
<span class="comment">// as chars</span>
<span class="kw">let</span> <span class="ident">eastern</span> <span class="op">=</span> <span class="string">&#39;東&#39;</span>;
<span class="kw">let</span> <span class="ident">capitol</span> <span class="op">=</span> <span class="string">&#39;京&#39;</span>;

<span class="comment">// both can be represented as three bytes</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">3</span>, <span class="ident">eastern</span>.<span class="ident">len_utf8</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">3</span>, <span class="ident">capitol</span>.<span class="ident">len_utf8</span>());

<span class="comment">// as a &amp;str, these two are encoded in UTF-8</span>
<span class="kw">let</span> <span class="ident">tokyo</span> <span class="op">=</span> <span class="string">&quot;東京&quot;</span>;

<span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="ident">eastern</span>.<span class="ident">len_utf8</span>() <span class="op">+</span> <span class="ident">capitol</span>.<span class="ident">len_utf8</span>();

<span class="comment">// we can see that they take six bytes total...</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">6</span>, <span class="ident">tokyo</span>.<span class="ident">len</span>());

<span class="comment">// ... just like the &amp;str</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">len</span>, <span class="ident">tokyo</span>.<span class="ident">len</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%2F%2F%20as%20chars%0Alet%20eastern%20%3D%20'%E6%9D%B1'%3B%0Alet%20capitol%20%3D%20'%E4%BA%AC'%3B%0A%0A%2F%2F%20both%20can%20be%20represented%20as%20three%20bytes%0Aassert_eq!(3%2C%20eastern.len_utf8())%3B%0Aassert_eq!(3%2C%20capitol.len_utf8())%3B%0A%0A%2F%2F%20as%20a%20%26str%2C%20these%20two%20are%20encoded%20in%20UTF-8%0Alet%20tokyo%20%3D%20%22%E6%9D%B1%E4%BA%AC%22%3B%0A%0Alet%20len%20%3D%20eastern.len_utf8()%20%2B%20capitol.len_utf8()%3B%0A%0A%2F%2F%20we%20can%20see%20that%20they%20take%20six%20bytes%20total...%0Aassert_eq!(6%2C%20tokyo.len())%3B%0A%0A%2F%2F%20...%20just%20like%20the%20%26str%0Aassert_eq!(len%2C%20tokyo.len())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.len_utf16' class="method"><span id='len_utf16.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.len_utf16' class='fnname'>len_utf16</a>(self) -&gt; <a class="primitive" href="primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#395-398' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the number of 16-bit code units this <code>char</code> would need if
encoded in UTF-16.</p>
<p>See the documentation for <a href="#method.len_utf8"><code>len_utf8</code></a> for more explanation of this
concept. This function is a mirror, but for UTF-16 instead of UTF-8.</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="string">&#39;ß&#39;</span>.<span class="ident">len_utf16</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">n</span>, <span class="number">1</span>);

<span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> <span class="string">&#39;💣&#39;</span>.<span class="ident">len_utf16</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">len</span>, <span class="number">2</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20n%20%3D%20'%C3%9F'.len_utf16()%3B%0Aassert_eq!(n%2C%201)%3B%0A%0Alet%20len%20%3D%20'%F0%9F%92%A3'.len_utf16()%3B%0Aassert_eq!(len%2C%202)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.encode_utf8' class="method"><span id='encode_utf8.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.encode_utf8' class='fnname'>encode_utf8</a>(self, dst: <a class="primitive" href="primitive.slice.html">&amp;mut [</a><a class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a>) -&gt; &amp;mut <a class="primitive" href="primitive.str.html">str</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.15.0'>1.15.0</div><a class='srclink' href='../src/core/char/methods.rs.html#438-468' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Encodes this character as UTF-8 into the provided byte buffer,
and then returns the subslice of the buffer that contains the encoded character.</p>
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
<p>Panics if the buffer is not large enough.
A buffer of length four is large enough to encode any <code>char</code>.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
<p>In both of these examples, 'ß' takes two bytes to encode.</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">2</span>];

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="string">&#39;ß&#39;</span>.<span class="ident">encode_utf8</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">b</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>, <span class="string">&quot;ß&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">len</span>(), <span class="number">2</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20mut%20b%20%3D%20%5B0%3B%202%5D%3B%0A%0Alet%20result%20%3D%20'%C3%9F'.encode_utf8(%26mut%20b)%3B%0A%0Aassert_eq!(result%2C%20%22%C3%9F%22)%3B%0A%0Aassert_eq!(result.len()%2C%202)%3B%0A%7D">Run</a></pre>
<p>A buffer that's too small:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">1</span>];

    <span class="comment">// this panics</span>
   <span class="string">&#39;ß&#39;</span>.<span class="ident">encode_utf8</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">b</span>);
}).<span class="ident">join</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">is_err</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Athread%3B%0A%0Alet%20result%20%3D%20thread%3A%3Aspawn(%7C%7C%20%7B%0A%20%20%20%20let%20mut%20b%20%3D%20%5B0%3B%201%5D%3B%0A%0A%20%20%20%20%2F%2F%20this%20panics%0A%20%20%20'%C3%9F'.encode_utf8(%26mut%20b)%3B%0A%7D).join()%3B%0A%0Aassert!(result.is_err())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.encode_utf16' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="primitive.slice.html">&amp;'a [</a><a class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="primitive.slice.html">&amp;'a [</a><a class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a></h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="primitive.slice.html">&amp;'a [</a><a class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a></span><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="primitive.slice.html">&amp;'a mut [</a><a class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a></span></code></div></div><span id='encode_utf16.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.encode_utf16' class='fnname'>encode_utf16</a>(self, dst: <a class="primitive" href="primitive.slice.html">&amp;mut [</a><a class="primitive" href="primitive.u16.html">u16</a><a class="primitive" href="primitive.slice.html">]</a>) -&gt; <a class="primitive" href="primitive.slice.html">&amp;mut [</a><a class="primitive" href="primitive.u16.html">u16</a><a class="primitive" href="primitive.slice.html">]</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.15.0'>1.15.0</div><a class='srclink' href='../src/core/char/methods.rs.html#506-526' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Encodes this character as UTF-16 into the provided <code>u16</code> buffer,
and then returns the subslice of the buffer that contains the encoded character.</p>
<h1 id="panics-3" class="section-header"><a href="#panics-3">Panics</a></h1>
<p>Panics if the buffer is not large enough.
A buffer of length 2 is large enough to encode any <code>char</code>.</p>
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
<p>In both of these examples, '𝕊' takes two <code>u16</code>s to encode.</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">2</span>];

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="string">&#39;𝕊&#39;</span>.<span class="ident">encode_utf16</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">b</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">len</span>(), <span class="number">2</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20mut%20b%20%3D%20%5B0%3B%202%5D%3B%0A%0Alet%20result%20%3D%20'%F0%9D%95%8A'.encode_utf16(%26mut%20b)%3B%0A%0Aassert_eq!(result.len()%2C%202)%3B%0A%7D">Run</a></pre>
<p>A buffer that's too small:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">1</span>];

    <span class="comment">// this panics</span>
    <span class="string">&#39;𝕊&#39;</span>.<span class="ident">encode_utf16</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">b</span>);
}).<span class="ident">join</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">is_err</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Athread%3B%0A%0Alet%20result%20%3D%20thread%3A%3Aspawn(%7C%7C%20%7B%0A%20%20%20%20let%20mut%20b%20%3D%20%5B0%3B%201%5D%3B%0A%0A%20%20%20%20%2F%2F%20this%20panics%0A%20%20%20%20'%F0%9D%95%8A'.encode_utf16(%26mut%20b)%3B%0A%7D).join()%3B%0A%0Aassert!(result.is_err())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_alphabetic' class="method"><span id='is_alphabetic.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_alphabetic' class='fnname'>is_alphabetic</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#544-550' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is an alphabetic code point, and false if not.</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="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;a&#39;</span>.<span class="ident">is_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;京&#39;</span>.<span class="ident">is_alphabetic</span>());

<span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="string">&#39;💝&#39;</span>;
<span class="comment">// love is many things, but it is not alphabetic</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">c</span>.<span class="ident">is_alphabetic</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!('a'.is_alphabetic())%3B%0Aassert!('%E4%BA%AC'.is_alphabetic())%3B%0A%0Alet%20c%20%3D%20'%F0%9F%92%9D'%3B%0A%2F%2F%20love%20is%20many%20things%2C%20but%20it%20is%20not%20alphabetic%0Aassert!(!c.is_alphabetic())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_xid_start' class="method"><span id='is_xid_start.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_xid_start' class='fnname'>is_xid_start</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#562-564' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>rustc_private </code><a href="https://github.com/rust-lang/rust/issues/27812">#27812</a>)</summary><p>mainly needed for compiler internals</p>
</details></div></div><div class='docblock'><p>Returns true if this <code>char</code> satisfies the 'XID_Start' Unicode property, and false
otherwise.</p>
<p>'XID_Start' is a Unicode Derived Property specified in
<a href="http://unicode.org/reports/tr31/#NFKC_Modifications">UAX #31</a>,
mostly similar to <code>ID_Start</code> but modified for closure under <code>NFKx</code>.</p>
</div><h4 id='method.is_xid_continue' class="method"><span id='is_xid_continue.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_xid_continue' class='fnname'>is_xid_continue</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#576-578' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>rustc_private </code><a href="https://github.com/rust-lang/rust/issues/27812">#27812</a>)</summary><p>mainly needed for compiler internals</p>
</details></div></div><div class='docblock'><p>Returns true if this <code>char</code> satisfies the 'XID_Continue' Unicode property, and false
otherwise.</p>
<p>'XID_Continue' is a Unicode Derived Property specified in
<a href="http://unicode.org/reports/tr31/#NFKC_Modifications">UAX #31</a>,
mostly similar to 'ID_Continue' but modified for closure under NFKx.</p>
</div><h4 id='method.is_lowercase' class="method"><span id='is_lowercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_lowercase' class='fnname'>is_lowercase</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#600-606' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is lowercase, and false otherwise.</p>
<p>'Lowercase' is defined according to the terms of the Unicode Derived Core
Property <code>Lowercase</code>.</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</span><span class="macro">!</span>(<span class="string">&#39;a&#39;</span>.<span class="ident">is_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;δ&#39;</span>.<span class="ident">is_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;A&#39;</span>.<span class="ident">is_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;Δ&#39;</span>.<span class="ident">is_lowercase</span>());

<span class="comment">// The various Chinese scripts do not have case, and so:</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;中&#39;</span>.<span class="ident">is_lowercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!('a'.is_lowercase())%3B%0Aassert!('%CE%B4'.is_lowercase())%3B%0Aassert!(!'A'.is_lowercase())%3B%0Aassert!(!'%CE%94'.is_lowercase())%3B%0A%0A%2F%2F%20The%20various%20Chinese%20scripts%20do%20not%20have%20case%2C%20and%20so%3A%0Aassert!(!'%E4%B8%AD'.is_lowercase())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_uppercase' class="method"><span id='is_uppercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_uppercase' class='fnname'>is_uppercase</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#628-634' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is uppercase, and false otherwise.</p>
<p>'Uppercase' is defined according to the terms of the Unicode Derived Core
Property <code>Uppercase</code>.</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</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;a&#39;</span>.<span class="ident">is_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;δ&#39;</span>.<span class="ident">is_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;A&#39;</span>.<span class="ident">is_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;Δ&#39;</span>.<span class="ident">is_uppercase</span>());

<span class="comment">// The various Chinese scripts do not have case, and so:</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;中&#39;</span>.<span class="ident">is_uppercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!(!'a'.is_uppercase())%3B%0Aassert!(!'%CE%B4'.is_uppercase())%3B%0Aassert!('A'.is_uppercase())%3B%0Aassert!('%CE%94'.is_uppercase())%3B%0A%0A%2F%2F%20The%20various%20Chinese%20scripts%20do%20not%20have%20case%2C%20and%20so%3A%0Aassert!(!'%E4%B8%AD'.is_uppercase())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_whitespace' class="method"><span id='is_whitespace.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_whitespace' class='fnname'>is_whitespace</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#655-661' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is whitespace, and false otherwise.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived Core
Property <code>White_Space</code>.</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</span><span class="macro">!</span>(<span class="string">&#39; &#39;</span>.<span class="ident">is_whitespace</span>());

<span class="comment">// a non-breaking space</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;\u{A0}&#39;</span>.<span class="ident">is_whitespace</span>());

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;越&#39;</span>.<span class="ident">is_whitespace</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!('%20'.is_whitespace())%3B%0A%0A%2F%2F%20a%20non-breaking%20space%0Aassert!('%5Cu%7BA0%7D'.is_whitespace())%3B%0A%0Aassert!(!'%E8%B6%8A'.is_whitespace())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_alphanumeric' class="method"><span id='is_alphanumeric.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_alphanumeric' class='fnname'>is_alphanumeric</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#684-686' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is alphanumeric, and false otherwise.</p>
<p>'Alphanumeric'-ness is defined in terms of the Unicode General Categories
'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'.</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</span><span class="macro">!</span>(<span class="string">&#39;٣&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;7&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;৬&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;K&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;و&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;藏&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;¾&#39;</span>.<span class="ident">is_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;①&#39;</span>.<span class="ident">is_alphanumeric</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!('%D9%A3'.is_alphanumeric())%3B%0Aassert!('7'.is_alphanumeric())%3B%0Aassert!('%E0%A7%AC'.is_alphanumeric())%3B%0Aassert!('K'.is_alphanumeric())%3B%0Aassert!('%D9%88'.is_alphanumeric())%3B%0Aassert!('%E8%97%8F'.is_alphanumeric())%3B%0Aassert!(!'%C2%BE'.is_alphanumeric())%3B%0Aassert!(!'%E2%91%A0'.is_alphanumeric())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_control' class="method"><span id='is_control.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_control' class='fnname'>is_control</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#704-706' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is a control code point, and false otherwise.</p>
<p>'Control code point' is defined in terms of the Unicode General
Category <code>Cc</code>.</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="comment">// U+009C, STRING TERMINATOR</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;œ&#39;</span>.<span class="ident">is_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;q&#39;</span>.<span class="ident">is_control</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%2F%2F%20U%2B009C%2C%20STRING%20TERMINATOR%0Aassert!('%C2%9C'.is_control())%3B%0Aassert!(!'q'.is_control())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_numeric' class="method"><span id='is_numeric.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_numeric' class='fnname'>is_numeric</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#738-744' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if this <code>char</code> is numeric, and false otherwise.</p>
<p>'Numeric'-ness is defined in terms of the Unicode General Categories
'Nd', 'Nl', 'No'.</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</span><span class="macro">!</span>(<span class="string">&#39;٣&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;7&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&#39;৬&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;K&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;و&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;藏&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;¾&#39;</span>.<span class="ident">is_numeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="string">&#39;①&#39;</span>.<span class="ident">is_numeric</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert!('%D9%A3'.is_numeric())%3B%0Aassert!('7'.is_numeric())%3B%0Aassert!('%E0%A7%AC'.is_numeric())%3B%0Aassert!(!'K'.is_numeric())%3B%0Aassert!(!'%D9%88'.is_numeric())%3B%0Aassert!(!'%E8%97%8F'.is_numeric())%3B%0Aassert!(!'%C2%BE'.is_numeric())%3B%0Aassert!(!'%E2%91%A0'.is_numeric())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.to_lowercase' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../std/char/struct.ToLowercase.html" title="struct std::char::ToLowercase">ToLowercase</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../std/char/struct.ToLowercase.html" title="struct std::char::ToLowercase">ToLowercase</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../std/char/struct.ToLowercase.html" title="struct std::char::ToLowercase">ToLowercase</a></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="primitive.char.html">char</a>;</span></code></div></div><span id='to_lowercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.to_lowercase' class='fnname'>to_lowercase</a>(self) -&gt; <a class="struct" href="../std/char/struct.ToLowercase.html" title="struct std::char::ToLowercase">ToLowercase</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#803-805' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns an iterator that yields the lowercase equivalent of a <code>char</code>
as one or more <code>char</code>s.</p>
<p>If a character does not have a lowercase equivalent, the same character
will be returned back by the iterator.</p>
<p>This performs complex unconditional mappings with no tailoring: it maps
one Unicode character to its lowercase equivalent according to the
<a href="ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt">Unicode database</a> and the additional complex mappings
<a href="ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt"><code>SpecialCasing.txt</code></a>. Conditional mappings (based on context or
language) are not considered here.</p>
<p>For a full reference, see <a href="http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992">here</a>.</p>
<h1 id="examples-16" class="section-header"><a href="#examples-16">Examples</a></h1>
<p>As an iterator:</p>

<pre class="rust rust-example-rendered">
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="string">&#39;İ&#39;</span>.<span class="ident">to_lowercase</span>() {
    <span class="macro">print</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">c</span>);
}
<span class="macro">println</span><span class="macro">!</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Afor%20c%20in%20'%C4%B0'.to_lowercase()%20%7B%0A%20%20%20%20print!(%22%7B%7D%22%2C%20c)%3B%0A%7D%0Aprintln!()%3B%0A%7D">Run</a></pre>
<p>Using <code>println!</code> directly:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="string">&#39;İ&#39;</span>.<span class="ident">to_lowercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%7B%7D%22%2C%20'%C4%B0'.to_lowercase())%3B%0A%7D">Run</a></pre>
<p>Both are equivalent to:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;i\u{307}&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22i%5Cu%7B307%7D%22)%3B%0A%7D">Run</a></pre>
<p>Using <code>to_string</code>:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;C&#39;</span>.<span class="ident">to_lowercase</span>().<span class="ident">to_string</span>(), <span class="string">&quot;c&quot;</span>);

<span class="comment">// Sometimes the result is more than one character:</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;İ&#39;</span>.<span class="ident">to_lowercase</span>().<span class="ident">to_string</span>(), <span class="string">&quot;i\u{307}&quot;</span>);

<span class="comment">// Characters that do not have both uppercase and lowercase</span>
<span class="comment">// convert into themselves.</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;山&#39;</span>.<span class="ident">to_lowercase</span>().<span class="ident">to_string</span>(), <span class="string">&quot;山&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('C'.to_lowercase().to_string()%2C%20%22c%22)%3B%0A%0A%2F%2F%20Sometimes%20the%20result%20is%20more%20than%20one%20character%3A%0Aassert_eq!('%C4%B0'.to_lowercase().to_string()%2C%20%22i%5Cu%7B307%7D%22)%3B%0A%0A%2F%2F%20Characters%20that%20do%20not%20have%20both%20uppercase%20and%20lowercase%0A%2F%2F%20convert%20into%20themselves.%0Aassert_eq!('%E5%B1%B1'.to_lowercase().to_string()%2C%20%22%E5%B1%B1%22)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.to_uppercase' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../std/char/struct.ToUppercase.html" title="struct std::char::ToUppercase">ToUppercase</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../std/char/struct.ToUppercase.html" title="struct std::char::ToUppercase">ToUppercase</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../std/char/struct.ToUppercase.html" title="struct std::char::ToUppercase">ToUppercase</a></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="primitive.char.html">char</a>;</span></code></div></div><span id='to_uppercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.to_uppercase' class='fnname'>to_uppercase</a>(self) -&gt; <a class="struct" href="../std/char/struct.ToUppercase.html" title="struct std::char::ToUppercase">ToUppercase</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/methods.rs.html#889-891' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns an iterator that yields the uppercase equivalent of a <code>char</code>
as one or more <code>char</code>s.</p>
<p>If a character does not have an uppercase equivalent, the same character
will be returned back by the iterator.</p>
<p>This performs complex unconditional mappings with no tailoring: it maps
one Unicode character to its uppercase equivalent according to the
<a href="ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt">Unicode database</a> and the additional complex mappings
<a href="ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt"><code>SpecialCasing.txt</code></a>. Conditional mappings (based on context or
language) are not considered here.</p>
<p>For a full reference, see <a href="http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992">here</a>.</p>
<h1 id="examples-17" class="section-header"><a href="#examples-17">Examples</a></h1>
<p>As an iterator:</p>

<pre class="rust rust-example-rendered">
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="string">&#39;ß&#39;</span>.<span class="ident">to_uppercase</span>() {
    <span class="macro">print</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">c</span>);
}
<span class="macro">println</span><span class="macro">!</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Afor%20c%20in%20'%C3%9F'.to_uppercase()%20%7B%0A%20%20%20%20print!(%22%7B%7D%22%2C%20c)%3B%0A%7D%0Aprintln!()%3B%0A%7D">Run</a></pre>
<p>Using <code>println!</code> directly:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="string">&#39;ß&#39;</span>.<span class="ident">to_uppercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22%7B%7D%22%2C%20'%C3%9F'.to_uppercase())%3B%0A%7D">Run</a></pre>
<p>Both are equivalent to:</p>

<pre class="rust rust-example-rendered">
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;SS&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22SS%22)%3B%0A%7D">Run</a></pre>
<p>Using <code>to_string</code>:</p>

<pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;c&#39;</span>.<span class="ident">to_uppercase</span>().<span class="ident">to_string</span>(), <span class="string">&quot;C&quot;</span>);

<span class="comment">// Sometimes the result is more than one character:</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;ß&#39;</span>.<span class="ident">to_uppercase</span>().<span class="ident">to_string</span>(), <span class="string">&quot;SS&quot;</span>);

<span class="comment">// Characters that do not have both uppercase and lowercase</span>
<span class="comment">// convert into themselves.</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;山&#39;</span>.<span class="ident">to_uppercase</span>().<span class="ident">to_string</span>(), <span class="string">&quot;山&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aassert_eq!('c'.to_uppercase().to_string()%2C%20%22C%22)%3B%0A%0A%2F%2F%20Sometimes%20the%20result%20is%20more%20than%20one%20character%3A%0Aassert_eq!('%C3%9F'.to_uppercase().to_string()%2C%20%22SS%22)%3B%0A%0A%2F%2F%20Characters%20that%20do%20not%20have%20both%20uppercase%20and%20lowercase%0A%2F%2F%20convert%20into%20themselves.%0Aassert_eq!('%E5%B1%B1'.to_uppercase().to_string()%2C%20%22%E5%B1%B1%22)%3B%0A%7D">Run</a></pre>
<h1 id="note-on-locale" class="section-header"><a href="#note-on-locale">Note on locale</a></h1>
<p>In Turkish, the equivalent of 'i' in Latin has five forms instead of two:</p>
<ul>
<li>'Dotless': I / ı, sometimes written ï</li>
<li>'Dotted': İ / i</li>
</ul>
<p>Note that the lowercase dotted 'i' is the same as the Latin. Therefore:</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">upper_i</span> <span class="op">=</span> <span class="string">&#39;i&#39;</span>.<span class="ident">to_uppercase</span>().<span class="ident">to_string</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20upper_i%20%3D%20'i'.to_uppercase().to_string()%3B%0A%7D">Run</a></pre>
<p>The value of <code>upper_i</code> here relies on the language of the text: if we're
in <code>en-US</code>, it should be <code>&quot;I&quot;</code>, but if we're in <code>tr_TR</code>, it should
be <code>&quot;İ&quot;</code>. <code>to_uppercase()</code> does not take this into account, and so:</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">upper_i</span> <span class="op">=</span> <span class="string">&#39;i&#39;</span>.<span class="ident">to_uppercase</span>().<span class="ident">to_string</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">upper_i</span>, <span class="string">&quot;I&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20upper_i%20%3D%20'i'.to_uppercase().to_string()%3B%0A%0Aassert_eq!(upper_i%2C%20%22I%22)%3B%0A%7D">Run</a></pre>
<p>holds across languages.</p>
</div><h4 id='method.is_ascii' class="method"><span id='is_ascii.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii' class='fnname'>is_ascii</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.23.0'>1.23.0</div><a class='srclink' href='../src/core/char/methods.rs.html#906-908' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is within the ASCII range.</p>
<h1 id="examples-18" class="section-header"><a href="#examples-18">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">ascii</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">non_ascii</span> <span class="op">=</span> <span class="string">&#39;❤&#39;</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">ascii</span>.<span class="ident">is_ascii</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">non_ascii</span>.<span class="ident">is_ascii</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20ascii%20%3D%20'a'%3B%0Alet%20non_ascii%20%3D%20'%E2%9D%A4'%3B%0A%0Aassert!(ascii.is_ascii())%3B%0Aassert!(!non_ascii.is_ascii())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.to_ascii_uppercase' class="method"><span id='to_ascii_uppercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.to_ascii_uppercase' class='fnname'>to_ascii_uppercase</a>(&amp;self) -&gt; <a class="primitive" href="primitive.char.html">char</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.23.0'>1.23.0</div><a class='srclink' href='../src/core/char/methods.rs.html#934-940' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Makes a copy of the value in its ASCII upper case equivalent.</p>
<p>ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
but non-ASCII letters are unchanged.</p>
<p>To uppercase the value in-place, use <a href="#method.make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
<p>To uppercase ASCII characters in addition to non-ASCII characters, use
<a href="#method.to_uppercase"><code>to_uppercase</code></a>.</p>
<h1 id="examples-19" class="section-header"><a href="#examples-19">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">ascii</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">non_ascii</span> <span class="op">=</span> <span class="string">&#39;❤&#39;</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;A&#39;</span>, <span class="ident">ascii</span>.<span class="ident">to_ascii_uppercase</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;❤&#39;</span>, <span class="ident">non_ascii</span>.<span class="ident">to_ascii_uppercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20ascii%20%3D%20'a'%3B%0Alet%20non_ascii%20%3D%20'%E2%9D%A4'%3B%0A%0Aassert_eq!('A'%2C%20ascii.to_ascii_uppercase())%3B%0Aassert_eq!('%E2%9D%A4'%2C%20non_ascii.to_ascii_uppercase())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.to_ascii_lowercase' class="method"><span id='to_ascii_lowercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.to_ascii_lowercase' class='fnname'>to_ascii_lowercase</a>(&amp;self) -&gt; <a class="primitive" href="primitive.char.html">char</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.23.0'>1.23.0</div><a class='srclink' href='../src/core/char/methods.rs.html#966-972' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Makes a copy of the value in its ASCII lower case equivalent.</p>
<p>ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
but non-ASCII letters are unchanged.</p>
<p>To lowercase the value in-place, use <a href="#method.make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
<p>To lowercase ASCII characters in addition to non-ASCII characters, use
<a href="#method.to_lowercase"><code>to_lowercase</code></a>.</p>
<h1 id="examples-20" class="section-header"><a href="#examples-20">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">ascii</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">non_ascii</span> <span class="op">=</span> <span class="string">&#39;❤&#39;</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;a&#39;</span>, <span class="ident">ascii</span>.<span class="ident">to_ascii_lowercase</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;❤&#39;</span>, <span class="ident">non_ascii</span>.<span class="ident">to_ascii_lowercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20ascii%20%3D%20'A'%3B%0Alet%20non_ascii%20%3D%20'%E2%9D%A4'%3B%0A%0Aassert_eq!('a'%2C%20ascii.to_ascii_lowercase())%3B%0Aassert_eq!('%E2%9D%A4'%2C%20non_ascii.to_ascii_lowercase())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.eq_ignore_ascii_case' class="method"><span id='eq_ignore_ascii_case.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.eq_ignore_ascii_case' class='fnname'>eq_ignore_ascii_case</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.23.0'>1.23.0</div><a class='srclink' href='../src/core/char/methods.rs.html#991-993' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks that two values are an ASCII case-insensitive match.</p>
<p>Equivalent to <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>.</p>
<h1 id="examples-21" class="section-header"><a href="#examples-21">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">upper_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">lower_a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">lower_z</span> <span class="op">=</span> <span class="string">&#39;z&#39;</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">upper_a</span>.<span class="ident">eq_ignore_ascii_case</span>(<span class="kw-2">&amp;</span><span class="ident">lower_a</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">upper_a</span>.<span class="ident">eq_ignore_ascii_case</span>(<span class="kw-2">&amp;</span><span class="ident">upper_a</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">upper_a</span>.<span class="ident">eq_ignore_ascii_case</span>(<span class="kw-2">&amp;</span><span class="ident">lower_z</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20upper_a%20%3D%20'A'%3B%0Alet%20lower_a%20%3D%20'a'%3B%0Alet%20lower_z%20%3D%20'z'%3B%0A%0Aassert!(upper_a.eq_ignore_ascii_case(%26lower_a))%3B%0Aassert!(upper_a.eq_ignore_ascii_case(%26upper_a))%3B%0Aassert!(!upper_a.eq_ignore_ascii_case(%26lower_z))%3B%0A%7D">Run</a></pre>
</div><h4 id='method.make_ascii_uppercase' class="method"><span id='make_ascii_uppercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.make_ascii_uppercase' class='fnname'>make_ascii_uppercase</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.23.0'>1.23.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1016-1018' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Converts this type to its ASCII upper case equivalent in-place.</p>
<p>ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
but non-ASCII letters are unchanged.</p>
<p>To return a new uppercased value without modifying the existing one, use
<a href="#method.to_ascii_uppercase"><code>to_ascii_uppercase</code></a>.</p>
<h1 id="examples-22" class="section-header"><a href="#examples-22">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ascii</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;

<span class="ident">ascii</span>.<span class="ident">make_ascii_uppercase</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;A&#39;</span>, <span class="ident">ascii</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20mut%20ascii%20%3D%20'a'%3B%0A%0Aascii.make_ascii_uppercase()%3B%0A%0Aassert_eq!('A'%2C%20ascii)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.make_ascii_lowercase' class="method"><span id='make_ascii_lowercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.make_ascii_lowercase' class='fnname'>make_ascii_lowercase</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.23.0'>1.23.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1041-1043' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Converts this type to its ASCII lower case equivalent in-place.</p>
<p>ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
but non-ASCII letters are unchanged.</p>
<p>To return a new lowercased value without modifying the existing one, use
<a href="#method.to_ascii_lowercase"><code>to_ascii_lowercase</code></a>.</p>
<h1 id="examples-23" class="section-header"><a href="#examples-23">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ascii</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;

<span class="ident">ascii</span>.<span class="ident">make_ascii_lowercase</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&#39;a&#39;</span>, <span class="ident">ascii</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Alet%20mut%20ascii%20%3D%20'A'%3B%0A%0Aascii.make_ascii_lowercase()%3B%0A%0Aassert_eq!('a'%2C%20ascii)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_ascii_alphabetic' class="method"><span id='is_ascii_alphabetic.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_alphabetic' class='fnname'>is_ascii_alphabetic</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1077-1079' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII alphabetic character:</p>
<ul>
<li>U+0041 'A' ... U+005A 'Z', or</li>
<li>U+0061 'a' ... U+007A 'z'.</li>
</ul>
<h1 id="examples-24" class="section-header"><a href="#examples-24">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_a</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_g</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_alphabetic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_alphabetic</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(uppercase_a.is_ascii_alphabetic())%3B%0Aassert!(uppercase_g.is_ascii_alphabetic())%3B%0Aassert!(a.is_ascii_alphabetic())%3B%0Aassert!(g.is_ascii_alphabetic())%3B%0Aassert!(!zero.is_ascii_alphabetic())%3B%0Aassert!(!percent.is_ascii_alphabetic())%3B%0Aassert!(!space.is_ascii_alphabetic())%3B%0Aassert!(!lf.is_ascii_alphabetic())%3B%0Aassert!(!esc.is_ascii_alphabetic())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_uppercase' class="method"><span id='is_ascii_uppercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_uppercase' class='fnname'>is_ascii_uppercase</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1111-1113' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII uppercase character:
U+0041 'A' ... U+005A 'Z'.</p>
<h1 id="examples-25" class="section-header"><a href="#examples-25">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_a</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_g</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_uppercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_uppercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(uppercase_a.is_ascii_uppercase())%3B%0Aassert!(uppercase_g.is_ascii_uppercase())%3B%0Aassert!(!a.is_ascii_uppercase())%3B%0Aassert!(!g.is_ascii_uppercase())%3B%0Aassert!(!zero.is_ascii_uppercase())%3B%0Aassert!(!percent.is_ascii_uppercase())%3B%0Aassert!(!space.is_ascii_uppercase())%3B%0Aassert!(!lf.is_ascii_uppercase())%3B%0Aassert!(!esc.is_ascii_uppercase())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_lowercase' class="method"><span id='is_ascii_lowercase.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_lowercase' class='fnname'>is_ascii_lowercase</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1145-1147' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII lowercase character:
U+0061 'a' ... U+007A 'z'.</p>
<h1 id="examples-26" class="section-header"><a href="#examples-26">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_a</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_g</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_lowercase</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_lowercase</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(!uppercase_a.is_ascii_lowercase())%3B%0Aassert!(!uppercase_g.is_ascii_lowercase())%3B%0Aassert!(a.is_ascii_lowercase())%3B%0Aassert!(g.is_ascii_lowercase())%3B%0Aassert!(!zero.is_ascii_lowercase())%3B%0Aassert!(!percent.is_ascii_lowercase())%3B%0Aassert!(!space.is_ascii_lowercase())%3B%0Aassert!(!lf.is_ascii_lowercase())%3B%0Aassert!(!esc.is_ascii_lowercase())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_alphanumeric' class="method"><span id='is_ascii_alphanumeric.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_alphanumeric' class='fnname'>is_ascii_alphanumeric</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1182-1184' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII alphanumeric character:</p>
<ul>
<li>U+0041 'A' ... U+005A 'Z', or</li>
<li>U+0061 'a' ... U+007A 'z', or</li>
<li>U+0030 '0' ... U+0039 '9'.</li>
</ul>
<h1 id="examples-27" class="section-header"><a href="#examples-27">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_a</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_g</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">zero</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_alphanumeric</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_alphanumeric</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(uppercase_a.is_ascii_alphanumeric())%3B%0Aassert!(uppercase_g.is_ascii_alphanumeric())%3B%0Aassert!(a.is_ascii_alphanumeric())%3B%0Aassert!(g.is_ascii_alphanumeric())%3B%0Aassert!(zero.is_ascii_alphanumeric())%3B%0Aassert!(!percent.is_ascii_alphanumeric())%3B%0Aassert!(!space.is_ascii_alphanumeric())%3B%0Aassert!(!lf.is_ascii_alphanumeric())%3B%0Aassert!(!esc.is_ascii_alphanumeric())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_digit' class="method"><span id='is_ascii_digit.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_digit' class='fnname'>is_ascii_digit</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1216-1218' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII decimal digit:
U+0030 '0' ... U+0039 '9'.</p>
<h1 id="examples-28" class="section-header"><a href="#examples-28">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_a</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_g</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">zero</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_digit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_digit</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(!uppercase_a.is_ascii_digit())%3B%0Aassert!(!uppercase_g.is_ascii_digit())%3B%0Aassert!(!a.is_ascii_digit())%3B%0Aassert!(!g.is_ascii_digit())%3B%0Aassert!(zero.is_ascii_digit())%3B%0Aassert!(!percent.is_ascii_digit())%3B%0Aassert!(!space.is_ascii_digit())%3B%0Aassert!(!lf.is_ascii_digit())%3B%0Aassert!(!esc.is_ascii_digit())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_hexdigit' class="method"><span id='is_ascii_hexdigit.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_hexdigit' class='fnname'>is_ascii_hexdigit</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1253-1255' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII hexadecimal digit:</p>
<ul>
<li>U+0030 '0' ... U+0039 '9', or</li>
<li>U+0041 'A' ... U+0046 'F', or</li>
<li>U+0061 'a' ... U+0066 'f'.</li>
</ul>
<h1 id="examples-29" class="section-header"><a href="#examples-29">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_a</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_g</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">zero</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_hexdigit</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_hexdigit</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(uppercase_a.is_ascii_hexdigit())%3B%0Aassert!(!uppercase_g.is_ascii_hexdigit())%3B%0Aassert!(a.is_ascii_hexdigit())%3B%0Aassert!(!g.is_ascii_hexdigit())%3B%0Aassert!(zero.is_ascii_hexdigit())%3B%0Aassert!(!percent.is_ascii_hexdigit())%3B%0Aassert!(!space.is_ascii_hexdigit())%3B%0Aassert!(!lf.is_ascii_hexdigit())%3B%0Aassert!(!esc.is_ascii_hexdigit())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_punctuation' class="method"><span id='is_ascii_punctuation.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_punctuation' class='fnname'>is_ascii_punctuation</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1291-1293' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII punctuation character:</p>
<ul>
<li>U+0021 ... U+002F <code>! &quot; # $ % &amp; ' ( ) * + , - . /</code>, or</li>
<li>U+003A ... U+0040 <code>: ; &lt; = &gt; ? @</code>, or</li>
<li>U+005B ... U+0060 <code>[ \ ] ^ _ `</code>, or</li>
<li>U+007B ... U+007E <code>{ | } ~</code></li>
</ul>
<h1 id="examples-30" class="section-header"><a href="#examples-30">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_a</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_g</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">percent</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_punctuation</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_punctuation</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(!uppercase_a.is_ascii_punctuation())%3B%0Aassert!(!uppercase_g.is_ascii_punctuation())%3B%0Aassert!(!a.is_ascii_punctuation())%3B%0Aassert!(!g.is_ascii_punctuation())%3B%0Aassert!(!zero.is_ascii_punctuation())%3B%0Aassert!(percent.is_ascii_punctuation())%3B%0Aassert!(!space.is_ascii_punctuation())%3B%0Aassert!(!lf.is_ascii_punctuation())%3B%0Aassert!(!esc.is_ascii_punctuation())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_graphic' class="method"><span id='is_ascii_graphic.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_graphic' class='fnname'>is_ascii_graphic</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1325-1327' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII graphic character:
U+0021 '!' ... U+007E '~'.</p>
<h1 id="examples-31" class="section-header"><a href="#examples-31">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_a</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">uppercase_g</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">g</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">zero</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">percent</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">lf</span>.<span class="ident">is_ascii_graphic</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_graphic</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(uppercase_a.is_ascii_graphic())%3B%0Aassert!(uppercase_g.is_ascii_graphic())%3B%0Aassert!(a.is_ascii_graphic())%3B%0Aassert!(g.is_ascii_graphic())%3B%0Aassert!(zero.is_ascii_graphic())%3B%0Aassert!(percent.is_ascii_graphic())%3B%0Aassert!(!space.is_ascii_graphic())%3B%0Aassert!(!lf.is_ascii_graphic())%3B%0Aassert!(!esc.is_ascii_graphic())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_whitespace' class="method"><span id='is_ascii_whitespace.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_whitespace' class='fnname'>is_ascii_whitespace</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1376-1378' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII whitespace character:
U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED,
U+000C FORM FEED, or U+000D CARRIAGE RETURN.</p>
<p>Rust uses the WhatWG Infra Standard's <a href="https://infra.spec.whatwg.org/#ascii-whitespace">definition of ASCII
whitespace</a>. There are several other definitions in
wide use. For instance, <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01">the POSIX locale</a> includes
U+000B VERTICAL TAB as well as all the above characters,
but—from the very same specification—<a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05">the default rule for
&quot;field splitting&quot; in the Bourne shell</a> considers <em>only</em>
SPACE, HORIZONTAL TAB, and LINE FEED as whitespace.</p>
<p>If you are writing a program that will process an existing
file format, check what that format's definition of whitespace is
before using this function.</p>
<h1 id="examples-32" class="section-header"><a href="#examples-32">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_a</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_g</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">space</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">lf</span>.<span class="ident">is_ascii_whitespace</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">esc</span>.<span class="ident">is_ascii_whitespace</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(!uppercase_a.is_ascii_whitespace())%3B%0Aassert!(!uppercase_g.is_ascii_whitespace())%3B%0Aassert!(!a.is_ascii_whitespace())%3B%0Aassert!(!g.is_ascii_whitespace())%3B%0Aassert!(!zero.is_ascii_whitespace())%3B%0Aassert!(!percent.is_ascii_whitespace())%3B%0Aassert!(space.is_ascii_whitespace())%3B%0Aassert!(lf.is_ascii_whitespace())%3B%0Aassert!(!esc.is_ascii_whitespace())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.is_ascii_control' class="method"><span id='is_ascii_control.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_ascii_control' class='fnname'>is_ascii_control</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../src/core/char/methods.rs.html#1412-1414' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Checks if the value is an ASCII control character:
U+0000 NUL ... U+001F UNIT SEPARATOR, or U+007F DELETE.
Note that most ASCII whitespace characters are control
characters, but SPACE is not.</p>
<h1 id="examples-33" class="section-header"><a href="#examples-33">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">ascii_ctype</span>)]</span>

<span class="kw">let</span> <span class="ident">uppercase_a</span> <span class="op">=</span> <span class="string">&#39;A&#39;</span>;
<span class="kw">let</span> <span class="ident">uppercase_g</span> <span class="op">=</span> <span class="string">&#39;G&#39;</span>;
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="string">&#39;a&#39;</span>;
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="string">&#39;g&#39;</span>;
<span class="kw">let</span> <span class="ident">zero</span> <span class="op">=</span> <span class="string">&#39;0&#39;</span>;
<span class="kw">let</span> <span class="ident">percent</span> <span class="op">=</span> <span class="string">&#39;%&#39;</span>;
<span class="kw">let</span> <span class="ident">space</span> <span class="op">=</span> <span class="string">&#39; &#39;</span>;
<span class="kw">let</span> <span class="ident">lf</span> <span class="op">=</span> <span class="string">&#39;\n&#39;</span>;
<span class="kw">let</span> <span class="ident">esc</span>: <span class="ident">char</span> <span class="op">=</span> <span class="number">0x1b_u8</span>.<span class="ident">into</span>();

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_a</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">uppercase_g</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">g</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">zero</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">percent</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">space</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">lf</span>.<span class="ident">is_ascii_control</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">esc</span>.<span class="ident">is_ascii_control</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(ascii_ctype)%5D%0A%0Afn%20main()%20%7B%0Alet%20uppercase_a%20%3D%20'A'%3B%0Alet%20uppercase_g%20%3D%20'G'%3B%0Alet%20a%20%3D%20'a'%3B%0Alet%20g%20%3D%20'g'%3B%0Alet%20zero%20%3D%20'0'%3B%0Alet%20percent%20%3D%20'%25'%3B%0Alet%20space%20%3D%20'%20'%3B%0Alet%20lf%20%3D%20'%5Cn'%3B%0Alet%20esc%3A%20char%20%3D%200x1b_u8.into()%3B%0A%0Aassert!(!uppercase_a.is_ascii_control())%3B%0Aassert!(!uppercase_g.is_ascii_control())%3B%0Aassert!(!a.is_ascii_control())%3B%0Aassert!(!g.is_ascii_control())%3B%0Aassert!(!zero.is_ascii_control())%3B%0Aassert!(!percent.is_ascii_control())%3B%0Aassert!(!space.is_ascii_control())%3B%0Aassert!(lf.is_ascii_control())%3B%0Aassert!(esc.is_ascii_control())%3B%0A%7D&amp;version=nightly">Run</a></pre>
</div></div>
                <h2 id='implementations' class='small-section-header'>
                  Trait Implementations<a href='#implementations' class='anchor'></a>
                </h2>
                <div id='implementations-list'><h3 id='impl-Display' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/fmt/trait.Display.html" title="trait std::fmt::Display">Display</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Display' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1930-1938' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1931-1937' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="../std/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-PartialEq%3Cchar%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="primitive" href="primitive.char.html">char</a>&gt; for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-PartialEq%3Cchar%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#777-782' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#779' title='goto source code'>[src]</a></td></tr></tbody></table></span></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="../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#781' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Ord' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Ord' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#869-876' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="enum" href="../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#871-875' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="../std/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id='method.max' class="method"><span id='max.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../src/core/cmp.rs.html#469-472' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the maximum of two values. <a href="../std/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id='method.min' class="method"><span id='min.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../src/core/cmp.rs.html#485-488' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the minimum of two values. <a href="../std/cmp/trait.Ord.html#method.min">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3Cchar%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="primitive" href="primitive.char.html">char</a>&gt; for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-PartialOrd%3Cchar%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#853-866' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="enum" href="../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#855-857' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class="method"><span id='lt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#859' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class="method"><span id='le.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#861' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.ge' class="method"><span id='ge.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#863' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div><h4 id='method.gt' class="method"><span id='gt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#865' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1919-1927' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1920-1926' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-TryFrom%3Cu32%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;<a class="primitive" href="primitive.u32.html">u32</a>&gt; for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-TryFrom%3Cu32%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/convert.rs.html#208-219' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><span id='Error.t' class='invisible'><code>type <a href='../std/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../std/char/struct.CharTryFromError.html" title="struct std::char::CharTryFromError">CharTryFromError</a></code></span></h4>
<div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>try_from </code><a href="https://github.com/rust-lang/rust/issues/33417">#33417</a>)</div></div><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method"><span id='try_from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(i: <a class="primitive" href="primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.char.html">char</a>, &lt;<a class="primitive" href="primitive.char.html">char</a> as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;<a class="primitive" href="primitive.u32.html">u32</a>&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/convert.rs.html#212-218' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>try_from </code><a href="https://github.com/rust-lang/rust/issues/33417">#33417</a>)</div></div><div class='docblock'><p>Performs the conversion.</p>
</div></div><h3 id='impl-FromStr' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/str/trait.FromStr.html" title="trait std::str::FromStr">FromStr</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-FromStr' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.20.0'>1.20.0</div><a class='srclink' href='../src/core/char/convert.rs.html#188-204' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><span id='Err.t' class='invisible'><code>type <a href='../std/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="struct" href="../std/char/struct.ParseCharError.html" title="struct std::char::ParseCharError">ParseCharError</a></code></span></h4>
<div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id='method.from_str' class="method"><span id='from_str.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &amp;<a class="primitive" href="primitive.str.html">str</a>) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="primitive.char.html">char</a>, &lt;<a class="primitive" href="primitive.char.html">char</a> as <a class="trait" href="../std/str/trait.FromStr.html" title="trait std::str::FromStr">FromStr</a>&gt;::<a class="type" href="../std/str/trait.FromStr.html#associatedtype.Err" title="type std::str::FromStr::Err">Err</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/convert.rs.html#192-203' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses a string <code>s</code> to return a value of this type. <a href="../std/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
</div></div><h3 id='impl-Hash' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Hash' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/hash/mod.rs.html#592-596' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.hash' class="method"><span id='hash.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a>&lt;H&gt;(&amp;self, state: <a class="primitive" href="primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/hash/mod.rs.html#593-595' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="../std/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id='method.hash_slice' class="method"><span id='hash_slice.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../src/core/hash/mod.rs.html#203-209' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="../std/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Eq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#801' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Clone' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Clone' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/clone.rs.html#164-169' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="primitive" href="primitive.char.html">char</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/clone.rs.html#166-168' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a copy of the value. <a href="../std/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="primitive.reference.html">&amp;</a>Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/clone.rs.html#130-132' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../std/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-From%3Cu8%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="primitive.u8.html">u8</a>&gt; for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-From%3Cu8%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.13.0'>1.13.0</div><a class='srclink' href='../src/core/char/convert.rs.html#143-148' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Maps a byte in 0x00...0xFF to a <code>char</code> whose code point has the same value, in U+0000 to U+00FF.</p>
<p>Unicode is designed such that this effectively decodes bytes
with the character encoding that IANA calls ISO-8859-1.
This encoding is compatible with ASCII.</p>
<p>Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hyphen),
which leaves some &quot;blanks&quot;, byte values that are not assigned to any character.
ISO-8859-1 (the IANA one) assigns them to the C0 and C1 control codes.</p>
<p>Note that this is <em>also</em> different from Windows-1252 a.k.a. code page 1252,
which is a superset ISO/IEC 8859-1 that assigns some (not all!) blanks
to punctuation and various Latin characters.</p>
<p>To confuse things further, <a href="https://encoding.spec.whatwg.org/">on the Web</a>
<code>ascii</code>, <code>iso-8859-1</code>, and <code>windows-1252</code> are all aliases
for a superset of Windows-1252 that fills the remaining blanks with corresponding
C0 and C1 control codes.</p>
</div><div class='impl-items'><h4 id='method.from' class="method"><span id='from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(i: <a class="primitive" href="primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="primitive.char.html">char</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/char/convert.rs.html#145-147' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Copy' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Copy' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/marker.rs.html#632' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Pattern%3C%27a%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="../std/str/pattern/trait.Pattern.html" title="trait std::str::pattern::Pattern">Pattern</a>&lt;'a&gt; for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Pattern%3C%27a%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/str/pattern.rs.html#432-478' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Searches for chars that are equal to a given char</p>
</div><div class='impl-items'><h4 id='associatedtype.Searcher' class="type"><span id='Searcher.t' class='invisible'><code>type <a href='../std/str/pattern/trait.Pattern.html#associatedtype.Searcher' class="type">Searcher</a> = <a class="struct" href="../std/str/pattern/struct.CharSearcher.html" title="struct std::str::pattern::CharSearcher">CharSearcher</a>&lt;'a&gt;</code></span></h4>
<div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>pattern </code><a href="https://github.com/rust-lang/rust/issues/27721">#27721</a>)</summary><p>API not fully fleshed out and ready to be stabilized</p>
</details></div></div><div class='docblock'><p>Associated searcher for this pattern</p>
</div><h4 id='method.into_searcher' class="method"><span id='into_searcher.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/str/pattern/trait.Pattern.html#tymethod.into_searcher' class='fnname'>into_searcher</a>(self, haystack: &amp;'a <a class="primitive" href="primitive.str.html">str</a>) -&gt; &lt;<a class="primitive" href="primitive.char.html">char</a> as <a class="trait" href="../std/str/pattern/trait.Pattern.html" title="trait std::str::pattern::Pattern">Pattern</a>&lt;'a&gt;&gt;::<a class="type" href="../std/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type std::str::pattern::Pattern::Searcher">Searcher</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/str/pattern.rs.html#436-448' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>pattern </code><a href="https://github.com/rust-lang/rust/issues/27721">#27721</a>)</summary><p>API not fully fleshed out and ready to be stabilized</p>
</details></div></div><div class='docblock'><p>Constructs the associated searcher from <code>self</code> and the <code>haystack</code> to search in. <a href="../std/str/pattern/trait.Pattern.html#tymethod.into_searcher">Read more</a></p>
</div><h4 id='method.is_contained_in' class="method"><span id='is_contained_in.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/str/pattern/trait.Pattern.html#method.is_contained_in' class='fnname'>is_contained_in</a>(self, haystack: &amp;'a <a class="primitive" href="primitive.str.html">str</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/str/pattern.rs.html#451-458' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>pattern </code><a href="https://github.com/rust-lang/rust/issues/27721">#27721</a>)</summary><p>API not fully fleshed out and ready to be stabilized</p>
</details></div></div><div class='docblock'><p>Checks whether the pattern matches anywhere in the haystack</p>
</div><h4 id='method.is_prefix_of' class="method"><span id='is_prefix_of.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/str/pattern/trait.Pattern.html#method.is_prefix_of' class='fnname'>is_prefix_of</a>(self, haystack: &amp;'a <a class="primitive" href="primitive.str.html">str</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/str/pattern.rs.html#461-467' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>pattern </code><a href="https://github.com/rust-lang/rust/issues/27721">#27721</a>)</summary><p>API not fully fleshed out and ready to be stabilized</p>
</details></div></div><div class='docblock'><p>Checks whether the pattern matches at the front of the haystack</p>
</div><h4 id='method.is_suffix_of' class="method"><span id='is_suffix_of.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/str/pattern/trait.Pattern.html#method.is_suffix_of' class='fnname'>is_suffix_of</a>(self, haystack: &amp;'a <a class="primitive" href="primitive.str.html">str</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a class="primitive" href="primitive.char.html">char</a> as <a class="trait" href="../std/str/pattern/trait.Pattern.html" title="trait std::str::pattern::Pattern">Pattern</a>&lt;'a&gt;&gt;::<a class="type" href="../std/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type std::str::pattern::Pattern::Searcher">Searcher</a>: <a class="trait" href="../std/str/pattern/trait.ReverseSearcher.html" title="trait std::str::pattern::ReverseSearcher">ReverseSearcher</a>&lt;'a&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/str/pattern.rs.html#470-477' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>pattern </code><a href="https://github.com/rust-lang/rust/issues/27721">#27721</a>)</summary><p>API not fully fleshed out and ready to be stabilized</p>
</details></div></div><div class='docblock'><p>Checks whether the pattern matches at the back of the haystack</p>
</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/default/trait.Default.html" title="trait std::default::Default">Default</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/default.rs.html#131-135' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="primitive" href="primitive.char.html">char</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/default.rs.html#134' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the default value of <code>\x00</code></p>
</div></div><h3 id='impl-AsciiExt' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/ascii/trait.AsciiExt.html" title="trait std::ascii::AsciiExt">AsciiExt</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-AsciiExt' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#380-385' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><span id='Owned.t' class='invisible'><code>type <a href='../std/ascii/trait.AsciiExt.html#associatedtype.Owned' class="type">Owned</a> = <a class="primitive" href="primitive.char.html">char</a></code></span></h4>
<div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Container type for copied ASCII characters.</p>
</div><h4 id='method.is_ascii-1' class="method"><span id='is_ascii.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.is_ascii' class='fnname'>is_ascii</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#316' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Checks if the value is within the ASCII range. <a href="../std/ascii/trait.AsciiExt.html#tymethod.is_ascii">Read more</a></p>
</div><h4 id='method.to_ascii_uppercase-1' class="method"><span id='to_ascii_uppercase.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.to_ascii_uppercase' class='fnname'>to_ascii_uppercase</a>(&amp;self) -&gt; Self::<a class="type" href="../std/ascii/trait.AsciiExt.html#associatedtype.Owned" title="type std::ascii::AsciiExt::Owned">Owned</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#319' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Makes a copy of the value in its ASCII upper case equivalent. <a href="../std/ascii/trait.AsciiExt.html#tymethod.to_ascii_uppercase">Read more</a></p>
</div><h4 id='method.to_ascii_lowercase-1' class="method"><span id='to_ascii_lowercase.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.to_ascii_lowercase' class='fnname'>to_ascii_lowercase</a>(&amp;self) -&gt; Self::<a class="type" href="../std/ascii/trait.AsciiExt.html#associatedtype.Owned" title="type std::ascii::AsciiExt::Owned">Owned</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#322' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Makes a copy of the value in its ASCII lower case equivalent. <a href="../std/ascii/trait.AsciiExt.html#tymethod.to_ascii_lowercase">Read more</a></p>
</div><h4 id='method.eq_ignore_ascii_case-1' class="method"><span id='eq_ignore_ascii_case.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.eq_ignore_ascii_case' class='fnname'>eq_ignore_ascii_case</a>(&amp;self, o: <a class="primitive" href="primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#325' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Checks that two values are an ASCII case-insensitive match. <a href="../std/ascii/trait.AsciiExt.html#tymethod.eq_ignore_ascii_case">Read more</a></p>
</div><h4 id='method.make_ascii_uppercase-1' class="method"><span id='make_ascii_uppercase.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.make_ascii_uppercase' class='fnname'>make_ascii_uppercase</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#328' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Converts this type to its ASCII upper case equivalent in-place. <a href="../std/ascii/trait.AsciiExt.html#tymethod.make_ascii_uppercase">Read more</a></p>
</div><h4 id='method.make_ascii_lowercase-1' class="method"><span id='make_ascii_lowercase.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.make_ascii_lowercase' class='fnname'>make_ascii_lowercase</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#331' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div></div><div class='docblock'><p>Converts this type to its ASCII lower case equivalent in-place. <a href="../std/ascii/trait.AsciiExt.html#tymethod.make_ascii_lowercase">Read more</a></p>
</div><h4 id='method.is_ascii_alphabetic-1' class="method"><span id='is_ascii_alphabetic.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_alphabetic' class='fnname'>is_ascii_alphabetic</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#338' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII alphabetic character: U+0041 'A' ... U+005A 'Z' or U+0061 'a' ... U+007A 'z'. For strings, true if all characters in the string are ASCII alphabetic. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_alphabetic">Read more</a></p>
</div><h4 id='method.is_ascii_uppercase-1' class="method"><span id='is_ascii_uppercase.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_uppercase' class='fnname'>is_ascii_uppercase</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#341' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII uppercase character: U+0041 'A' ... U+005A 'Z'. For strings, true if all characters in the string are ASCII uppercase. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_uppercase">Read more</a></p>
</div><h4 id='method.is_ascii_lowercase-1' class="method"><span id='is_ascii_lowercase.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_lowercase' class='fnname'>is_ascii_lowercase</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#344' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII lowercase character: U+0061 'a' ... U+007A 'z'. For strings, true if all characters in the string are ASCII lowercase. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_lowercase">Read more</a></p>
</div><h4 id='method.is_ascii_alphanumeric-1' class="method"><span id='is_ascii_alphanumeric.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_alphanumeric' class='fnname'>is_ascii_alphanumeric</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#347' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII alphanumeric character: U+0041 'A' ... U+005A 'Z', U+0061 'a' ... U+007A 'z', or U+0030 '0' ... U+0039 '9'. For strings, true if all characters in the string are ASCII alphanumeric. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_alphanumeric">Read more</a></p>
</div><h4 id='method.is_ascii_digit-1' class="method"><span id='is_ascii_digit.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_digit' class='fnname'>is_ascii_digit</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#350' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII decimal digit: U+0030 '0' ... U+0039 '9'. For strings, true if all characters in the string are ASCII digits. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_digit">Read more</a></p>
</div><h4 id='method.is_ascii_hexdigit-1' class="method"><span id='is_ascii_hexdigit.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_hexdigit' class='fnname'>is_ascii_hexdigit</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#353' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII hexadecimal digit: U+0030 '0' ... U+0039 '9', U+0041 'A' ... U+0046 'F', or U+0061 'a' ... U+0066 'f'. For strings, true if all characters in the string are ASCII hex digits. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_hexdigit">Read more</a></p>
</div><h4 id='method.is_ascii_punctuation-1' class="method"><span id='is_ascii_punctuation.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_punctuation' class='fnname'>is_ascii_punctuation</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#356' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII punctuation character: <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_punctuation">Read more</a></p>
</div><h4 id='method.is_ascii_graphic-1' class="method"><span id='is_ascii_graphic.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_graphic' class='fnname'>is_ascii_graphic</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#359' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII graphic character: U+0021 '!' ... U+007E '~'. For strings, true if all characters in the string are ASCII graphic characters. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_graphic">Read more</a></p>
</div><h4 id='method.is_ascii_whitespace-1' class="method"><span id='is_ascii_whitespace.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_whitespace' class='fnname'>is_ascii_whitespace</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#362' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII whitespace character: U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED, U+000C FORM FEED, or U+000D CARRIAGE RETURN. For strings, true if all characters in the string are ASCII whitespace. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_whitespace">Read more</a></p>
</div><h4 id='method.is_ascii_control-1' class="method"><span id='is_ascii_control.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../std/ascii/trait.AsciiExt.html#method.is_ascii_control' class='fnname'>is_ascii_control</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/ascii.rs.html#365' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 1.26.0<p>: use inherent methods instead</p>
</div><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>ascii_ctype </code><a href="https://github.com/rust-lang/rust/issues/39658">#39658</a>)</div></div><div class='docblock'><p>Checks if the value is an ASCII control character: U+0000 NUL ... U+001F UNIT SEPARATOR, or U+007F DELETE. Note that most ASCII whitespace characters are control characters, but SPACE is not. <a href="../std/ascii/trait.AsciiExt.html#method.is_ascii_control">Read more</a></p>
</div></div></div>
                <h2 id='synthetic-implementations' class='small-section-header'>
                  Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
                </h2>
                <div id='synthetic-implementations-list'>
            <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> for <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></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><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse 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><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "std";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>