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.
Members
new
fn new(start_index: i32, length: i32) -> Self
start_index
fn start_index(self: &Self) -> i32
set_start_index
fn set_start_index(self: &Self, value: i32)
length
fn length(self: &Self) -> i32
set_length
fn set_length(self: &Self, value: i32)
from_range
fn from_range(range: Range<usize>) -> Result<Self, TextHighlightError>
Converts a half-open UTF-16 range without truncating either endpoint.
to_range
fn to_range(self: &Self) -> Result<Range<usize>, TextHighlightError>
range
fn range(self: &Self) -> Option<Range<usize>>
parse
fn parse(text: &str) -> Result<Self, FormatError>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneDebugDefaultStructuralPartialEqPartialEqEqTryFrom<Range<usize>>DisplayMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.