pub struct CharIndex(pub usize);Expand description
A character (Unicode scalar) offset into a string.
Counts characters, not bytes, so it is independent of the UTF-8 encoding.
Not to be confused with ByteIndex. See also super::cursor::CCursor.
Tuple Fields§
§0: usizeImplementations§
Trait Implementations§
Source§impl AddAssign for CharIndex
impl AddAssign for CharIndex
Source§fn add_assign(&mut self, rhs: CharIndex)
fn add_assign(&mut self, rhs: CharIndex)
Performs the
+= operation. Read moreSource§impl AddAssign<usize> for CharIndex
impl AddAssign<usize> for CharIndex
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+= operation. Read moreimpl Copy for CharIndex
impl Eq for CharIndex
Source§impl Ord for CharIndex
impl Ord for CharIndex
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for CharIndex
impl PartialOrd for CharIndex
impl StructuralPartialEq for CharIndex
Auto Trait Implementations§
impl Freeze for CharIndex
impl RefUnwindSafe for CharIndex
impl Send for CharIndex
impl Sync for CharIndex
impl Unpin for CharIndex
impl UnsafeUnpin for CharIndex
impl UnwindSafe for CharIndex
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for 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
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<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