Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 16492

rust-doc-1.35.0-1.mga7.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="../normalize1.35.0.css"><link rel="stylesheet" type="text/css" href="../rustdoc1.35.0.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark1.35.0.css"><link rel="stylesheet" type="text/css" href="../light1.35.0.css" id="themeStyle"><script src="../storage1.35.0.js"></script><noscript><link rel="stylesheet" href="../noscript1.35.0.css"></noscript><link rel="shortcut icon" href="../favicon1.35.0.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow1.35.0.svg");}</style></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='../rust-logo1.35.0.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.encode_utf16">encode_utf16</a><a href="#method.encode_utf8">encode_utf8</a><a href="#method.eq_ignore_ascii_case">eq_ignore_ascii_case</a><a href="#method.escape_debug">escape_debug</a><a href="#method.escape_default">escape_default</a><a href="#method.escape_unicode">escape_unicode</a><a href="#method.is_alphabetic">is_alphabetic</a><a href="#method.is_alphanumeric">is_alphanumeric</a><a href="#method.is_ascii">is_ascii</a><a href="#method.is_ascii_alphabetic">is_ascii_alphabetic</a><a href="#method.is_ascii_alphanumeric">is_ascii_alphanumeric</a><a href="#method.is_ascii_control">is_ascii_control</a><a href="#method.is_ascii_digit">is_ascii_digit</a><a href="#method.is_ascii_graphic">is_ascii_graphic</a><a href="#method.is_ascii_hexdigit">is_ascii_hexdigit</a><a href="#method.is_ascii_lowercase">is_ascii_lowercase</a><a href="#method.is_ascii_punctuation">is_ascii_punctuation</a><a href="#method.is_ascii_uppercase">is_ascii_uppercase</a><a href="#method.is_ascii_whitespace">is_ascii_whitespace</a><a href="#method.is_control">is_control</a><a href="#method.is_digit">is_digit</a><a href="#method.is_lowercase">is_lowercase</a><a href="#method.is_numeric">is_numeric</a><a href="#method.is_uppercase">is_uppercase</a><a href="#method.is_whitespace">is_whitespace</a><a href="#method.is_xid_continue">is_xid_continue</a><a href="#method.is_xid_start">is_xid_start</a><a href="#method.len_utf16">len_utf16</a><a href="#method.len_utf8">len_utf8</a><a href="#method.make_ascii_lowercase">make_ascii_lowercase</a><a href="#method.make_ascii_uppercase">make_ascii_uppercase</a><a href="#method.to_ascii_lowercase">to_ascii_lowercase</a><a href="#method.to_ascii_uppercase">to_ascii_uppercase</a><a href="#method.to_digit">to_digit</a><a href="#method.to_lowercase">to_lowercase</a><a href="#method.to_uppercase">to_uppercase</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsciiExt">AsciiExt</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-From%3Cu8%3E">From&lt;u8&gt;</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3Cchar%3E">PartialEq&lt;char&gt;</a><a href="#impl-PartialOrd%3Cchar%3E">PartialOrd&lt;char&gt;</a><a href="#impl-Pattern%3C%27a%3E">Pattern&lt;&#39;a&gt;</a><a href="#impl-TryFrom%3Cu32%3E">TryFrom&lt;u32&gt;</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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow">Borrow</a><a href="#impl-BorrowMut">BorrowMut</a><a href="#impl-From">From</a><a href="#impl-Into">Into</a><a href="#impl-Pattern">Pattern</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom">TryFrom</a><a href="#impl-TryInto">TryInto</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="../brush1.35.0.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme1.35.0.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel1.35.0.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span></span><span class='in-band'>Primitive Type <a class="primitive" href=''>char</a></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>

<div class="example-wrap"><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></div>
<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>

<div class="example-wrap"><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></div>
<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>

<div class="example-wrap"><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">std</span>::<span class="ident">mem</span>::<span class="ident">size_of_val</span>(<span class="kw-2">&amp;</span><span class="ident">s</span>[..]));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">32</span>, <span class="ident">std</span>::<span class="ident">mem</span>::<span class="ident">size_of_val</span>(<span class="kw-2">&amp;</span><span class="ident">v</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%20std%3A%3Amem%3A%3Asize_of_val(%26s%5B..%5D))%3B%0Aassert_eq!(32%2C%20std%3A%3Amem%3A%3Asize_of_val(%26v%5B..%5D))%3B%0A%7D">Run</a></pre></div>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="primitive" href="primitive.char.html">char</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/core/char/methods.rs.html#10-1392' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_digit' class="method"><code id='is_digit.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#59-61' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Passing a large radix, causing a panic:</p>

<div class="example-wrap"><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>
</div><h4 id='method.to_digit' class="method"><code id='to_digit.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#113-134' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Passing a non-digit results in failure:</p>

<div class="example-wrap"><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></div>
<p>Passing a large radix, causing a panic:</p>

<div class="example-wrap"><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>
</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><code id='escape_unicode.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#172-187' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Using <code>println!</code> directly:</p>

<div class="example-wrap"><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></div>
<p>Both are equivalent to:</p>

<div class="example-wrap"><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></div>
<p>Using <code>to_string</code>:</p>

<div class="example-wrap"><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>
</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><code id='escape_debug.v'>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><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#244-246' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Using <code>println!</code> directly:</p>

<div class="example-wrap"><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></div>
<p>Both are equivalent to:</p>

<div class="example-wrap"><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></div>
<p>Using <code>to_string</code>:</p>

<div class="example-wrap"><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>
</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><code id='escape_default.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#299-309' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Using <code>println!</code> directly:</p>

<div class="example-wrap"><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></div>
<p>Both are equivalent to:</p>

<div class="example-wrap"><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></div>
<p>Using <code>to_string</code>:</p>

<div class="example-wrap"><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>
</div><h4 id='method.len_utf8' class="method"><code id='len_utf8.v'>pub fn <a href='#method.len_utf8' class='fnname'>len_utf8</a>(self) -&gt; <a class="primitive" href="primitive.usize.html">usize</a></code><a class='srclink' href='../src/core/char/methods.rs.html#358-369' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<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>

<div class="example-wrap"><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%0A%2F%2F%20as%20chars%0Afn%20main()%20%7B%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>
</div><h4 id='method.len_utf16' class="method"><code id='len_utf16.v'>pub fn <a href='#method.len_utf16' class='fnname'>len_utf16</a>(self) -&gt; <a class="primitive" href="primitive.usize.html">usize</a></code><a class='srclink' href='../src/core/char/methods.rs.html#392-395' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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>
</div><h4 id='method.encode_utf8' class="method"><code id='encode_utf8.v'>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><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#435-465' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>A buffer that's too small:</p>

<div class="example-wrap"><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>
</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 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 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;'_&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 class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a></span><span class="where fmt-newline">impl&lt;'_&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;'_ mut [</a><a class="primitive" href="primitive.u8.html">u8</a><a class="primitive" href="primitive.slice.html">]</a></span></code></div></div><code id='encode_utf16.v'>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><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#503-523' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>A buffer that's too small:</p>

<div class="example-wrap"><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>
</div><h4 id='method.is_alphabetic' class="method"><code id='is_alphabetic.v'>pub fn <a href='#method.is_alphabetic' class='fnname'>is_alphabetic</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#541-547' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> 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>

<div class="example-wrap"><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>
</div><h4 id='method.is_xid_start' class="method"><code id='is_xid_start.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#559-561' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab internal'><details><summary><span class='emoji'>⚙️</span> This is an internal compiler API. (<code>rustc_private</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/27812">#27812</a>)</summary><p>This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from <a href="https://crates.io">crates.io</a> via <a href="https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html"><code>Cargo.toml</code></a>.</p>
</details></div></div><div class='docblock'><p>Returns <code>true</code> 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"><code id='is_xid_continue.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab internal'><details><summary><span class='emoji'>⚙️</span> This is an internal compiler API. (<code>rustc_private</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/27812">#27812</a>)</summary><p>This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from <a href="https://crates.io">crates.io</a> via <a href="https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html"><code>Cargo.toml</code></a>.</p>
</details></div></div><div class='docblock'><p>Returns <code>true</code> 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"><code id='is_lowercase.v'>pub fn <a href='#method.is_lowercase' class='fnname'>is_lowercase</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#597-603' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this <code>char</code> is lowercase.</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>

<div class="example-wrap"><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>
</div><h4 id='method.is_uppercase' class="method"><code id='is_uppercase.v'>pub fn <a href='#method.is_uppercase' class='fnname'>is_uppercase</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#625-631' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this <code>char</code> is uppercase.</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>

<div class="example-wrap"><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>
</div><h4 id='method.is_whitespace' class="method"><code id='is_whitespace.v'>pub fn <a href='#method.is_whitespace' class='fnname'>is_whitespace</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#652-658' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this <code>char</code> is whitespace.</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>

<div class="example-wrap"><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>
</div><h4 id='method.is_alphanumeric' class="method"><code id='is_alphanumeric.v'>pub fn <a href='#method.is_alphanumeric' class='fnname'>is_alphanumeric</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#681-683' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this <code>char</code> is alphanumeric.</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>

<div class="example-wrap"><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;¾&#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>());<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!('%C2%BE'.is_alphanumeric())%3B%0Aassert!('%E2%91%A0'.is_alphanumeric())%3B%0Aassert!('K'.is_alphanumeric())%3B%0Aassert!('%D9%88'.is_alphanumeric())%3B%0Aassert!('%E8%97%8F'.is_alphanumeric())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_control' class="method"><code id='is_control.v'>pub fn <a href='#method.is_control' class='fnname'>is_control</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#701-703' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this <code>char</code> is a control code point.</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>

<div class="example-wrap"><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%0A%2F%2F%20U%2B009C%2C%20STRING%20TERMINATOR%0Afn%20main()%20%7B%0Aassert!('%C2%9C'.is_control())%3B%0Aassert!(!'q'.is_control())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_numeric' class="method"><code id='is_numeric.v'>pub fn <a href='#method.is_numeric' class='fnname'>is_numeric</a>(self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><a class='srclink' href='../src/core/char/methods.rs.html#735-741' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if this <code>char</code> is numeric.</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>

<div class="example-wrap"><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="string">&#39;¾&#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>());<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!('%C2%BE'.is_numeric())%3B%0Aassert!('%E2%91%A0'.is_numeric())%3B%0Aassert!(!'K'.is_numeric())%3B%0Aassert!(!'%D9%88'.is_numeric())%3B%0Aassert!(!'%E8%97%8F'.is_numeric())%3B%0A%7D">Run</a></pre></div>
</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><code id='to_lowercase.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#800-802' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Using <code>println!</code> directly:</p>

<div class="example-wrap"><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></div>
<p>Both are equivalent to:</p>

<div class="example-wrap"><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></div>
<p>Using <code>to_string</code>:</p>

<div class="example-wrap"><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>
</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><code id='to_uppercase.v'>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><a class='srclink' href='../src/core/char/methods.rs.html#886-888' title='goto source code'>[src]</a></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>

<div class="example-wrap"><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></div>
<p>Using <code>println!</code> directly:</p>

<div class="example-wrap"><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></div>
<p>Both are equivalent to:</p>

<div class="example-wrap"><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></div>
<p>Using <code>to_string</code>:</p>

<div class="example-wrap"><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></div>
<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>

<div class="example-wrap"><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></div>
<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>

<div class="example-wrap"><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></div>
<p>holds across languages.</p>
</div><h4 id='method.is_ascii' class="method"><code id='is_ascii.v'>pub const fn <a href='#method.is_ascii' class='fnname'>is_ascii</a>(&amp;self) -&gt; <a class="primitive" href="primitive.bool.html">bool</a></code><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#903-905' title='goto source code'>[src]</a></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>
<div class="example-wrap"><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>
</div><h4 id='method.to_ascii_uppercase' class="method"><code id='to_ascii_uppercase.v'>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><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#931-937' title='goto source code'>[src]</a></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>
<div class="example-wrap"><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>
</div><h4 id='method.to_ascii_lowercase' class="method"><code id='to_ascii_lowercase.v'>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><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#963-969' title='goto source code'>[src]</a></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>
<div class="example-wrap"><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>
</div><h4 id='method.eq_ignore_ascii_case' class="method"><code id='eq_ignore_ascii_case.v'>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><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#988-990' title='goto source code'>[src]</a></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>
<div class="example-wrap"><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>
</div><h4 id='method.make_ascii_uppercase' class="method"><code id='make_ascii_uppercase.v'>pub fn <a href='#method.make_ascii_uppercase' class='fnname'>make_ascii_uppercase</a>(&amp;mut self)</code><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#1013-1015' title='goto source code'>[src]</a></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>
<div class="example-wrap"><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>
</div><h4 id='method.make_ascii_lowercase' class="method"><code id='make_ascii_lowercase.v'>pub fn <a href='#method.make_ascii_lowercase' class='fnname'>make_ascii_lowercase</a>(&amp;mut self)</code><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#1038-1040' title='goto source code'>[src]</a></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>
<div class="example-wrap"><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>
</div><h4 id='method.is_ascii_alphabetic' class="method"><code id='is_ascii_alphabetic.v'>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><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#1072-1074' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_uppercase' class="method"><code id='is_ascii_uppercase.v'>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><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#1104-1106' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_lowercase' class="method"><code id='is_ascii_lowercase.v'>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><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#1136-1138' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_alphanumeric' class="method"><code id='is_ascii_alphanumeric.v'>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><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#1171-1173' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_digit' class="method"><code id='is_ascii_digit.v'>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><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#1203-1205' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_hexdigit' class="method"><code id='is_ascii_hexdigit.v'>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><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#1238-1240' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_punctuation' class="method"><code id='is_ascii_punctuation.v'>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><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#1274-1276' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_graphic' class="method"><code id='is_ascii_graphic.v'>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><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#1306-1308' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_whitespace' class="method"><code id='is_ascii_whitespace.v'>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><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#1355-1357' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</div><h4 id='method.is_ascii_control' class="method"><code id='is_ascii_control.v'>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><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#1389-1391' title='goto source code'>[src]</a></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>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<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%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">Run</a></pre></div>
</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-FromStr' class='impl'><code class='in-band'>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><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#202-218' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>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></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>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><a class='srclink' href='../src/core/char/convert.rs.html#206-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-Clone' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/clone.rs.html#165-170' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>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><a class='srclink' href='../src/core/clone.rs.html#167-169' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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"><code id='clone_from.v'>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><a class='srclink' href='../src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></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-Eq' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/cmp.rs.html#916' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Pattern%3C%27a%3E' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/str/pattern.rs.html#422-467' title='goto source code'>[src]</a></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"><code id='Searcher.t'>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></h4><div class='stability'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden"><code id='into_searcher.v'>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><a class='srclink' href='../src/core/str/pattern.rs.html#426-437' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><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 hidden"><code id='is_contained_in.v'>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><a class='srclink' href='../src/core/str/pattern.rs.html#440-447' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><p>Checks whether the pattern matches anywhere in the haystack</p>
</div><h4 id='method.is_prefix_of' class="method hidden"><code id='is_prefix_of.v'>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><a class='srclink' href='../src/core/str/pattern.rs.html#450-456' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><p>Checks whether the pattern matches at the front of the haystack</p>
</div><h4 id='method.is_suffix_of' class="method hidden"><code id='is_suffix_of.v'>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><a class='srclink' href='../src/core/str/pattern.rs.html#459-466' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><p>Checks whether the pattern matches at the back of the haystack</p>
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/default.rs.html#121-125' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method"><code id='default.v'>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><a class='srclink' href='../src/core/default.rs.html#124' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the default value of <code>\x00</code></p>
</div></div><h3 id='impl-TryFrom%3Cu32%3E' class='impl'><code class='in-band'>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><div class='since' title='Stable since Rust version 1.34.0'>1.34.0</div><a class='srclink' href='../src/core/char/convert.rs.html#222-233' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>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></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>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><a class='srclink' href='../src/core/char/convert.rs.html#226-232' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/fmt/mod.rs.html#1995-2003' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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><a class='srclink' href='../src/core/fmt/mod.rs.html#1996-2002' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-PartialOrd%3Cchar%3E' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/cmp.rs.html#968-981' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>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><a class='srclink' href='../src/core/cmp.rs.html#970-972' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='lt.v'>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><a class='srclink' href='../src/core/cmp.rs.html#974' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='le.v'>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><a class='srclink' href='../src/core/cmp.rs.html#976' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='ge.v'>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><a class='srclink' href='../src/core/cmp.rs.html#978' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='gt.v'>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><a class='srclink' href='../src/core/cmp.rs.html#980' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-PartialEq%3Cchar%3E' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/cmp.rs.html#892-897' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>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><a class='srclink' href='../src/core/cmp.rs.html#894' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='ne.v'>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><a class='srclink' href='../src/core/cmp.rs.html#896' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Ord' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/cmp.rs.html#984-991' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>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><a class='srclink' href='../src/core/cmp.rs.html#986-990' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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"><code id='max.v'>fn <a href='../std/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -&gt; Self</code><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../src/core/cmp.rs.html#549-552' title='goto source code'>[src]</a></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"><code id='min.v'>fn <a href='../std/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -&gt; Self</code><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../src/core/cmp.rs.html#566-569' title='goto source code'>[src]</a></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><h4 id='method.clamp' class="method"><code id='clamp.v'>fn <a href='../std/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -&gt; Self</code><a class='srclink' href='../src/core/cmp.rs.html#590-600' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/44095">#44095</a>)</div></div><div class='docblock'><p>Restrict a value to a certain interval. <a href="../std/cmp/trait.Ord.html#method.clamp">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/fmt/mod.rs.html#1984-1992' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>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><a class='srclink' href='../src/core/fmt/mod.rs.html#1985-1991' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-Hash' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/hash/mod.rs.html#592-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>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><a class='srclink' href='../src/core/hash/mod.rs.html#593-595' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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"><code id='hash_slice.v'>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><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#193-199' title='goto source code'>[src]</a></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-Copy' class='impl'><code class='in-band'>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><a class='srclink' href='../src/core/marker.rs.html#670' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From%3Cu8%3E' class='impl'><code class='in-band'>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><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#144-162' title='goto source code'>[src]</a></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"><code id='from.v'>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><a class='srclink' href='../src/core/char/convert.rs.html#159-161' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <a href="../std/u8/index.html" title="`u8`"><code>u8</code></a> into a <a href="../std/char/index.html" title="`char`"><code>char</code></a>.</p>
<h1 id="examples-34" class="section-header"><a href="#examples-34">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">mem</span>;

<span class="kw">fn</span> <span class="ident">main</span>() {
    <span class="kw">let</span> <span class="ident">u</span> <span class="op">=</span> <span class="number">32</span> <span class="kw">as</span> <span class="ident">u8</span>;
    <span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">char</span>::<span class="ident">from</span>(<span class="ident">u</span>);
    <span class="macro">assert</span><span class="macro">!</span>(<span class="number">4</span> <span class="op">==</span> <span class="ident">mem</span>::<span class="ident">size_of_val</span>(<span class="kw-2">&amp;</span><span class="ident">c</span>))
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Amem%3B%0A%0Afn%20main()%20%7B%0A%20%20%20%20let%20u%20%3D%2032%20as%20u8%3B%0A%20%20%20%20let%20c%20%3D%20char%3A%3Afrom(u)%3B%0A%20%20%20%20assert!(4%20%3D%3D%20mem%3A%3Asize_of_val(%26c))%0A%7D">Run</a></pre></div>
</div></div><h3 id='impl-AsciiExt' class='impl'><code class='in-band'>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><a class='srclink' href='../src/std/ascii.rs.html#181-185' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='../std/ascii/trait.AsciiExt.html#associatedtype.Owned' class="type">Owned</a> = <a class="primitive" href="primitive.char.html">char</a></code></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 hidden"><code id='is_ascii.v-1'>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><a class='srclink' href='../src/std/ascii.rs.html#152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.26.0: <p>use inherent methods instead</p>
</div></div><div class='docblock hidden'><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 hidden"><code id='to_ascii_uppercase.v-1'>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><a class='srclink' href='../src/std/ascii.rs.html#155' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.26.0: <p>use inherent methods instead</p>
</div></div><div class='docblock hidden'><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 hidden"><code id='to_ascii_lowercase.v-1'>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><a class='srclink' href='../src/std/ascii.rs.html#158' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.26.0: <p>use inherent methods instead</p>
</div></div><div class='docblock hidden'><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 hidden"><code id='eq_ignore_ascii_case.v-1'>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><a class='srclink' href='../src/std/ascii.rs.html#161' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.26.0: <p>use inherent methods instead</p>
</div></div><div class='docblock hidden'><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 hidden"><code id='make_ascii_uppercase.v-1'>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.make_ascii_uppercase' class='fnname'>make_ascii_uppercase</a>(&amp;mut self)</code><a class='srclink' href='../src/std/ascii.rs.html#164' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.26.0: <p>use inherent methods instead</p>
</div></div><div class='docblock hidden'><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 hidden"><code id='make_ascii_lowercase.v-1'>fn <a href='../std/ascii/trait.AsciiExt.html#tymethod.make_ascii_lowercase' class='fnname'>make_ascii_lowercase</a>(&amp;mut self)</code><a class='srclink' href='../src/std/ascii.rs.html#167' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.26.0: <p>use inherent methods instead</p>
</div></div><div class='docblock hidden'><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></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'><code class='in-band'>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></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>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></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Pattern' class='impl'><code class='in-band'>impl&lt;'a, F&gt; <a class="trait" href="../std/str/pattern/trait.Pattern.html" title="trait std::str::pattern::Pattern">Pattern</a> for F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../std/ops/trait.FnMut.html" title="trait std::ops::FnMut">FnMut</a>(<a class="primitive" href="primitive.char.html">char</a>) -&gt; <a class="primitive" href="primitive.bool.html">bool</a>,&nbsp;</span></code><a href='#impl-Pattern' class='anchor'></a><a class='srclink' href='../src/core/str/pattern.rs.html#684-686' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Searcher-1' class="type"><code id='Searcher.t-1'>type <a href='../std/str/pattern/trait.Pattern.html#associatedtype.Searcher' class="type">Searcher</a> = <a class="struct" href="../std/str/pattern/struct.CharPredicateSearcher.html" title="struct std::str::pattern::CharPredicateSearcher">CharPredicateSearcher</a>&lt;'a, F&gt;</code></h4><div class='stability'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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-1' class="method hidden"><code id='into_searcher.v-1'>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; <a class="struct" href="../std/str/pattern/struct.CharPredicateSearcher.html" title="struct std::str::pattern::CharPredicateSearcher">CharPredicateSearcher</a>&lt;'a, F&gt;</code><a class='srclink' href='../src/core/str/pattern.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><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-1' class="method hidden"><code id='is_contained_in.v-1'>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><a class='srclink' href='../src/core/str/pattern.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><p>Checks whether the pattern matches anywhere in the haystack</p>
</div><h4 id='method.is_prefix_of-1' class="method hidden"><code id='is_prefix_of.v-1'>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><a class='srclink' href='../src/core/str/pattern.rs.html#576-578' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><p>Checks whether the pattern matches at the front of the haystack</p>
</div><h4 id='method.is_suffix_of-1' class="method hidden"><code id='is_suffix_of.v-1'>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;<a class="struct" href="../std/str/pattern/struct.CharPredicateSearcher.html" title="struct std::str::pattern::CharPredicateSearcher">CharPredicateSearcher</a>&lt;'a, F&gt;: <a class="trait" href="../std/str/pattern/trait.ReverseSearcher.html" title="trait std::str::pattern::ReverseSearcher">ReverseSearcher</a>&lt;'a&gt;,&nbsp;</span></code><a class='srclink' href='../src/core/str/pattern.rs.html#581-585' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>pattern</code>&nbsp;<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 hidden'><p>Checks whether the pattern matches at the back of the haystack</p>
</div></div><h3 id='impl-TryFrom' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#565-571' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='../std/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from-1' class="method hidden"><code id='try_from.v-1'>fn <a href='../std/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/convert.rs.html#568-570' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a> for T</code><a href='#impl-From' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#546-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='../src/core/convert.rs.html#547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../std/convert/trait.TryInto.html" title="trait std::convert::TryInto">TryInto</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='../std/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='../std/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../src/core/convert.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into' class='anchor'></a><a class='srclink' href='../src/core/convert.rs.html#537-542' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='../std/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='../src/core/convert.rs.html#539-541' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow' class='anchor'></a><a class='srclink' href='../src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow.v'>fn <a href='../std/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="primitive.reference.html">&amp;</a>T</code><a class='srclink' href='../src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="../std/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/borrow/trait.BorrowMut.html" title="trait std::borrow::BorrowMut">BorrowMut</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut' class='anchor'></a><a class='srclink' href='../src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow_mut.v'>fn <a href='../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='../src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/any/trait.Any.html" title="trait std::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='../src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='../std/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="../std/any/struct.TypeId.html" title="struct std::any::TypeId">TypeId</a></code><a class='srclink' href='../src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="../std/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='../src/alloc/borrow.rs.html#80-91' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned-1' class="type"><code id='Owned.t-1'>type <a href='../std/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='../std/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&amp;self) -&gt; T</code><a class='srclink' href='../src/alloc/borrow.rs.html#84-86' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="../std/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='../std/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&amp;self, target: <a class="primitive" href="primitive.reference.html">&amp;mut </a>T)</code><a class='srclink' href='../src/alloc/borrow.rs.html#88-90' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/41263">#41263</a>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="../std/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../std/string/trait.ToString.html" title="trait std::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../std/fmt/trait.Display.html" title="trait std::fmt::Display">Display</a> + ?<a class="trait" href="../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='../src/alloc/string.rs.html#2122-2132' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='../std/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&amp;self) -&gt; <a class="struct" href="../std/string/struct.String.html" title="struct std::string::String">String</a></code><a class='srclink' href='../src/alloc/string.rs.html#2124-2131' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="../std/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></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="../main1.35.0.js"></script><script defer src="../search-index.js"></script></body></html>