pub struct TextSelection {
pub base: i64,
pub extent: i64,
pub affinity: TextAffinity,
}
Expand description
A range of text that represents a selection. Although strings in FIDL’s wire format are UTF-8 encoded, these indices are measured in UTF-16 code units for legacy reasons. These text input APIs will eventually be replaced by fuchsia.ui.text, which uses code points instead.
Text selection is always directional. Direction should be determined by comparing base and extent.
Fields§
§base: i64
The offset at which the selection originates, as measured in UTF-16 code units.
Might be larger than, smaller than, or equal to extent.
extent: i64
The offset at which the selection terminates, as measured in UTF-16 code units.
When the user uses the arrow keys to adjust the selection, this is the value that changes. Similarly, if the current theme paints a caret on one side of the selection, this is the location at which to paint the caret.
Might be larger than, smaller than, or equal to base.
affinity: TextAffinity
If the text range is collapsed and has more than one visual location (e.g., occurs at a line break), which of the two locations to use when painting the caret.
Trait Implementations§
Source§impl Clone for TextSelection
impl Clone for TextSelection
Source§fn clone(&self) -> TextSelection
fn clone(&self) -> TextSelection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TextSelection
impl Debug for TextSelection
Source§impl<D: ResourceDialect> Decode<TextSelection, D> for TextSelection
impl<D: ResourceDialect> Decode<TextSelection, D> for TextSelection
Source§impl<D: ResourceDialect> Encode<TextSelection, D> for &TextSelection
impl<D: ResourceDialect> Encode<TextSelection, D> for &TextSelection
Source§impl<D: ResourceDialect, T0: Encode<i64, D>, T1: Encode<i64, D>, T2: Encode<TextAffinity, D>> Encode<TextSelection, D> for (T0, T1, T2)
impl<D: ResourceDialect, T0: Encode<i64, D>, T1: Encode<i64, D>, T2: Encode<TextAffinity, D>> Encode<TextSelection, D> for (T0, T1, T2)
Source§impl Hash for TextSelection
impl Hash for TextSelection
Source§impl Ord for TextSelection
impl Ord for TextSelection
Source§fn cmp(&self, other: &TextSelection) -> Ordering
fn cmp(&self, other: &TextSelection) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TextSelection
impl PartialEq for TextSelection
Source§impl PartialOrd for TextSelection
impl PartialOrd for TextSelection
Source§impl TypeMarker for TextSelection
impl TypeMarker for TextSelection
Source§type Owned = TextSelection
type Owned = TextSelection
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for TextSelection
impl ValueTypeMarker for TextSelection
Source§type Borrowed<'a> = &'a TextSelection
type Borrowed<'a> = &'a TextSelection
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for TextSelection
impl Eq for TextSelection
impl Persistable for TextSelection
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 UnwindSafe for TextSelection
Blanket Implementations§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)