26 lines
9.9 KiB
HTML
26 lines
9.9 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="This module provides a data structure for an time-efficient lookup of values associated to code points."><title>icu_collections::codepointtrie - 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_collections" 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="../sidebar-items.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"><!--[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="#">Module codepointtrie</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../icu_collections/index.html">icu_<wbr>collections</a><span class="version">2.1.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module codepointtrie</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#architecture" title="Architecture">Architecture</a></li><li><a href="#examples" title="Examples">Examples</a><ul><li><a href="#querying-a-codepointtrie" title="Querying a `CodePointTrie`">Querying a <code>CodePointTrie</code></a></li></ul></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate icu_<wbr>collections</a></h2></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"><div class="rustdoc-breadcrumbs"><a href="../index.html">icu_collections</a></div><h1>Module <span>codepointtrie</span> <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_collections/codepointtrie/mod.rs.html#5-53">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module provides a data structure for an time-efficient lookup of values
|
||
associated to code points.</p>
|
||
<p>It is an implementation of the existing <a href="https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucptrie_8h.html">ICU4C UCPTrie</a>
|
||
/ <a href="https://unicode-org.github.io/icu-docs/apidoc/dev/icu4j/">ICU4J CodePointTrie</a> API.</p>
|
||
<h2 id="architecture"><a class="doc-anchor" href="#architecture">§</a>Architecture</h2>
|
||
<p>ICU4X <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a> is designed to provide a read-only view of <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a> data that is exported
|
||
from ICU4C. Detailed information about the design of the data structure can be found in the documentation
|
||
for the <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a> struct.</p>
|
||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2><h3 id="querying-a-codepointtrie"><a class="doc-anchor" href="#querying-a-codepointtrie">§</a>Querying a <code>CodePointTrie</code></h3>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>icu::collections::codepointtrie::planes;
|
||
<span class="kw">let </span>trie = planes::get_planes_trie();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="number">0</span>, trie.get32(<span class="number">0x41</span>)); <span class="comment">// 'A' as u32
|
||
</span><span class="macro">assert_eq!</span>(<span class="number">0</span>, trie.get32(<span class="number">0x13E0</span>)); <span class="comment">// 'Ꮰ' as u32
|
||
</span><span class="macro">assert_eq!</span>(<span class="number">1</span>, trie.get32(<span class="number">0x10044</span>)); <span class="comment">// '𐁄' as u32</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="planes/index.html" title="mod icu_collections::codepointtrie::planes">planes</a></dt><dd>Sample data for <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a> that returns the code point’s plane number.</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.CodePointMapRange.html" title="struct icu_collections::codepointtrie::CodePointMapRange">Code<wbr>Point<wbr>MapRange</a></dt><dd>Represents a range of consecutive code points sharing the same value in a
|
||
code point map.</dd><dt><a class="struct" href="struct.CodePointMapRangeIterator.html" title="struct icu_collections::codepointtrie::CodePointMapRangeIterator">Code<wbr>Point<wbr>MapRange<wbr>Iterator</a></dt><dd>A custom <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator"><code>Iterator</code></a> type specifically for a code point trie that returns
|
||
<a href="struct.CodePointMapRange.html" title="struct icu_collections::codepointtrie::CodePointMapRange"><code>CodePointMapRange</code></a>s.</dd><dt><a class="struct" href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie">Code<wbr>Point<wbr>Trie</a></dt><dd>This struct represents a de-serialized <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a> that was exported from
|
||
ICU binary data.</dd><dt><a class="struct" href="struct.CodePointTrieHeader.html" title="struct icu_collections::codepointtrie::CodePointTrieHeader">Code<wbr>Point<wbr>Trie<wbr>Header</a></dt><dd>This struct contains the fixed-length header fields of a <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a>.</dd><dt><a class="struct" href="struct.FastCodePointTrie.html" title="struct icu_collections::codepointtrie::FastCodePointTrie">Fast<wbr>Code<wbr>Point<wbr>Trie</a></dt><dd>Type-safe wrapper for a fast trie guaranteeing
|
||
the the getters don’t branch on the trie type
|
||
and for guarenteeing that <code>get16</code> is branchless
|
||
in release builds.</dd><dt><a class="struct" href="struct.SmallCodePointTrie.html" title="struct icu_collections::codepointtrie::SmallCodePointTrie">Small<wbr>Code<wbr>Point<wbr>Trie</a></dt><dd>Type-safe wrapper for a small trie guaranteeing
|
||
the the getters don’t branch on the trie type.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.CodePointTrieError.html" title="enum icu_collections::codepointtrie::CodePointTrieError">Code<wbr>Point<wbr>Trie<wbr>Error</a></dt><dd>A custom error type for <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a>.</dd><dt><a class="enum" href="enum.TrieType.html" title="enum icu_collections::codepointtrie::TrieType">Trie<wbr>Type</a></dt><dd>The type of trie represents whether the trie has an optimization that
|
||
would make it smaller or faster.</dd><dt><a class="enum" href="enum.Typed.html" title="enum icu_collections::codepointtrie::Typed">Typed</a></dt><dd>Holder for either fast or small trie with the trie
|
||
type encoded into the Rust type.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.TrieValue.html" title="trait icu_collections::codepointtrie::TrieValue">Trie<wbr>Value</a></dt><dd>A trait representing the values stored in the data array of a <a href="struct.CodePointTrie.html" title="struct icu_collections::codepointtrie::CodePointTrie"><code>CodePointTrie</code></a>.
|
||
This trait is used as a type parameter in constructing a <code>CodePointTrie</code>.</dd><dt><a class="trait" href="trait.TypedCodePointTrie.html" title="trait icu_collections::codepointtrie::TypedCodePointTrie">Typed<wbr>Code<wbr>Point<wbr>Trie</a></dt><dd>Trait for writing trait bounds for monomorphizing over either
|
||
<code>FastCodePointTrie</code> or <code>SmallCodePointTrie</code>.</dd></dl></section></div></main></body></html> |