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 Cursor::EndAligned(-1) and ends at Cursor::EndAligned(0)
Trait Implementations§
source§impl DataSize for Cursor
impl DataSize for Cursor
source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
If
true, the type has a heap size that can vary at runtime, depending on the actual value.source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
The amount of space a value of the type always occupies. If
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Estimates the size of heap memory taken up by this value. Read more
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 for Cursor
impl PartialEq 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