Files
GopherGate/target/doc/icu_properties/index.html
2026-02-26 12:00:21 -05:00

43 lines
12 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Definitions of Unicode Properties and APIs for retrieving property data in an appropriate data structure."><title>icu_properties - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="icu_properties" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></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]--><rustdoc-topbar><h2><a href="#">Crate icu_properties</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../icu_properties/index.html">icu_<wbr>properties</a><span class="version">2.1.2</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a><ul><li><a href="#property-data-as-codepointsetdatas" title="Property data as `CodePointSetData`s">Property data as <code>CodePointSetData</code>s</a></li><li><a href="#property-data-as-codepointmapdatas" title="Property data as `CodePointMapData`s">Property data as <code>CodePointMapData</code>s</a></li></ul></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>icu_<wbr>properties</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/icu_properties/lib.rs.html#5-100">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Definitions of <a href="https://unicode-org.github.io/icu/userguide/strings/properties.html">Unicode Properties</a> and APIs for
retrieving property data in an appropriate data structure.</p>
<p>This module is published as its own crate (<a href="https://docs.rs/icu_properties/latest/icu_properties/"><code>icu_properties</code></a>)
and as part of the <a href="https://docs.rs/icu/latest/icu/"><code>icu</code></a> crate. See the latter for more details on the ICU4X project.</p>
<p>APIs that return a <a href="struct.CodePointSetData.html" title="struct icu_properties::CodePointSetData"><code>CodePointSetData</code></a> exist for binary properties and certain enumerated
properties.</p>
<p>APIs that return a <a href="struct.CodePointMapData.html" title="struct icu_properties::CodePointMapData"><code>CodePointMapData</code></a> exist for certain enumerated properties.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2><h3 id="property-data-as-codepointsetdatas"><a class="doc-anchor" href="#property-data-as-codepointsetdatas">§</a>Property data as <code>CodePointSetData</code>s</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>icu::properties::{CodePointSetData, CodePointMapData};
<span class="kw">use </span>icu::properties::props::{GeneralCategory, Emoji};
<span class="comment">// A binary property as a `CodePointSetData`
</span><span class="macro">assert!</span>(CodePointSetData::new::&lt;Emoji&gt;().contains(<span class="string">'🎃'</span>)); <span class="comment">// U+1F383 JACK-O-LANTERN
</span><span class="macro">assert!</span>(!CodePointSetData::new::&lt;Emoji&gt;().contains(<span class="string">'木'</span>)); <span class="comment">// U+6728
// An individual enumerated property value as a `CodePointSetData`
</span><span class="kw">let </span>line_sep_data = CodePointMapData::&lt;GeneralCategory&gt;::new()
.get_set_for_value(GeneralCategory::LineSeparator);
<span class="kw">let </span>line_sep = line_sep_data.as_borrowed();
<span class="macro">assert!</span>(line_sep.contains(<span class="string">'\u{2028}'</span>));
<span class="macro">assert!</span>(!line_sep.contains(<span class="string">'\u{2029}'</span>));</code></pre></div><h3 id="property-data-as-codepointmapdatas"><a class="doc-anchor" href="#property-data-as-codepointmapdatas">§</a>Property data as <code>CodePointMapData</code>s</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>icu::properties::CodePointMapData;
<span class="kw">use </span>icu::properties::props::Script;
<span class="macro">assert_eq!</span>(CodePointMapData::&lt;Script&gt;::new().get(<span class="string">'🎃'</span>), Script::Common); <span class="comment">// U+1F383 JACK-O-LANTERN
</span><span class="macro">assert_eq!</span>(CodePointMapData::&lt;Script&gt;::new().get(<span class="string">'木'</span>), Script::Han); <span class="comment">// U+6728</span></code></pre></div></div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="props/index.html" title="mod icu_properties::props">props</a></dt><dd>This module defines all available properties.</dd><dt><a class="mod" href="provider/index.html" title="mod icu_properties::provider">provider</a></dt><dd>🚧 [Unstable] Data provider struct definitions for this ICU4X component.</dd><dt><a class="mod" href="script/index.html" title="mod icu_properties::script">script</a></dt><dd>Data and APIs for supporting Script_Extensions property
values in an efficient structure.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.CodePointMapData.html" title="struct icu_properties::CodePointMapData">Code<wbr>Point<wbr>MapData</a></dt><dd>A wrapper around code point map data.</dd><dt><a class="struct" href="struct.CodePointMapDataBorrowed.html" title="struct icu_properties::CodePointMapDataBorrowed">Code<wbr>Point<wbr>MapData<wbr>Borrowed</a></dt><dd>A borrowed wrapper around code point set data, returned by
[<code>CodePointSetData::as_borrowed()</code>]. More efficient to query.</dd><dt><a class="struct" href="struct.CodePointSetData.html" title="struct icu_properties::CodePointSetData">Code<wbr>Point<wbr>SetData</a></dt><dd>A set of Unicode code points. Access its data via the borrowed version,
<a href="struct.CodePointSetDataBorrowed.html" title="struct icu_properties::CodePointSetDataBorrowed"><code>CodePointSetDataBorrowed</code></a>.</dd><dt><a class="struct" href="struct.CodePointSetDataBorrowed.html" title="struct icu_properties::CodePointSetDataBorrowed">Code<wbr>Point<wbr>SetData<wbr>Borrowed</a></dt><dd>A borrowed wrapper around code point set data, returned by
<a href="struct.CodePointSetData.html#method.as_borrowed" title="method icu_properties::CodePointSetData::as_borrowed"><code>CodePointSetData::as_borrowed()</code></a>. More efficient to query.</dd><dt><a class="struct" href="struct.EmojiSetData.html" title="struct icu_properties::EmojiSetData">Emoji<wbr>SetData</a></dt><dd>A wrapper around <code>UnicodeSet</code> data (characters and strings)</dd><dt><a class="struct" href="struct.EmojiSetDataBorrowed.html" title="struct icu_properties::EmojiSetDataBorrowed">Emoji<wbr>SetData<wbr>Borrowed</a></dt><dd>A borrowed wrapper around code point set data, returned by
<a href="struct.EmojiSetData.html#method.as_borrowed" title="method icu_properties::EmojiSetData::as_borrowed"><code>EmojiSetData::as_borrowed()</code></a>. More efficient to query.</dd><dt><a class="struct" href="struct.PropertyNamesLong.html" title="struct icu_properties::PropertyNamesLong">Property<wbr>Names<wbr>Long</a></dt><dd>A struct capable of looking up a property name from a value
Access its data by calling <a href="struct.PropertyNamesLong.html#method.as_borrowed" title="method icu_properties::PropertyNamesLong::as_borrowed"><code>Self::as_borrowed()</code></a> and using the methods on
<a href="struct.PropertyNamesLongBorrowed.html" title="struct icu_properties::PropertyNamesLongBorrowed"><code>PropertyNamesLongBorrowed</code></a>.</dd><dt><a class="struct" href="struct.PropertyNamesLongBorrowed.html" title="struct icu_properties::PropertyNamesLongBorrowed">Property<wbr>Names<wbr>Long<wbr>Borrowed</a></dt><dd>A borrowed wrapper around property value name-to-enum data, returned by
<a href="struct.PropertyNamesLong.html#method.as_borrowed" title="method icu_properties::PropertyNamesLong::as_borrowed"><code>PropertyNamesLong::as_borrowed()</code></a>. More efficient to query.</dd><dt><a class="struct" href="struct.PropertyNamesShort.html" title="struct icu_properties::PropertyNamesShort">Property<wbr>Names<wbr>Short</a></dt><dd>A struct capable of looking up a property name from a value
Access its data by calling <a href="struct.PropertyNamesShort.html#method.as_borrowed" title="method icu_properties::PropertyNamesShort::as_borrowed"><code>Self::as_borrowed()</code></a> and using the methods on
<a href="struct.PropertyNamesShortBorrowed.html" title="struct icu_properties::PropertyNamesShortBorrowed"><code>PropertyNamesShortBorrowed</code></a>.</dd><dt><a class="struct" href="struct.PropertyNamesShortBorrowed.html" title="struct icu_properties::PropertyNamesShortBorrowed">Property<wbr>Names<wbr>Short<wbr>Borrowed</a></dt><dd>A borrowed wrapper around property value name-to-enum data, returned by
<a href="struct.PropertyNamesShort.html#method.as_borrowed" title="method icu_properties::PropertyNamesShort::as_borrowed"><code>PropertyNamesShort::as_borrowed()</code></a>. More efficient to query.</dd><dt><a class="struct" href="struct.PropertyParser.html" title="struct icu_properties::PropertyParser">Property<wbr>Parser</a></dt><dd>A struct capable of looking up a property value from a string name.
Access its data by calling <a href="struct.PropertyParser.html#method.as_borrowed" title="method icu_properties::PropertyParser::as_borrowed"><code>Self::as_borrowed()</code></a> and using the methods on
<a href="struct.PropertyParserBorrowed.html" title="struct icu_properties::PropertyParserBorrowed"><code>PropertyParserBorrowed</code></a>.</dd><dt><a class="struct" href="struct.PropertyParserBorrowed.html" title="struct icu_properties::PropertyParserBorrowed">Property<wbr>Parser<wbr>Borrowed</a></dt><dd>A borrowed wrapper around property value name-to-enum data, returned by
<a href="struct.PropertyParser.html#method.as_borrowed" title="method icu_properties::PropertyParser::as_borrowed"><code>PropertyParser::as_borrowed()</code></a>. More efficient to query.</dd></dl></section></div></main></body></html>