pub struct TextRunChild {
pub text: String,
pub char_offset: usize,
pub byte_offset: usize,
pub is_selected: bool,
}Expand description
A synthesized text-run segment for caret/selection exposure.
Text nodes that carry a TextSelection are split into up to three
TextRunChild segments by crate::tree::synthesize_text_run_children:
the text before the selection, the selected span, and the text after
the selection. Nodes with no selection produce a single segment for the
whole text.
Offsets are expressed both as byte indices (for slicing) and as char
indices (for AccessKit’s TextPosition.character_index).
Fields§
§text: StringThe UTF-8 text content of this segment.
char_offset: usize0-based character index of the first character in this segment.
byte_offset: usize0-based byte index of the first byte in this segment.
is_selected: booltrue if this segment falls within the selection range.
Trait Implementations§
Source§impl Clone for TextRunChild
impl Clone for TextRunChild
Source§fn clone(&self) -> TextRunChild
fn clone(&self) -> TextRunChild
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextRunChild
impl Debug for TextRunChild
Source§impl Default for TextRunChild
impl Default for TextRunChild
Source§fn default() -> TextRunChild
fn default() -> TextRunChild
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextRunChild
impl RefUnwindSafe for TextRunChild
impl Send for TextRunChild
impl Sync for TextRunChild
impl Unpin for TextRunChild
impl UnsafeUnpin for TextRunChild
impl UnwindSafe for TextRunChild
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more