pub struct Bidi(pub CodePointMapData<BidiClass>);
Expand description
An ICU4X Bidi object, containing loaded bidi data
Tuple Fields§
§0: CodePointMapData<BidiClass>
Implementations§
source§impl Bidi
impl Bidi
sourcepub fn create(provider: &DataProvider) -> Result<Box<Bidi>, DataError>
pub fn create(provider: &DataProvider) -> Result<Box<Bidi>, DataError>
Creates a new Bidi
from locale data.
sourcepub fn for_text_utf8<'text>(
&self,
text: &'text DiplomatStr,
default_level: Option<u8>,
) -> Option<Box<BidiInfo<'text>>>
pub fn for_text_utf8<'text>( &self, text: &'text DiplomatStr, default_level: Option<u8>, ) -> Option<Box<BidiInfo<'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 or None it will default to Auto.
Returns nothing if text
is invalid UTF-8.
sourcepub fn for_text_valid_utf8<'text>(
&self,
text: &'text str,
default_level: Option<u8>,
) -> Box<BidiInfo<'text>>
pub fn for_text_valid_utf8<'text>( &self, text: &'text str, default_level: Option<u8>, ) -> Box<BidiInfo<'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<ReorderedIndexMap>
pub fn reorder_visual(&self, levels: &[u8]) -> Box<ReorderedIndexMap>
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 Bidi
impl RefUnwindSafe for Bidi
impl Send for Bidi
impl Sync for Bidi
impl Unpin for Bidi
impl UnwindSafe for Bidi
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> 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