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: Self)
fn add_assign(&mut self, rhs: Self)
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§
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