FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    LineBreakEnumerator

    struct · ferroui-base · v0.5.0

    struct LineBreakEnumerator<'a>
    

    Enumerates the line break opportunities of UTF-16 text (UAX #14).

    View source

    Members

    new

    fn new(text: &'a [u16]) -> Self
    

    Source

    text

    const fn text(self: &Self) -> &'a [u16]
    

    The text being enumerated (a public field upstream).

    Source

    move_next

    fn move_next(self: &mut Self) -> Option<LineBreak>
    

    Moves to the next LineBreak; returns None when there are no more.

    Source

    first_required

    fn first_required(text: &[u16]) -> Option<LineBreak>
    

    The first required break of text: the first break the enumerator gives whose LineBreak::required is set, found without the rules. A break is required after a hard line break only (classes BK, CR, LF and NL: U+000A to U+000D, U+0085, U+2028 and U+2029; CR LF breaks once, after the LF), so the text is scanned for those characters; a text without one has no required break (the break at the end of such a text is not required).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • IntoIterator
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • Iterator

    Availability

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