FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextHighlightRange

    struct · ferroui-controls · v0.5.0

    struct TextHighlightRange
    

    A copied start/length value in UTF-16 coordinates.

    The signed fields preserve the source value contract. Invalid values can be represented (including in markup), but renderers ignore them. Rust ranges use half-open endpoints. This type is called TextRange in markup; its Rust name distinguishes it from the document's live pointer range.

    Cloning copies both fields. Interior mutability exists only so markup can initialize a boxed value; collections always copy values on insertion/read.

    View source

    Members

    new

    fn new(start_index: i32, length: i32) -> Self
    

    Source

    start_index

    fn start_index(self: &Self) -> i32
    

    Source

    set_start_index

    fn set_start_index(self: &Self, value: i32)
    

    Source

    length

    fn length(self: &Self) -> i32
    

    Source

    set_length

    fn set_length(self: &Self, value: i32)
    

    Source

    from_range

    fn from_range(range: Range<usize>) -> Result<Self, TextHighlightError>
    

    Converts a half-open UTF-16 range without truncating either endpoint.

    Source

    to_range

    fn to_range(self: &Self) -> Result<Range<usize>, TextHighlightError>
    

    Source

    range

    fn range(self: &Self) -> Option<Range<usize>>
    

    Source

    parse

    fn parse(text: &str) -> Result<Self, FormatError>
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • Default
    • StructuralPartialEq
    • PartialEq
    • Eq
    • TryFrom<Range<usize>>
    • Display
    • MarkupTyped
    • ValueTypeRegistration

    Availability

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