#[repr(u32)]pub enum TextAffinity {
Upstream = 0,
Downstream = 1,
}
Expand description
Whether a TextPosition is visually upstream or downstream of its offset.
For example, when a text position exists at a line break, a single offset has two visual positions, one prior to the line break (at the end of the first line) and one after the line break (at the start of the second line). A text affinity disambiguates between those cases. (Something similar happens with between runs of bidirectional text.)
We do not expect new values to be added to this enum.
Variants§
Upstream = 0
The position has affinity for the upstream side of the text position.
For example, if the offset of the text position is a line break, the position represents the end of the first line.
Downstream = 1
The position has affinity for the downstream side of the text position.
For example, if the offset of the text position is a line break, the position represents the start of the second line.
Implementations§
Source§impl TextAffinity
impl TextAffinity
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
Source§impl Clone for TextAffinity
impl Clone for TextAffinity
Source§fn clone(&self) -> TextAffinity
fn clone(&self) -> TextAffinity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TextAffinity
impl Debug for TextAffinity
Source§impl<D: ResourceDialect> Decode<TextAffinity, D> for TextAffinity
impl<D: ResourceDialect> Decode<TextAffinity, D> for TextAffinity
Source§impl<D: ResourceDialect> Encode<TextAffinity, D> for TextAffinity
impl<D: ResourceDialect> Encode<TextAffinity, D> for TextAffinity
Source§impl Hash for TextAffinity
impl Hash for TextAffinity
Source§impl Ord for TextAffinity
impl Ord for TextAffinity
Source§fn cmp(&self, other: &TextAffinity) -> Ordering
fn cmp(&self, other: &TextAffinity) -> 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 TextAffinity
impl PartialEq for TextAffinity
Source§impl PartialOrd for TextAffinity
impl PartialOrd for TextAffinity
Source§impl TypeMarker for TextAffinity
impl TypeMarker for TextAffinity
Source§type Owned = TextAffinity
type Owned = TextAffinity
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
.Source§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 moreSource§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 TextAffinity
impl ValueTypeMarker for TextAffinity
Source§type Borrowed<'a> = TextAffinity
type Borrowed<'a> = TextAffinity
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for TextAffinity
impl Eq for TextAffinity
impl StructuralPartialEq for TextAffinity
Auto Trait Implementations§
impl Freeze for TextAffinity
impl RefUnwindSafe for TextAffinity
impl Send for TextAffinity
impl Sync for TextAffinity
impl Unpin for TextAffinity
impl UnwindSafe for TextAffinity
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
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
)