pub struct BidiContext { /* private fields */ }

Implementations§

source§

impl BidiContext

source

pub fn new() -> Self

source

pub fn base_level(&self) -> Level

source

pub fn set_reorder_non_spacing_marks(&mut self, reorder: bool)

When reorder is set to true, reordering will apply rule L3 to non-spacing marks. This is likely more desirable for terminal based applications than it is for more modern GUI applications that feed into eg: harfbuzz.

source

pub fn runs<'a>(&'a self) -> impl Iterator<Item = BidiRun> + 'a

Produces a sequence of BidiRun structs that represent runs of text and their direction (and level) across the entire paragraph.

source

pub fn line_runs( &self, line_range: Range<usize> ) -> impl Iterator<Item = BidiRun>

Given a line_range (a subslice of the current paragraph that represents a single wrapped line), this method resets whitespace levels for the line boundaries, and then returns the set of runs for that line.

source

pub fn reordered_runs(&self, line_range: Range<usize>) -> Vec<ReorderedRun>

source

pub fn reorder_line(&self, line_range: Range<usize>) -> (Vec<Level>, Vec<usize>)

line_range indicates a contiguous range of character indices in the paragraph set via resolve_paragraph. This method returns the reordered set of indices for display purposes.

source

pub fn resolve_paragraph( &mut self, paragraph: &[char], hint: ParagraphDirectionHint )

source

pub fn set_char_types( &mut self, char_types: &[BidiClass], hint: ParagraphDirectionHint )

Trait Implementations§

source§

impl Debug for BidiContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BidiContext

source§

fn default() -> BidiContext

Returns the “default value” for a type. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.