BidiData
struct · ferroui-base · v0.5.0
struct BidiData
Represents a unicode string and all associated attributes for each character required for the bidirectional Unicode algorithm
To avoid allocations, this class is designed to be reused.
Members
newparagraph_embedding_levelset_paragraph_embedding_levelhas_bracketshas_embeddingshas_isolateslengthclassesclasses_mutpaired_bracket_typespaired_bracket_types_mutpaired_bracket_valuesappendsave_typesrestore_typesget_temp_level_bufferreset
new
const fn new() -> Self
paragraph_embedding_level
fn paragraph_embedding_level(self: &Self) -> i8
set_paragraph_embedding_level
fn set_paragraph_embedding_level(self: &mut Self, value: i8)
has_brackets
fn has_brackets(self: &Self) -> Option<bool>
has_embeddings
fn has_embeddings(self: &Self) -> Option<bool>
has_isolates
fn has_isolates(self: &Self) -> Option<bool>
length
fn length(self: &Self) -> usize
Gets the length of the data held by the BidiData
This is the number of codepoints appended (a surrogate pair counts once).
classes
fn classes(self: &Self) -> &[BidiClass]
Gets the bidi character type of each code point
classes_mut
fn classes_mut(self: &mut Self) -> &mut [BidiClass]
The mutable view of BidiData::classes (the slice is writable upstream).
paired_bracket_types
fn paired_bracket_types(self: &Self) -> &[BidiPairedBracketType]
Gets the paired bracket type for each code point
paired_bracket_types_mut
fn paired_bracket_types_mut(self: &mut Self) -> &mut [BidiPairedBracketType]
The mutable view of BidiData::paired_bracket_types (the slice is writable upstream).
paired_bracket_values
fn paired_bracket_values(self: &Self) -> &[i32]
Gets the paired bracket value for code point
The paired bracket values are the code points of each character where the opening code point is replaced with the closing code point for easier matching. Also, bracket code points are mapped to their canonical equivalents
append
fn append(self: &mut Self, text: &[u16])
Appends text to the bidi data.
text- The text to process.
save_types
fn save_types(self: &mut Self)
Save the Types and PairedBracketTypes of this BiDiData
This is used when processing embedded style runs with BiDiClass overrides. Text layout process saves the data, overrides the style runs to neutral, processes the bidi data for the entire paragraph and then restores this data before processing the embedded runs.
restore_types
fn restore_types(self: &mut Self)
Restore the data saved by SaveTypes
get_temp_level_buffer
fn get_temp_level_buffer(self: &mut Self, length: usize) -> &mut [i8]
Gets a temporary level buffer. Used by the text layout process when resolving style runs with different BiDiClass.
length- Length of the required buffer
Returns a level buffer of that length (zeroed here; uninitialized upstream).
reset
fn reset(self: &mut Self)
Resets the bidi data to a clean state.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDebugDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.