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
Auto Trait Implementations§
impl Freeze for ICU4XBidi
impl RefUnwindSafe for ICU4XBidi
impl !Send for ICU4XBidi
impl !Sync for ICU4XBidi
impl Unpin for ICU4XBidi
impl UnwindSafe for ICU4XBidi
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more