pub struct ICU4XBidi(pub CodePointMapData<BidiClass>);
Expand description
An ICU4X Bidi object, containing loaded bidi data
Tuple Fields§
§0: CodePointMapData<BidiClass>
Implementations§
Source§impl ICU4XBidi
impl ICU4XBidi
Sourcepub fn create(
provider: &ICU4XDataProvider,
) -> Result<Box<ICU4XBidi>, ICU4XError>
pub fn create( provider: &ICU4XDataProvider, ) -> Result<Box<ICU4XBidi>, ICU4XError>
Creates a new ICU4XBidi
from locale data.
Sourcepub fn for_text<'text>(
&self,
text: &'text DiplomatStr,
default_level: u8,
) -> Option<Box<ICU4XBidiInfo<'text>>>
pub fn for_text<'text>( &self, text: &'text DiplomatStr, default_level: u8, ) -> Option<Box<ICU4XBidiInfo<'text>>>
Use the data loaded in this object to process a string and calculate bidi information
Takes in a Level for the default level, if it is an invalid value it will default to LTR
Returns nothing if text
is invalid UTF-8.
Sourcepub fn for_text_valid_utf8<'text>(
&self,
text: &'text str,
default_level: u8,
) -> Box<ICU4XBidiInfo<'text>>
pub fn for_text_valid_utf8<'text>( &self, text: &'text str, default_level: u8, ) -> Box<ICU4XBidiInfo<'text>>
Use the data loaded in this object to process a string and calculate bidi information
Takes in a Level for the default level, if it is an invalid value it will default to LTR
Sourcepub fn reorder_visual(&self, levels: &[u8]) -> Box<ICU4XReorderedIndexMap>
pub fn reorder_visual(&self, levels: &[u8]) -> Box<ICU4XReorderedIndexMap>
Utility function for producing reorderings given a list of levels
Produces a map saying which visual index maps to which source index.
The levels array must not have values greater than 126 (this is the Bidi maximum explicit depth plus one). Failure to follow this invariant may lead to incorrect results, but is still safe.
Sourcepub fn level_is_rtl(level: u8) -> bool
pub fn level_is_rtl(level: u8) -> bool
Check if a Level returned by level_at is an RTL level.
Invalid levels (numbers greater than 125) will be assumed LTR
Sourcepub fn level_is_ltr(level: u8) -> bool
pub fn level_is_ltr(level: u8) -> bool
Check if a Level returned by level_at is an LTR level.
Invalid levels (numbers greater than 125) will be assumed LTR