FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    const fn new() -> Self
    

    Source

    paragraph_embedding_level

    fn paragraph_embedding_level(self: &Self) -> i8
    

    Source

    set_paragraph_embedding_level

    fn set_paragraph_embedding_level(self: &mut Self, value: i8)
    

    Source

    has_brackets

    fn has_brackets(self: &Self) -> Option<bool>
    

    Source

    has_embeddings

    fn has_embeddings(self: &Self) -> Option<bool>
    

    Source

    has_isolates

    fn has_isolates(self: &Self) -> Option<bool>
    

    Source

    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).

    Source

    classes

    fn classes(self: &Self) -> &[BidiClass]
    

    Gets the bidi character type of each code point

    Source

    classes_mut

    fn classes_mut(self: &mut Self) -> &mut [BidiClass]
    

    The mutable view of BidiData::classes (the slice is writable upstream).

    Source

    paired_bracket_types

    fn paired_bracket_types(self: &Self) -> &[BidiPairedBracketType]
    

    Gets the paired bracket type for each code point

    Source

    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).

    Source

    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

    Source

    append

    fn append(self: &mut Self, text: &[u16])
    

    Appends text to the bidi data.

    • text - The text to process.

    Source

    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.

    Source

    restore_types

    fn restore_types(self: &mut Self)
    

    Restore the data saved by SaveTypes

    Source

    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).

    Source

    reset

    fn reset(self: &mut Self)
    

    Resets the bidi data to a clean state.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • Debug
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.