pub struct TextSelection {
pub anchor: usize,
pub focus: usize,
}Expand description
A text selection expressed as byte offsets (anchor/focus).
Semantically equivalent to TextCaret but with different field names to
match the spec’s A11yNodeProps::text_selection field.
Fields§
§anchor: usizeByte offset of the anchor (the fixed end).
focus: usizeByte offset of the focus (the moving end / caret position).
Implementations§
Trait Implementations§
Source§impl Clone for TextSelection
impl Clone for TextSelection
Source§fn clone(&self) -> TextSelection
fn clone(&self) -> TextSelection
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 moreimpl Copy for TextSelection
Source§impl Debug for TextSelection
impl Debug for TextSelection
Source§impl Default for TextSelection
impl Default for TextSelection
Source§fn default() -> TextSelection
fn default() -> TextSelection
Returns the “default value” for a type. Read more
impl Eq for TextSelection
Source§impl Hash for TextSelection
impl Hash for TextSelection
Source§impl PartialEq for TextSelection
impl PartialEq for TextSelection
Source§fn eq(&self, other: &TextSelection) -> bool
fn eq(&self, other: &TextSelection) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TextSelection
Auto Trait Implementations§
impl Freeze for TextSelection
impl RefUnwindSafe for TextSelection
impl Send for TextSelection
impl Sync for TextSelection
impl Unpin for TextSelection
impl UnsafeUnpin for TextSelection
impl UnwindSafe for TextSelection
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