pub struct TextPosition {
pub offset: i32,
pub affinity: TextAffinity,
}Expand description
Fields§
§offset: i32The index of the character that immediately follows the position in the string representation of the text.
affinity: TextAffinityDisambiguates cases where the offset could be at the end of one line or the start of the next.
Implementations§
Source§impl TextPosition
impl TextPosition
Sourcepub const fn new(offset: i32) -> TextPosition
pub const fn new(offset: i32) -> TextPosition
Creates an object representing a particular position in a string, with downstream affinity.
Sourcepub const fn with_affinity(offset: i32, affinity: TextAffinity) -> TextPosition
pub const fn with_affinity(offset: i32, affinity: TextAffinity) -> TextPosition
Creates an object representing a particular position in a string.
Trait Implementations§
Source§impl Clone for TextPosition
impl Clone for TextPosition
Source§fn clone(&self) -> TextPosition
fn clone(&self) -> TextPosition
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 TextPosition
Source§impl Debug for TextPosition
impl Debug for TextPosition
impl Eq for TextPosition
Source§impl Hash for TextPosition
impl Hash for TextPosition
Source§impl PartialEq for TextPosition
impl PartialEq for TextPosition
impl StructuralPartialEq for TextPosition
Auto Trait Implementations§
impl Freeze for TextPosition
impl RefUnwindSafe for TextPosition
impl Send for TextPosition
impl Sync for TextPosition
impl Unpin for TextPosition
impl UnsafeUnpin for TextPosition
impl UnwindSafe for TextPosition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.