pub struct BidiContext { /* private fields */ }
Implementations§
Source§impl BidiContext
impl BidiContext
pub fn new() -> Self
pub fn base_level(&self) -> Level
Sourcepub fn set_reorder_non_spacing_marks(&mut self, reorder: bool)
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.
Sourcepub fn runs<'a>(&'a self) -> impl Iterator<Item = BidiRun> + 'a
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.
Sourcepub fn line_runs(
&self,
line_range: Range<usize>,
) -> impl Iterator<Item = BidiRun>
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.
pub fn reordered_runs(&self, line_range: Range<usize>) -> Vec<ReorderedRun>
Sourcepub fn reorder_line(&self, line_range: Range<usize>) -> (Vec<Level>, Vec<usize>)
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.
Sourcepub fn resolve_paragraph(
&mut self,
paragraph: &[char],
hint: ParagraphDirectionHint,
)
pub fn resolve_paragraph( &mut self, paragraph: &[char], hint: ParagraphDirectionHint, )
pub fn set_char_types( &mut self, char_types: &[BidiClass], hint: ParagraphDirectionHint, )
Trait Implementations§
Source§impl Debug for BidiContext
impl Debug for BidiContext
Source§impl Default for BidiContext
impl Default for BidiContext
Source§fn default() -> BidiContext
fn default() -> BidiContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BidiContext
impl RefUnwindSafe for BidiContext
impl Send for BidiContext
impl Sync for BidiContext
impl Unpin for BidiContext
impl UnwindSafe for BidiContext
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
Mutably borrows from an owned value. Read more