Struct icu_capi::bidi::ffi::Bidi

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

source

pub fn create() -> Box<Bidi>

Creates a new Bidi from locale data using compiled data.

source

pub fn create_with_provider( provider: &DataProvider, ) -> Result<Box<Bidi>, DataError>

Creates a new Bidi from locale data, and a particular data source.

source

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.

source

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

source

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.

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§

§

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> 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> 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
where T: Send + Sync,