blob: 6f39475ee47c74d6a61c1d8e93227a6ee1d11daa [file] [log] [blame]
<!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="Methods for segmenting strings according to Unicode Standard Annex #29."><meta name="keywords" content="rust, rustlang, rust-lang, UnicodeSegmentation"><title>UnicodeSegmentation in unicode_segmentation - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" href="https://unicode-rs.github.io/unicode-rs_sm.png"></head><body class="rustdoc trait"><!--[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">&#9776;</button><a class="sidebar-logo" href="../unicode_segmentation/index.html"><div class="logo-container"><img src="https://unicode-rs.github.io/unicode-rs_sm.png" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../unicode_segmentation/index.html"><div class="logo-container">
<img src="https://unicode-rs.github.io/unicode-rs_sm.png" alt="logo"></div></a><h2 class="location"><a href="#">UnicodeSegmentation</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.grapheme_indices">grapheme_indices</a></li><li><a href="#tymethod.graphemes">graphemes</a></li><li><a href="#tymethod.split_sentence_bound_indices">split_sentence_bound_indices</a></li><li><a href="#tymethod.split_sentence_bounds">split_sentence_bounds</a></li><li><a href="#tymethod.split_word_bound_indices">split_word_bound_indices</a></li><li><a href="#tymethod.split_word_bounds">split_word_bounds</a></li><li><a href="#tymethod.unicode_sentences">unicode_sentences</a></li><li><a href="#tymethod.unicode_word_indices">unicode_word_indices</a></li><li><a href="#tymethod.unicode_words">unicode_words</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-UnicodeSegmentation-for-str">str</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In unicode_segmentation</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="index.html">unicode_segmentation</a>::<wbr><a class="trait" href="#">UnicodeSegmentation</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/unicode_segmentation/lib.rs.html#86-260">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait UnicodeSegmentation {
fn <a href="#tymethod.graphemes" class="fnname">graphemes</a>&lt;'a&gt;(&amp;'a self, is_extended: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.grapheme_indices" class="fnname">grapheme_indices</a>&lt;'a&gt;(&amp;'a self, is_extended: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.unicode_words" class="fnname">unicode_words</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.unicode_word_indices" class="fnname">unicode_word_indices</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.split_word_bounds" class="fnname">split_word_bounds</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.split_word_bound_indices" class="fnname">split_word_bound_indices</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.unicode_sentences" class="fnname">unicode_sentences</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.split_sentence_bounds" class="fnname">split_sentence_bounds</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.split_sentence_bound_indices" class="fnname">split_sentence_bound_indices</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span>;
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Methods for segmenting strings according to
<a href="http://www.unicode.org/reports/tr29/">Unicode Standard Annex #29</a>.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.graphemes" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#112">source</a><h4 class="code-header">fn <a href="#tymethod.graphemes" class="fnname">graphemes</a>&lt;'a&gt;(&amp;'a self, is_extended: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over the <a href="http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries">grapheme clusters</a> of <code>self</code>.</p>
<p>If <code>is_extended</code> is true, the iterator is over the
<em>extended grapheme clusters</em>;
otherwise, the iterator is over the <em>legacy grapheme clusters</em>.
<a href="http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries">UAX#29</a>
recommends extended grapheme cluster boundaries for general processing.</p>
<h5 id="examples"><a href="#examples">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>gr1 = UnicodeSegmentation::graphemes(<span class="string">&quot;a\u{310}e\u{301}o\u{308}\u{332}&quot;</span>, <span class="bool-val">true</span>)
.collect::&lt;Vec&lt;<span class="kw-2">&amp;</span>str&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[<span class="string">&quot;a\u{310}&quot;</span>, <span class="string">&quot;e\u{301}&quot;</span>, <span class="string">&quot;o\u{308}\u{332}&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>gr1[..], b);
<span class="kw">let </span>gr2 = UnicodeSegmentation::graphemes(<span class="string">&quot;a\r\nb🇷🇺🇸🇹&quot;</span>, <span class="bool-val">true</span>).collect::&lt;Vec&lt;<span class="kw-2">&amp;</span>str&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[<span class="string">&quot;a&quot;</span>, <span class="string">&quot;\r\n&quot;</span>, <span class="string">&quot;b&quot;</span>, <span class="string">&quot;🇷🇺&quot;</span>, <span class="string">&quot;🇸🇹&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>gr2[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.grapheme_indices" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#127">source</a><h4 class="code-header">fn <a href="#tymethod.grapheme_indices" class="fnname">grapheme_indices</a>&lt;'a&gt;(&amp;'a self, is_extended: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over the grapheme clusters of <code>self</code> and their
byte offsets. See <code>graphemes()</code> for more information.</p>
<h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>gr_inds = UnicodeSegmentation::grapheme_indices(<span class="string">&quot;a̐éö̲\r\n&quot;</span>, <span class="bool-val">true</span>)
.collect::&lt;Vec&lt;(usize, <span class="kw-2">&amp;</span>str)&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[(<span class="number">0</span>, <span class="string">&quot;a̐&quot;</span>), (<span class="number">3</span>, <span class="string">&quot;é&quot;</span>), (<span class="number">6</span>, <span class="string">&quot;ö̲&quot;</span>), (<span class="number">11</span>, <span class="string">&quot;\r\n&quot;</span>)];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>gr_inds[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.unicode_words" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#149">source</a><h4 class="code-header">fn <a href="#tymethod.unicode_words" class="fnname">unicode_words</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over the words of <code>self</code>, separated on
<a href="http://www.unicode.org/reports/tr29/#Word_Boundaries">UAX#29 word boundaries</a>.</p>
<p>Here, “words” are just those substrings which, after splitting on
UAX#29 word boundaries, contain any alphanumeric characters. That is, the
substring must contain at least one character with the
<a href="http://unicode.org/reports/tr44/#Alphabetic">Alphabetic</a>
property, or with
<a href="http://unicode.org/reports/tr44/#General_Category_Values">General_Category=Number</a>.</p>
<h5 id="example"><a href="#example">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uws = <span class="string">&quot;The quick (\&quot;brown\&quot;) fox can&#39;t jump 32.3 feet, right?&quot;</span>;
<span class="kw">let </span>uw1 = uws.unicode_words().collect::&lt;Vec&lt;<span class="kw-2">&amp;</span>str&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[<span class="string">&quot;The&quot;</span>, <span class="string">&quot;quick&quot;</span>, <span class="string">&quot;brown&quot;</span>, <span class="string">&quot;fox&quot;</span>, <span class="string">&quot;can&#39;t&quot;</span>, <span class="string">&quot;jump&quot;</span>, <span class="string">&quot;32.3&quot;</span>, <span class="string">&quot;feet&quot;</span>, <span class="string">&quot;right&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>uw1[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.unicode_word_indices" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#173">source</a><h4 class="code-header">fn <a href="#tymethod.unicode_word_indices" class="fnname">unicode_word_indices</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over the words of <code>self</code>, separated on
<a href="http://www.unicode.org/reports/tr29/#Word_Boundaries">UAX#29 word boundaries</a>, and their
offsets.</p>
<p>Here, “words” are just those substrings which, after splitting on
UAX#29 word boundaries, contain any alphanumeric characters. That is, the
substring must contain at least one character with the
<a href="http://unicode.org/reports/tr44/#Alphabetic">Alphabetic</a>
property, or with
<a href="http://unicode.org/reports/tr44/#General_Category_Values">General_Category=Number</a>.</p>
<h5 id="example-1"><a href="#example-1">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uwis = <span class="string">&quot;The quick (\&quot;brown\&quot;) fox can&#39;t jump 32.3 feet, right?&quot;</span>;
<span class="kw">let </span>uwi1 = uwis.unicode_word_indices().collect::&lt;Vec&lt;(usize, <span class="kw-2">&amp;</span>str)&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[(<span class="number">0</span>, <span class="string">&quot;The&quot;</span>), (<span class="number">4</span>, <span class="string">&quot;quick&quot;</span>), (<span class="number">12</span>, <span class="string">&quot;brown&quot;</span>), (<span class="number">20</span>, <span class="string">&quot;fox&quot;</span>), (<span class="number">24</span>, <span class="string">&quot;can&#39;t&quot;</span>),
(<span class="number">30</span>, <span class="string">&quot;jump&quot;</span>), (<span class="number">35</span>, <span class="string">&quot;32.3&quot;</span>), (<span class="number">40</span>, <span class="string">&quot;feet&quot;</span>), (<span class="number">46</span>, <span class="string">&quot;right&quot;</span>)];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>uwi1[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.split_word_bounds" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#189">source</a><h4 class="code-header">fn <a href="#tymethod.split_word_bounds" class="fnname">split_word_bounds</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of <code>self</code> separated on
<a href="http://www.unicode.org/reports/tr29/#Word_Boundaries">UAX#29 word boundaries</a>.</p>
<p>The concatenation of the substrings returned by this function is just the original string.</p>
<h5 id="example-2"><a href="#example-2">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>swu1 = <span class="string">&quot;The quick (\&quot;brown\&quot;) fox&quot;</span>.split_word_bounds().collect::&lt;Vec&lt;<span class="kw-2">&amp;</span>str&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[<span class="string">&quot;The&quot;</span>, <span class="string">&quot; &quot;</span>, <span class="string">&quot;quick&quot;</span>, <span class="string">&quot; &quot;</span>, <span class="string">&quot;(&quot;</span>, <span class="string">&quot;\&quot;&quot;</span>, <span class="string">&quot;brown&quot;</span>, <span class="string">&quot;\&quot;&quot;</span>, <span class="string">&quot;)&quot;</span>, <span class="string">&quot; &quot;</span>, <span class="string">&quot;fox&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>swu1[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.split_word_bound_indices" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#204">source</a><h4 class="code-header">fn <a href="#tymethod.split_word_bound_indices" class="fnname">split_word_bound_indices</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of <code>self</code>, split on UAX#29 word boundaries,
and their offsets. See <code>split_word_bounds()</code> for more information.</p>
<h5 id="example-3"><a href="#example-3">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>swi1 = <span class="string">&quot;Brr, it&#39;s 29.3°F!&quot;</span>.split_word_bound_indices().collect::&lt;Vec&lt;(usize, <span class="kw-2">&amp;</span>str)&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[(<span class="number">0</span>, <span class="string">&quot;Brr&quot;</span>), (<span class="number">3</span>, <span class="string">&quot;,&quot;</span>), (<span class="number">4</span>, <span class="string">&quot; &quot;</span>), (<span class="number">5</span>, <span class="string">&quot;it&#39;s&quot;</span>), (<span class="number">9</span>, <span class="string">&quot; &quot;</span>), (<span class="number">10</span>, <span class="string">&quot;29.3&quot;</span>),
(<span class="number">14</span>, <span class="string">&quot;°&quot;</span>), (<span class="number">16</span>, <span class="string">&quot;F&quot;</span>), (<span class="number">17</span>, <span class="string">&quot;!&quot;</span>)];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>swi1[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.unicode_sentences" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#226">source</a><h4 class="code-header">fn <a href="#tymethod.unicode_sentences" class="fnname">unicode_sentences</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of <code>self</code> separated on
<a href="http://www.unicode.org/reports/tr29/#Sentence_Boundaries">UAX#29 sentence boundaries</a>.</p>
<p>Here, “sentences” are just those substrings which, after splitting on
UAX#29 sentence boundaries, contain any alphanumeric characters. That is, the
substring must contain at least one character with the
<a href="http://unicode.org/reports/tr44/#Alphabetic">Alphabetic</a>
property, or with
<a href="http://unicode.org/reports/tr44/#General_Category_Values">General_Category=Number</a>.</p>
<h5 id="example-4"><a href="#example-4">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>uss = <span class="string">&quot;Mr. Fox jumped. [...] The dog was too lazy.&quot;</span>;
<span class="kw">let </span>us1 = uss.unicode_sentences().collect::&lt;Vec&lt;<span class="kw-2">&amp;</span>str&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[<span class="string">&quot;Mr. &quot;</span>, <span class="string">&quot;Fox jumped. &quot;</span>, <span class="string">&quot;The dog was too lazy.&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>us1[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.split_sentence_bounds" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#243">source</a><h4 class="code-header">fn <a href="#tymethod.split_sentence_bounds" class="fnname">split_sentence_bounds</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of <code>self</code> separated on
<a href="http://www.unicode.org/reports/tr29/#Sentence_Boundaries">UAX#29 sentence boundaries</a>.</p>
<p>The concatenation of the substrings returned by this function is just the original string.</p>
<h5 id="example-5"><a href="#example-5">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ssbs = <span class="string">&quot;Mr. Fox jumped. [...] The dog was too lazy.&quot;</span>;
<span class="kw">let </span>ssb1 = ssbs.split_sentence_bounds().collect::&lt;Vec&lt;<span class="kw-2">&amp;</span>str&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[<span class="string">&quot;Mr. &quot;</span>, <span class="string">&quot;Fox jumped. &quot;</span>, <span class="string">&quot;[...] &quot;</span>, <span class="string">&quot;The dog was too lazy.&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>ssb1[..], b);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.split_sentence_bound_indices" class="method has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#259">source</a><h4 class="code-header">fn <a href="#tymethod.split_sentence_bound_indices" class="fnname">split_sentence_bound_indices</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of <code>self</code>, split on UAX#29 sentence boundaries,
and their offsets. See <code>split_sentence_bounds()</code> for more information.</p>
<h5 id="example-6"><a href="#example-6">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ssis = <span class="string">&quot;Mr. Fox jumped. [...] The dog was too lazy.&quot;</span>;
<span class="kw">let </span>ssi1 = ssis.split_sentence_bound_indices().collect::&lt;Vec&lt;(usize, <span class="kw-2">&amp;</span>str)&gt;&gt;();
<span class="kw">let </span>b: <span class="kw-2">&amp;</span>[<span class="kw">_</span>] = <span class="kw-2">&amp;</span>[(<span class="number">0</span>, <span class="string">&quot;Mr. &quot;</span>), (<span class="number">4</span>, <span class="string">&quot;Fox jumped. &quot;</span>), (<span class="number">16</span>, <span class="string">&quot;[...] &quot;</span>),
(<span class="number">22</span>, <span class="string">&quot;The dog was too lazy.&quot;</span>)];
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>ssi1[..], b);</code></pre></div>
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-UnicodeSegmentation-for-str" class="impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#262-307">source</a><a href="#impl-UnicodeSegmentation-for-str" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.UnicodeSegmentation.html" title="trait unicode_segmentation::UnicodeSegmentation">UnicodeSegmentation</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><section id="method.graphemes" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#264-266">source</a><a href="#method.graphemes" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.graphemes" class="fnname">graphemes</a>(&amp;self, is_extended: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Graphemes.html" title="struct unicode_segmentation::Graphemes">Graphemes</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section><section id="method.grapheme_indices" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#269-271">source</a><a href="#method.grapheme_indices" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.grapheme_indices" class="fnname">grapheme_indices</a>(&amp;self, is_extended: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.GraphemeIndices.html" title="struct unicode_segmentation::GraphemeIndices">GraphemeIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section><section id="method.unicode_words" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#274-276">source</a><a href="#method.unicode_words" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.unicode_words" class="fnname">unicode_words</a>(&amp;self) -&gt; <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeWords.html" title="struct unicode_segmentation::UnicodeWords">UnicodeWords</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section><section id="method.unicode_word_indices" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#279-281">source</a><a href="#method.unicode_word_indices" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.unicode_word_indices" class="fnname">unicode_word_indices</a>(&amp;self) -&gt; <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeWordIndices.html" title="struct unicode_segmentation::UnicodeWordIndices">UnicodeWordIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section><section id="method.split_word_bounds" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#284-286">source</a><a href="#method.split_word_bounds" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.split_word_bounds" class="fnname">split_word_bounds</a>(&amp;self) -&gt; <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UWordBounds.html" title="struct unicode_segmentation::UWordBounds">UWordBounds</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section><section id="method.split_word_bound_indices" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#289-291">source</a><a href="#method.split_word_bound_indices" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.split_word_bound_indices" class="fnname">split_word_bound_indices</a>(&amp;self) -&gt; <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UWordBoundIndices.html" title="struct unicode_segmentation::UWordBoundIndices">UWordBoundIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section><section id="method.unicode_sentences" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#294-296">source</a><a href="#method.unicode_sentences" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.unicode_sentences" class="fnname">unicode_sentences</a>(&amp;self) -&gt; <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.UnicodeSentences.html" title="struct unicode_segmentation::UnicodeSentences">UnicodeSentences</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section><section id="method.split_sentence_bounds" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#299-301">source</a><a href="#method.split_sentence_bounds" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.split_sentence_bounds" class="fnname">split_sentence_bounds</a>(&amp;self) -&gt; <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.USentenceBounds.html" title="struct unicode_segmentation::USentenceBounds">USentenceBounds</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>;</span></code></span></span></span></span></h4></section><section id="method.split_sentence_bound_indices" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/unicode_segmentation/lib.rs.html#304-306">source</a><a href="#method.split_sentence_bound_indices" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.split_sentence_bound_indices" class="fnname">split_sentence_bound_indices</a>(&amp;self) -&gt; <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'_&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.USentenceBoundIndices.html" title="struct unicode_segmentation::USentenceBoundIndices">USentenceBoundIndices</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</a>);</span></code></span></span></span></span></h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"></div><script src="../implementors/unicode_segmentation/trait.UnicodeSegmentation.js" data-ignore-extern-crates="core" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="unicode_segmentation" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>