<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="This crate implements the Unicode Bidirectional Algorithm for display of mixed right-to-left and left-to-right text. It is written in safe Rust, compatible with the current stable release."><title>unicode_bidi - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../static.files/rustdoc-5bc39a1768837dd0.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="unicode_bidi"data-themes=""data-resource-suffix=""data-rustdoc-version="1.77.1 (7cf61ebde 2024-03-27)"data-channel="1.77.1"data-search-js="search-dd67cee4cfa65049.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../static.files/storage-4c98445ec4002617.js"></script><scriptdefersrc="../crates.js"></script><scriptdefersrc="../static.files/main-48f368f3872407c8.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-04d5337699b92874.css"></noscript><linkrel="alternate icon"type="image/png"href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle"title="show sidebar"></button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../unicode_bidi/index.html">unicode_bidi</a><spanclass="version">0.3.15</span></h2></div><divclass="sidebar-elems"><ulclass="block">
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../unicode_bidi/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Crate <aclass="mod"href="#">unicode_bidi</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../src/unicode_bidi/lib.rs.html#10-2242">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>This crate implements the <ahref="http://www.unicode.org/reports/tr9/">Unicode Bidirectional Algorithm</a> for display of mixed
right-to-left and left-to-right text. It is written in safe Rust, compatible with the
</div></details><h2id="reexports"class="section-header">Re-exports<ahref="#reexports"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"id="reexport.BidiDataSource"><code>pub use crate::data_source::<aclass="trait"href="data_source/trait.BidiDataSource.html"title="trait unicode_bidi::data_source::BidiDataSource">BidiDataSource</a>;</code></div></li><li><divclass="item-name"id="reexport.Level"><code>pub use crate::level::<aclass="struct"href="level/struct.Level.html"title="struct unicode_bidi::level::Level">Level</a>;</code></div></li><li><divclass="item-name"id="reexport.LTR_LEVEL"><code>pub use crate::level::<aclass="constant"href="level/constant.LTR_LEVEL.html"title="constant unicode_bidi::level::LTR_LEVEL">LTR_LEVEL</a>;</code></div></li><li><divclass="item-name"id="reexport.RTL_LEVEL"><code>pub use crate::level::<aclass="constant"href="level/constant.RTL_LEVEL.html"title="constant unicode_bidi::level::RTL_LEVEL">RTL_LEVEL</a>;</code></div></li></ul><h2id="modules"class="section-header">Modules<ahref="#modules"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="mod"href="data_source/index.html"title="mod unicode_bidi::data_source">data_source</a></div></li><li><divclass="item-name"><aclass="mod"href="deprecated/index.html"title="mod unicode_bidi::deprecated">deprecated</a></div><divclass="desc docblock-short">This module holds deprecated assets only.</div></li><li><divclass="item-name"><aclass="mod"href="format_chars/index.html"title="mod unicode_bidi::format_chars">format_chars</a></div><divclass="desc docblock-short">Directional Formatting Characters</div></li><li><divclass="item-name"><aclass="mod"href="level/index.html"title="mod unicode_bidi::level">level</a></div><divclass="desc docblock-short">Bidi Embedding Level</div></li><li><divclass="item-name"><aclass="mod"href="utf16/index.html"title="mod unicode_bidi::utf16">utf16</a></div></li></ul><h2id="structs"class="section-header">Structs<ahref="#structs"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="struct"href="struct.BidiInfo.html"title="struct unicode_bidi::BidiInfo">BidiInfo</a></div><divclass="desc docblock-short">Bidi information of the text.</div></li><li><divclass="item-name"><aclass="struct"href="struct.HardcodedBidiData.html"title="struct unicode_bidi::HardcodedBidiData">HardcodedBidiData</a></div><divclass="desc docblock-short">Hardcoded Bidi data that ships with the unicode-bidi crate.</div></li><li><divclass="item-name"><aclass="struct"href="struct.InitialInfo.html"title="struct unicode_bidi::InitialInfo">InitialInfo</a></div><divclass="desc docblock-short">Initial bidi information of the text.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Paragraph.html"title="struct unicode_bidi::Paragraph">Paragraph</a></div><divclass="desc docblock-short">Contains a reference of <code>BidiInfo</code> and one of its <code>paragraphs</code>.
<code>BidiInfo</code> such as <code>direction</code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.ParagraphBidiInfo.html"title="struct unicode_bidi::ParagraphBidiInfo">ParagraphBidiInfo</a></div><divclass="desc docblock-short">Bidi information of text treated as a single paragraph.</div></li><li><divclass="item-name"><aclass="struct"href="struct.ParagraphInfo.html"title="struct unicode_bidi::ParagraphInfo">ParagraphInfo</a></div><divclass="desc docblock-short">Bidi information about a single paragraph</div></li><li><divclass="item-name"><aclass="struct"href="struct.Utf8IndexLenIter.html"title="struct unicode_bidi::Utf8IndexLenIter">Utf8IndexLenIter</a></div><divclass="desc docblock-short">Iterator over (UTF-8) string slices returning (index, char_len) tuple.</div></li></ul><h2id="enums"class="section-header">Enums<ahref="#enums"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="enum"href="enum.BidiClass.html"title="enum unicode_bidi::BidiClass">BidiClass</a></div><divclass="desc docblock-short">Represents values of the Unicode character property
known as the <em>bidirectional character type</em>.</div></li><li><divclass="item-name"><aclass="enum"href="enum.Direction.html"title="enum unicode_bidi::Direction">Direction</a></div></li></ul><h2id="constants"class="section-header">Constants<ahref="#constants"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="constant"href="constant.UNICODE_VERSION.html"title="constant unicode_bidi::UNICODE_VERSION">UNICODE_VERSION</a></div><divclass="desc docblock-short">The <ahref="http://www.unicode.org/versions/">Unicode version</a> of data</div></li></ul><h2id="traits"class="section-header">Traits<ahref="#traits"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="trait"href="trait.TextSource.html"title="trait unicode_bidi::TextSource">TextSource</a></div><divclass="desc docblock-short">Trait that abstracts over a text source for use by the bidi algorithms.
We implement this for str (UTF-8) and for <ahref="https://doc.rust-lang.org/1.77.1/std/primitive.u16.html"title="primitive u16">u16</a> (UTF-16, native-endian).
This trait is sealed and cannot be implemented for types outside this crate.</div></li></ul><h2id="functions"class="section-header">Functions<ahref="#functions"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="fn"href="fn.bidi_class.html"title="fn unicode_bidi::bidi_class">bidi_class</a></div><divclass="desc docblock-short">Find the <code>BidiClass</code> of a single char.</div></li><li><divclass="item-name"><aclass="fn"href="fn.get_base_direction.html"title="fn unicode_bidi::get_base_direction">get_base_direction</a></div><divclass="desc docblock-short">Get the base direction of the text provided according to the Unicode Bidirectional Algorithm.</div></li><li><divclass="item-name"><aclass="fn"href="fn.get_base_direction_full.html"title="fn unicode_bidi::get_base_direction_full">get_base_direction_full</a></div><divclass="desc docblock-short">Get the base direction of the text provided according to the Unicode Bidirectional Algorithm,
considering the full text if the first paragraph is all-neutral.</div></li><li><divclass="item-name"><aclass="fn"href="fn.get_base_direction_full_with_data_source.html"title="fn unicode_bidi::get_base_direction_full_with_data_source">get_base_direction_full_with_data_source</a></div></li><li><divclass="item-name"><aclass="fn"href="fn.get_base_direction_with_data_source.html"title="fn unicode_bidi::get_base_direction_with_data_source">get_base_direction_with_data_source</a></div></li></ul><h2id="types"class="section-header">Type Aliases<ahref="#types"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="type"href="type.LevelRun.html"title="type unicode_bidi::LevelRun">LevelRun</a></div><divclass="desc docblock-short">A maximal substring of characters with the same embedding level.</div></li></ul></section></div></main></body></html>