pub enum Cursor {
BeginAligned(usize),
EndAligned(isize),
}Expand description
A cursor points to a specific point in a text. I Used to select offsets. Units are unicode codepoints (not bytes!) and are 0-indexed.
The cursor can be either begin-aligned or end-aligned. Where BeginAlignedCursor(0) is the first unicode codepoint in a referenced text, and EndAlignedCursor(0) the last one.
Variants§
BeginAligned(usize)
Cursor relative to the start of a text. Has a value of 0 or higher
EndAligned(isize)
Cursor relative to the end of a text. Has a value of 0 or lower. The last character of a text begins at EndAlignedCursor(-1) and ends at EndAlignedCursor(0)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Cursor
impl<'de> Deserialize<'de> for Cursor
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Cursor> for Cursor
impl PartialEq<Cursor> for Cursor
impl Copy for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
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