Struct fidl_fuchsia_ui_input::TextSelection
source · 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 Autonull for TextSelection
impl Autonull for TextSelection
source§fn naturally_nullable(_context: &Context) -> bool
fn naturally_nullable(_context: &Context) -> bool
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 Decodable for TextSelection
impl Decodable for TextSelection
source§fn decode(&mut self, decoder: &mut Decoder<'_>, offset: usize) -> Result<()>
fn decode(&mut self, decoder: &mut Decoder<'_>, offset: usize) -> Result<()>
self
.
Callers must ensure that offset
is a multiple of
Layout::inline_align
, and that decoder.buf
has room for reading
Layout::inline_size
bytes at offset
. Read moresource§impl Encodable for TextSelection
impl Encodable for TextSelection
source§fn encode(
&mut self,
encoder: &mut Encoder<'_, '_>,
offset: usize,
recursion_depth: usize
) -> Result<()>
fn encode( &mut self, encoder: &mut Encoder<'_, '_>, offset: usize, recursion_depth: usize ) -> Result<()>
Handle::INVALID
. Callers must ensure that offset
is a
multiple of Layout::inline_align
, and that encoder.buf
has room for
writing Layout::inline_size
bytes at offset
. Read moresource§impl Hash for TextSelection
impl Hash for TextSelection
source§impl Layout for TextSelection
impl Layout for 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 supports_simple_copy() -> boolwhere
Self: Sized,
fn supports_simple_copy() -> boolwhere Self: Sized,
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<TextSelection> for TextSelection
impl PartialEq<TextSelection> for TextSelection
source§fn eq(&self, other: &TextSelection) -> bool
fn eq(&self, other: &TextSelection) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TextSelection> for TextSelection
impl PartialOrd<TextSelection> for TextSelection
source§fn partial_cmp(&self, other: &TextSelection) -> Option<Ordering>
fn partial_cmp(&self, other: &TextSelection) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for TextSelection
impl Eq for TextSelection
impl Persistable for TextSelection
impl StructuralEq for TextSelection
impl StructuralPartialEq for TextSelection
impl TopLevel for TextSelection
Auto Trait Implementations§
impl RefUnwindSafe for TextSelection
impl Send for TextSelection
impl Sync for TextSelection
impl Unpin for TextSelection
impl UnwindSafe for TextSelection
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutObject for Twhere
T: Layout,
impl<T> LayoutObject for Twhere T: Layout,
§fn inline_align(&self, context: &Context) -> usize
fn inline_align(&self, context: &Context) -> usize
Layout::inline_align
.§fn inline_size(&self, context: &Context) -> usize
fn inline_size(&self, context: &Context) -> usize
Layout::inline_size
.