edlang/unicode_normalization/index.html
2024-07-26 09:42:18 +00:00

30 lines
10 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Unicode character composition and decomposition utilities as described in Unicode Standard Annex #15."><title>unicode_normalization - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="unicode_normalization" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0 (051478957 2024-07-21)" data-channel="1.80.0" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://unicode-rs.github.io/unicode-rs_sm.png"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../unicode_normalization/index.html"><img src="https://unicode-rs.github.io/unicode-rs_sm.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../unicode_normalization/index.html"><img src="https://unicode-rs.github.io/unicode-rs_sm.png" alt="logo"></a><h2><a href="../unicode_normalization/index.html">unicode_normalization</a><span class="version">0.1.23</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">unicode_normalization</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/unicode_normalization/lib.rs.html#11-235">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unicode character composition and decomposition utilities
as described in
<a href="http://www.unicode.org/reports/tr15/">Unicode Standard Annex #15</a>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern crate </span>unicode_normalization;
<span class="kw">use </span>unicode_normalization::char::compose;
<span class="kw">use </span>unicode_normalization::UnicodeNormalization;
<span class="kw">fn </span>main() {
<span class="macro">assert_eq!</span>(compose(<span class="string">'A'</span>,<span class="string">'\u{30a}'</span>), <span class="prelude-val">Some</span>(<span class="string">'Å'</span>));
<span class="kw">let </span>s = <span class="string">"ÅΩ"</span>;
<span class="kw">let </span>c = s.nfc().collect::&lt;String&gt;();
<span class="macro">assert_eq!</span>(c, <span class="string">"ÅΩ"</span>);
}</code></pre></div>
<h2 id="cratesio"><a class="doc-anchor" href="#cratesio">§</a>crates.io</h2>
<p>You can use this package in your project by adding the following
to your <code>Cargo.toml</code>:</p>
<div class="example-wrap"><pre class="language-toml"><code>[dependencies]
unicode-normalization = &quot;0.1.20&quot;
</code></pre></div></div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="char/index.html" title="mod unicode_normalization::char">char</a></div><div class="desc docblock-short">Methods for composing and decomposing characters.</div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Decompositions.html" title="struct unicode_normalization::Decompositions">Decompositions</a></div><div class="desc docblock-short">External iterator for a string decompositions characters.</div></li><li><div class="item-name"><a class="struct" href="struct.Recompositions.html" title="struct unicode_normalization::Recompositions">Recompositions</a></div><div class="desc docblock-short">External iterator for a string recompositions characters.</div></li><li><div class="item-name"><a class="struct" href="struct.Replacements.html" title="struct unicode_normalization::Replacements">Replacements</a></div><div class="desc docblock-short">External iterator for replacements for a strings characters.</div></li><li><div class="item-name"><a class="struct" href="struct.StreamSafe.html" title="struct unicode_normalization::StreamSafe">StreamSafe</a></div><div class="desc docblock-short">UAX15-D4: This iterator keeps track of how many non-starters there have been
since the last starter in <em>NFKD</em> and will emit a Combining Grapheme Joiner
(U+034F) if the count exceeds 30.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.IsNormalized.html" title="enum unicode_normalization::IsNormalized">IsNormalized</a></div><div class="desc docblock-short">The QuickCheck algorithm can quickly determine if a text is or isnt
normalized without any allocations in many cases, but it has to be able to
return <code>Maybe</code> when a full decomposition and recomposition is necessary.</div></li></ul><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.UNICODE_VERSION.html" title="constant unicode_normalization::UNICODE_VERSION">UNICODE_VERSION</a></div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.UnicodeNormalization.html" title="trait unicode_normalization::UnicodeNormalization">UnicodeNormalization</a></div><div class="desc docblock-short">Methods for iterating over strings while applying Unicode normalizations
as described in
<a href="http://www.unicode.org/reports/tr15/">Unicode Standard Annex #15</a>.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.is_nfc.html" title="fn unicode_normalization::is_nfc">is_nfc</a></div><div class="desc docblock-short">Authoritatively check if a string is in NFC.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfc_quick.html" title="fn unicode_normalization::is_nfc_quick">is_nfc_quick</a></div><div class="desc docblock-short">Quickly check if a string is in NFC, potentially returning
<code>IsNormalized::Maybe</code> if further checks are necessary. In this case a check
like <code>s.chars().nfc().eq(s.chars())</code> should suffice.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfc_stream_safe.html" title="fn unicode_normalization::is_nfc_stream_safe">is_nfc_stream_safe</a></div><div class="desc docblock-short">Authoritatively check if a string is Stream-Safe NFC.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfc_stream_safe_quick.html" title="fn unicode_normalization::is_nfc_stream_safe_quick">is_nfc_stream_safe_quick</a></div><div class="desc docblock-short">Quickly check if a string is Stream-Safe NFC.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfd.html" title="fn unicode_normalization::is_nfd">is_nfd</a></div><div class="desc docblock-short">Authoritatively check if a string is in NFD.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfd_quick.html" title="fn unicode_normalization::is_nfd_quick">is_nfd_quick</a></div><div class="desc docblock-short">Quickly check if a string is in NFD.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfd_stream_safe.html" title="fn unicode_normalization::is_nfd_stream_safe">is_nfd_stream_safe</a></div><div class="desc docblock-short">Authoritatively check if a string is Stream-Safe NFD.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfd_stream_safe_quick.html" title="fn unicode_normalization::is_nfd_stream_safe_quick">is_nfd_stream_safe_quick</a></div><div class="desc docblock-short">Quickly check if a string is Stream-Safe NFD.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfkc.html" title="fn unicode_normalization::is_nfkc">is_nfkc</a></div><div class="desc docblock-short">Authoritatively check if a string is in NFKC.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfkc_quick.html" title="fn unicode_normalization::is_nfkc_quick">is_nfkc_quick</a></div><div class="desc docblock-short">Quickly check if a string is in NFKC.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfkd.html" title="fn unicode_normalization::is_nfkd">is_nfkd</a></div><div class="desc docblock-short">Authoritatively check if a string is in NFKD.</div></li><li><div class="item-name"><a class="fn" href="fn.is_nfkd_quick.html" title="fn unicode_normalization::is_nfkd_quick">is_nfkd_quick</a></div><div class="desc docblock-short">Quickly check if a string is in NFKD.</div></li></ul></section></div></main></body></html>