Struct icu_capi::bidi::ffi::ICU4XBidi

source ·
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

source

pub fn create( provider: &ICU4XDataProvider, ) -> Result<Box<ICU4XBidi>, ICU4XError>

Creates a new ICU4XBidi from locale data.

source

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.

source

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

source

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.

source

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

source

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

source

pub fn level_rtl() -> u8

Get a basic RTL Level value

source

pub fn level_ltr() -> u8

Get a simple LTR Level value

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T